diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index a6064478b971..6b2da4c58b40 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -4,7 +4,7 @@ ### PR checklist - [ ] Read the [contribution guidelines](https://github.com/openapitools/openapi-generator/blob/master/CONTRIBUTING.md). -- [ ] If contributing template-only or documentation-only changes which will change sample output, [build the project](https://github.com/OpenAPITools/openapi-generator#14---build-projects) before. -- [ ] Run the shell script(s) under `./bin/` (or Windows batch scripts under`.\bin\windows`) to update Petstore samples related to your fix. This is important, as CI jobs will verify _all_ generator outputs of your HEAD commit, and these must match the expectations made by your contribution. You only need to run `./bin/{LANG}-petstore.sh`, `./bin/openapi3/{LANG}-petstore.sh` if updating the code or mustache templates for a language (`{LANG}`) (e.g. php, ruby, python, etc). +- [ ] If contributing template-only or documentation-only changes which will change sample output, [build the project](https://github.com/OpenAPITools/openapi-generator#14---build-projects) beforehand. +- [ ] Run the shell script `./bin/generate-samples.sh`to update all Petstore samples related to your fix. This is important, as CI jobs will verify _all_ generator outputs of your HEAD commit as it would merge with master. These must match the expectations made by your contribution. You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example `./bin/generate-samples.sh bin/config/java*`. - [ ] File the PR against the [correct branch](https://github.com/OpenAPITools/openapi-generator/wiki/Git-Branches): `master`, `4.3.x`, `5.0.x`. Default: `master`. - [ ] Copy the [technical committee](https://github.com/openapitools/openapi-generator/#62---openapi-generator-technical-committee) to review the pull request if your PR is targeting a particular programming language. diff --git a/CI/.drone.yml b/CI/.drone.yml index 3cb1983fbb54..55d437c07d61 100644 --- a/CI/.drone.yml +++ b/CI/.drone.yml @@ -38,6 +38,6 @@ steps: # generate test scripts - /bin/bash bin/tests/run-all-test # generate all petstore samples (client, servers, doc) - - /bin/bash bin/run-all-petstore + - /bin/bash bin/generate-samples.sh # generate all petstore samples (openapi3) - - /bin/bash bin/openapi3/run-all-petstore + - /bin/bash bin/generate-samples.sh bin/configs/other/*.yaml diff --git a/CI/bitrise.yml b/CI/bitrise.yml index de1bf901f268..73d2e2b29a3c 100644 --- a/CI/bitrise.yml +++ b/CI/bitrise.yml @@ -38,7 +38,7 @@ workflows: set -e - sh bin/swift5-all.sh + sh bin/generate-samples.sh bin/configs/swift5-*.yaml - script@1.1.5: title: Run Swift5 tests inputs: diff --git a/CI/samples.ci/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/CI/samples.ci/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj deleted file mode 100644 index 4893f78082ae..000000000000 --- a/CI/samples.ci/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - netcoreapp2.0 - - false - - - - - Org.OpenAPITools - - - - - - - - - - - diff --git a/CI/samples.ci/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/obj/Debug/netcoreapp2.0/Org.OpenAPITools.Test.AssemblyInfo.cs b/CI/samples.ci/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/obj/Debug/netcoreapp2.0/Org.OpenAPITools.Test.AssemblyInfo.cs deleted file mode 100644 index 0c9ebe094577..000000000000 --- a/CI/samples.ci/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/obj/Debug/netcoreapp2.0/Org.OpenAPITools.Test.AssemblyInfo.cs +++ /dev/null @@ -1,23 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -using System; -using System.Reflection; - -[assembly: System.Reflection.AssemblyCompanyAttribute("Org.OpenAPITools.Test")] -[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] -[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] -[assembly: System.Reflection.AssemblyProductAttribute("Org.OpenAPITools.Test")] -[assembly: System.Reflection.AssemblyTitleAttribute("Org.OpenAPITools.Test")] -[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] - -// Generated by the MSBuild WriteCodeFragment class. - diff --git a/CI/samples.ci/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/obj/Debug/netcoreapp2.0/Org.OpenAPITools.Test.AssemblyInfoInputs.cache b/CI/samples.ci/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/obj/Debug/netcoreapp2.0/Org.OpenAPITools.Test.AssemblyInfoInputs.cache deleted file mode 100644 index 217033a3db20..000000000000 --- a/CI/samples.ci/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/obj/Debug/netcoreapp2.0/Org.OpenAPITools.Test.AssemblyInfoInputs.cache +++ /dev/null @@ -1 +0,0 @@ -19e887ae0fddb9fd03c4341951ee9077703a652f diff --git a/CI/samples.ci/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/CI/samples.ci/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj deleted file mode 100644 index 4893f78082ae..000000000000 --- a/CI/samples.ci/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - netcoreapp2.0 - - false - - - - - Org.OpenAPITools - - - - - - - - - - - diff --git a/CI/samples.ci/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/obj/Debug/netcoreapp2.0/Org.OpenAPITools.Test.AssemblyInfo.cs b/CI/samples.ci/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/obj/Debug/netcoreapp2.0/Org.OpenAPITools.Test.AssemblyInfo.cs deleted file mode 100644 index 0c9ebe094577..000000000000 --- a/CI/samples.ci/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/obj/Debug/netcoreapp2.0/Org.OpenAPITools.Test.AssemblyInfo.cs +++ /dev/null @@ -1,23 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -using System; -using System.Reflection; - -[assembly: System.Reflection.AssemblyCompanyAttribute("Org.OpenAPITools.Test")] -[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] -[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] -[assembly: System.Reflection.AssemblyProductAttribute("Org.OpenAPITools.Test")] -[assembly: System.Reflection.AssemblyTitleAttribute("Org.OpenAPITools.Test")] -[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] - -// Generated by the MSBuild WriteCodeFragment class. - diff --git a/CI/samples.ci/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/obj/Debug/netcoreapp2.0/Org.OpenAPITools.Test.AssemblyInfoInputs.cache b/CI/samples.ci/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/obj/Debug/netcoreapp2.0/Org.OpenAPITools.Test.AssemblyInfoInputs.cache deleted file mode 100644 index 217033a3db20..000000000000 --- a/CI/samples.ci/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/obj/Debug/netcoreapp2.0/Org.OpenAPITools.Test.AssemblyInfoInputs.cache +++ /dev/null @@ -1 +0,0 @@ -19e887ae0fddb9fd03c4341951ee9077703a652f diff --git a/CI/samples.ci/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/CI/samples.ci/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj deleted file mode 100644 index 9b5a34202cb4..000000000000 --- a/CI/samples.ci/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +++ /dev/null @@ -1,92 +0,0 @@ - - - - - Debug - AnyCPU - {19F1DEBC-DE5E-4517-8062-F000CD499087} - Library - Properties - Org.OpenAPITools.Test - Org.OpenAPITools.Test - v4.5 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - $(SolutionDir)\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll - ..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll - ..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll - ..\..\vendor\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll - - - $(SolutionDir)\packages\JsonSubTypes.1.6.0\lib\net45\JsonSubTypes.dll - ..\packages\JsonSubTypes.1.6.0\lib\net45\JsonSubTypes.dll - ..\..\packages\JsonSubTypes.1.6.0\lib\net45\JsonSubTypes.dll - ..\..\vendor\JsonSubTypes.1.6.0\lib\net45\JsonSubTypes.dll - - - $(SolutionDir)\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll - ..\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll - ..\..\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll - ..\..\vendor\RestSharp.105.1.0\lib\net45\RestSharp.dll - - - $(SolutionDir)\packages\NUnit.3.11.0\lib\net45\nunit.framework.dll - ..\packages\NUnit.3.11.0\lib\net45\nunit.framework.dll - ..\..\packages\NUnit.3.11.0\lib\net45\nunit.framework.dll - ..\..\vendor\NUnit.3.11.0\lib\net45\nunit.framework.dll - - - - - - - - - - - - {321C8C3F-0156-40C1-AE42-D59761FB9B6C} - Org.OpenAPITools - - - - - - - diff --git a/CI/samples.ci/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/obj/Debug/Org.OpenAPITools.Test.csprojAssemblyReference.cache b/CI/samples.ci/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/obj/Debug/Org.OpenAPITools.Test.csprojAssemblyReference.cache deleted file mode 100644 index 2bd5c20b30f3..000000000000 Binary files a/CI/samples.ci/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/obj/Debug/Org.OpenAPITools.Test.csprojAssemblyReference.cache and /dev/null differ diff --git a/CI/samples.ci/client/petstore/java/jersey2-java6/build.gradle b/CI/samples.ci/client/petstore/java/jersey2-java6/build.gradle deleted file mode 100644 index d540a137bd36..000000000000 --- a/CI/samples.ci/client/petstore/java/jersey2-java6/build.gradle +++ /dev/null @@ -1,122 +0,0 @@ -apply plugin: 'idea' -apply plugin: 'eclipse' - -group = 'org.openapitools' -version = '1.0.0' - -buildscript { - repositories { - jcenter { - url "https://jcenter.bintray.com/" - } - } - dependencies { - classpath 'com.android.tools.build:gradle:2.3.+' - classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' - } -} - -repositories { - jcenter { - url "http://jcenter.bintray.com/" - } -} - - -if(hasProperty('target') && target == 'android') { - - apply plugin: 'com.android.library' - apply plugin: 'com.github.dcendents.android-maven' - - android { - compileSdkVersion 25 - buildToolsVersion '25.0.2' - defaultConfig { - minSdkVersion 14 - targetSdkVersion 25 - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_6 - targetCompatibility JavaVersion.VERSION_1_6 - } - - // Rename the aar correctly - libraryVariants.all { variant -> - variant.outputs.each { output -> - def outputFile = output.outputFile - if (outputFile != null && outputFile.name.endsWith('.aar')) { - def fileName = "${project.name}-${variant.baseName}-${version}.aar" - output.outputFile = new File(outputFile.parent, fileName) - } - } - } - - dependencies { - provided 'javax.annotation:jsr250-api:1.0' - } - } - - afterEvaluate { - android.libraryVariants.all { variant -> - def task = project.tasks.create "jar${variant.name.capitalize()}", Jar - task.description = "Create jar artifact for ${variant.name}" - task.dependsOn variant.javaCompile - task.from variant.javaCompile.destinationDir - task.destinationDir = project.file("${project.buildDir}/outputs/jar") - task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" - artifacts.add('archives', task); - } - } - - task sourcesJar(type: Jar) { - from android.sourceSets.main.java.srcDirs - classifier = 'sources' - } - - artifacts { - archives sourcesJar - } - -} else { - - apply plugin: 'java' - apply plugin: 'maven' - sourceCompatibility = JavaVersion.VERSION_1_6 - targetCompatibility = JavaVersion.VERSION_1_6 - - install { - repositories.mavenInstaller { - pom.artifactId = 'petstore-jersey2-java6' - } - } - - task execute(type:JavaExec) { - main = System.getProperty('mainClass') - classpath = sourceSets.main.runtimeClasspath - } -} - -ext { - swagger_annotations_version = "1.5.20" - jackson_version = "2.9.6" - jersey_version = "2.6" - commons_io_version=2.5 - commons_lang3_version=3.6 - junit_version = "4.13" - threetenbp_version = "2.6.4" -} - -dependencies { - compile "io.swagger:swagger-annotations:$swagger_annotations_version" - compile "org.glassfish.jersey.core:jersey-client:$jersey_version" - compile "org.glassfish.jersey.media:jersey-media-multipart:$jersey_version" - compile "org.glassfish.jersey.media:jersey-media-json-jackson:$jersey_version" - compile "com.fasterxml.jackson.core:jackson-core:$jackson_version" - compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" - compile "com.fasterxml.jackson.core:jackson-databind:$jackson_version" - compile "commons-io:commons-io:$commons_io_version" - compile "org.apache.commons:commons-lang3:$commons_lang3_version" - compile "com.github.joschi.jackson:jackson-datatype-threetenbp:$threetenbp_version" - compile "com.brsanthu:migbase64:2.2" - testCompile "junit:junit:$junit_version" -} diff --git a/CI/samples.ci/client/petstore/java/test-manual/common/ConfigurationTest.java b/CI/samples.ci/client/petstore/java/test-manual/common/ConfigurationTest.java deleted file mode 100644 index f05c230dc758..000000000000 --- a/CI/samples.ci/client/petstore/java/test-manual/common/ConfigurationTest.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.openapitools.client; - -import org.junit.*; -import static org.junit.Assert.*; - - -public class ConfigurationTest { - @Test - public void testDefaultApiClient() { - ApiClient apiClient = Configuration.getDefaultApiClient(); - assertNotNull(apiClient); - assertEquals("http://petstore.swagger.io:80/v2", apiClient.getBasePath()); - assertFalse(apiClient.isDebugging()); - } -} diff --git a/CI/samples.ci/client/petstore/java/test-manual/common/StringUtilTest.java b/CI/samples.ci/client/petstore/java/test-manual/common/StringUtilTest.java deleted file mode 100644 index aa7c81759ec4..000000000000 --- a/CI/samples.ci/client/petstore/java/test-manual/common/StringUtilTest.java +++ /dev/null @@ -1,33 +0,0 @@ -package org.openapitools.client; - -import org.junit.*; -import static org.junit.Assert.*; - - -public class StringUtilTest { - @Test - public void testContainsIgnoreCase() { - assertTrue(StringUtil.containsIgnoreCase(new String[]{"abc"}, "abc")); - assertTrue(StringUtil.containsIgnoreCase(new String[]{"abc"}, "ABC")); - assertTrue(StringUtil.containsIgnoreCase(new String[]{"ABC"}, "abc")); - assertTrue(StringUtil.containsIgnoreCase(new String[]{null, "abc"}, "ABC")); - assertTrue(StringUtil.containsIgnoreCase(new String[]{null, "abc"}, null)); - - assertFalse(StringUtil.containsIgnoreCase(new String[]{"abc"}, "def")); - assertFalse(StringUtil.containsIgnoreCase(new String[]{}, "ABC")); - assertFalse(StringUtil.containsIgnoreCase(new String[]{}, null)); - } - - @Test - public void testJoin() { - String[] array = {"aa", "bb", "cc"}; - assertEquals("aa,bb,cc", StringUtil.join(array, ",")); - assertEquals("aa, bb, cc", StringUtil.join(array, ", ")); - assertEquals("aabbcc", StringUtil.join(array, "")); - assertEquals("aa bb cc", StringUtil.join(array, " ")); - assertEquals("aa\nbb\ncc", StringUtil.join(array, "\n")); - - assertEquals("", StringUtil.join(new String[]{}, ",")); - assertEquals("abc", StringUtil.join(new String[]{"abc"}, ",")); - } -} diff --git a/CI/samples.ci/client/petstore/java/test-manual/jersey1/ApiClientTest.java b/CI/samples.ci/client/petstore/java/test-manual/jersey1/ApiClientTest.java deleted file mode 100644 index 682690f049d5..000000000000 --- a/CI/samples.ci/client/petstore/java/test-manual/jersey1/ApiClientTest.java +++ /dev/null @@ -1,291 +0,0 @@ -package org.openapitools.client; - -import org.openapitools.client.auth.*; - -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.*; - -import org.junit.*; -import static org.junit.Assert.*; - - -public class ApiClientTest { - ApiClient apiClient = null; - - @Before - public void setup() { - apiClient = new ApiClient(); - } - - @Test - public void testParseAndFormatDate() { - // default date format - String dateStr = "2015-11-07T03:49:09.356Z"; - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09.356+00:00"))); - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09.356Z"))); - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T05:49:09.356+02:00"))); - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T02:49:09.356-01:00"))); - - // custom date format: without milli-seconds, custom time zone - DateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX", Locale.ROOT); - format.setTimeZone(TimeZone.getTimeZone("GMT+10")); - apiClient.setDateFormat(format); - dateStr = "2015-11-07T13:49:09+10:00"; - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09+00:00"))); - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09Z"))); - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T00:49:09-03:00"))); - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T13:49:09+10:00"))); - } - - @Test - public void testIsJsonMime() { - assertFalse(apiClient.isJsonMime(null)); - assertFalse(apiClient.isJsonMime("")); - assertFalse(apiClient.isJsonMime("text/plain")); - assertFalse(apiClient.isJsonMime("application/xml")); - assertFalse(apiClient.isJsonMime("application/jsonp")); - assertFalse(apiClient.isJsonMime("example/json")); - assertFalse(apiClient.isJsonMime("example/foo+bar+jsonx")); - assertFalse(apiClient.isJsonMime("example/foo+bar+xjson")); - - assertTrue(apiClient.isJsonMime("application/json")); - assertTrue(apiClient.isJsonMime("application/json; charset=UTF8")); - assertTrue(apiClient.isJsonMime("APPLICATION/JSON")); - - assertTrue(apiClient.isJsonMime("application/problem+json")); - assertTrue(apiClient.isJsonMime("APPLICATION/PROBLEM+JSON")); - assertTrue(apiClient.isJsonMime("application/json\t")); - assertTrue(apiClient.isJsonMime("example/foo+bar+json")); - assertTrue(apiClient.isJsonMime("example/foo+json;x;y")); - assertTrue(apiClient.isJsonMime("example/foo+json\t;")); - assertTrue(apiClient.isJsonMime("Example/fOO+JSON")); - } - - @Test - public void testSelectHeaderAccept() { - String[] accepts = {"application/json", "application/xml"}; - assertEquals("application/json", apiClient.selectHeaderAccept(accepts)); - - accepts = new String[]{"APPLICATION/XML", "APPLICATION/JSON"}; - assertEquals("APPLICATION/JSON", apiClient.selectHeaderAccept(accepts)); - - accepts = new String[]{"application/xml", "application/json; charset=UTF8"}; - assertEquals("application/json; charset=UTF8", apiClient.selectHeaderAccept(accepts)); - - accepts = new String[]{"text/plain", "application/xml"}; - assertEquals("text/plain,application/xml", apiClient.selectHeaderAccept(accepts)); - - accepts = new String[]{}; - assertNull(apiClient.selectHeaderAccept(accepts)); - } - - @Test - public void testSelectHeaderContentType() { - String[] contentTypes = {"application/json", "application/xml"}; - assertEquals("application/json", apiClient.selectHeaderContentType(contentTypes)); - - contentTypes = new String[]{"APPLICATION/JSON", "APPLICATION/XML"}; - assertEquals("APPLICATION/JSON", apiClient.selectHeaderContentType(contentTypes)); - - contentTypes = new String[]{"application/xml", "application/json; charset=UTF8"}; - assertEquals("application/json; charset=UTF8", apiClient.selectHeaderContentType(contentTypes)); - - contentTypes = new String[]{"text/plain", "application/xml"}; - assertEquals("text/plain", apiClient.selectHeaderContentType(contentTypes)); - - contentTypes = new String[]{}; - assertEquals("application/json", apiClient.selectHeaderContentType(contentTypes)); - } - - @Test - public void testGetAuthentications() { - Map auths = apiClient.getAuthentications(); - - Authentication auth = auths.get("api_key"); - assertNotNull(auth); - assertTrue(auth instanceof ApiKeyAuth); - ApiKeyAuth apiKeyAuth = (ApiKeyAuth) auth; - assertEquals("header", apiKeyAuth.getLocation()); - assertEquals("api_key", apiKeyAuth.getParamName()); - - auth = auths.get("petstore_auth"); - assertTrue(auth instanceof OAuth); - assertSame(auth, apiClient.getAuthentication("petstore_auth")); - - assertNull(auths.get("unknown")); - - try { - auths.put("my_auth", new HttpBasicAuth()); - fail("the authentications returned should not be modifiable"); - } catch (UnsupportedOperationException e) { - } - } - - @Test - public void testSetUsernameAndPassword() { - HttpBasicAuth auth = null; - for (Authentication _auth : apiClient.getAuthentications().values()) { - if (_auth instanceof HttpBasicAuth) { - auth = (HttpBasicAuth) _auth; - break; - } - } - auth.setUsername(null); - auth.setPassword(null); - - apiClient.setUsername("my-username"); - apiClient.setPassword("my-password"); - assertEquals("my-username", auth.getUsername()); - assertEquals("my-password", auth.getPassword()); - - // reset values - auth.setUsername(null); - auth.setPassword(null); - } - - @Test - public void testSetApiKeyAndPrefix() { - ApiKeyAuth auth = null; - for (Authentication _auth : apiClient.getAuthentications().values()) { - if (_auth instanceof ApiKeyAuth) { - auth = (ApiKeyAuth) _auth; - break; - } - } - auth.setApiKey(null); - auth.setApiKeyPrefix(null); - - apiClient.setApiKey("my-api-key"); - apiClient.setApiKeyPrefix("Token"); - assertEquals("my-api-key", auth.getApiKey()); - assertEquals("Token", auth.getApiKeyPrefix()); - - // reset values - auth.setApiKey(null); - auth.setApiKeyPrefix(null); - } - - @Test - public void testParameterToPairWhenNameIsInvalid() throws Exception { - List pairs_a = apiClient.parameterToPair(null, new Integer(1)); - List pairs_b = apiClient.parameterToPair("", new Integer(1)); - - assertTrue(pairs_a.isEmpty()); - assertTrue(pairs_b.isEmpty()); - } - - @Test - public void testParameterToPairWhenValueIsNull() throws Exception { - List pairs = apiClient.parameterToPair("param-a", null); - - assertTrue(pairs.isEmpty()); - } - - @Test - public void testParameterToPairWhenValueIsEmptyString() throws Exception { - // single empty string - List pairs = apiClient.parameterToPair("param-a", " "); - assertEquals(1, pairs.size()); - } - - @Test - public void testParameterToPairWhenValueIsNotCollection() throws Exception { - String name = "param-a"; - Integer value = 1; - - List pairs = apiClient.parameterToPair(name, value); - - assertEquals(1, pairs.size()); - assertEquals(value, Integer.valueOf(pairs.get(0).getValue())); - } - - @Test - public void testParameterToPairWhenValueIsCollection() throws Exception { - List values = new ArrayList(); - values.add("value-a"); - values.add(123); - values.add(new Date()); - - List pairs = apiClient.parameterToPair("param-a", values); - assertEquals(0, pairs.size()); - } - - @Test - public void testParameterToPairsWhenNameIsInvalid() throws Exception { - List objects = new ArrayList(); - objects.add(new Integer(1)); - - List pairs_a = apiClient.parameterToPairs("csv", null, objects); - List pairs_b = apiClient.parameterToPairs("csv", "", objects); - - assertTrue(pairs_a.isEmpty()); - assertTrue(pairs_b.isEmpty()); - } - - @Test - public void testParameterToPairsWhenValueIsNull() throws Exception { - List pairs = apiClient.parameterToPairs("csv", "param-a", null); - - assertTrue(pairs.isEmpty()); - } - - @Test - public void testParameterToPairsWhenValueIsEmptyStrings() throws Exception { - // list of empty strings - List strs = new ArrayList(); - strs.add(" "); - strs.add(" "); - strs.add(" "); - - List concatStrings = apiClient.parameterToPairs("csv", "param-a", strs); - - assertEquals(1, concatStrings.size()); - assertFalse(concatStrings.get(0).getValue().isEmpty()); // should contain some delimiters - } - - @Test - public void testParameterToPairsWhenValueIsCollection() throws Exception { - Map collectionFormatMap = new HashMap(); - collectionFormatMap.put("csv", ","); - collectionFormatMap.put("tsv", "\t"); - collectionFormatMap.put("ssv", " "); - collectionFormatMap.put("pipes", "|"); - collectionFormatMap.put("", ","); // no format, must default to csv - collectionFormatMap.put("unknown", ","); // all other formats, must default to csv - - String name = "param-a"; - - List values = new ArrayList(); - values.add("value-a"); - values.add(123); - values.add(new Date()); - - // check for multi separately - List multiPairs = apiClient.parameterToPairs("multi", name, values); - assertEquals(values.size(), multiPairs.size()); - for (int i = 0; i < values.size(); i++) { - assertEquals(apiClient.escapeString(apiClient.parameterToString(values.get(i))), multiPairs.get(i).getValue()); - } - - // all other formats - for (String collectionFormat : collectionFormatMap.keySet()) { - List pairs = apiClient.parameterToPairs(collectionFormat, name, values); - - assertEquals(1, pairs.size()); - - String delimiter = collectionFormatMap.get(collectionFormat); - if (!delimiter.equals(",")) { - // commas are not escaped because they are reserved characters in URIs - delimiter = apiClient.escapeString(delimiter); - } - String[] pairValueSplit = pairs.get(0).getValue().split(delimiter); - - // must equal input values - assertEquals(values.size(), pairValueSplit.length); - for (int i = 0; i < values.size(); i++) { - assertEquals(apiClient.escapeString(apiClient.parameterToString(values.get(i))), pairValueSplit[i]); - } - } - } -} diff --git a/CI/samples.ci/client/petstore/java/test-manual/jersey1/auth/ApiKeyAuthTest.java b/CI/samples.ci/client/petstore/java/test-manual/jersey1/auth/ApiKeyAuthTest.java deleted file mode 100644 index 02f5da4c2215..000000000000 --- a/CI/samples.ci/client/petstore/java/test-manual/jersey1/auth/ApiKeyAuthTest.java +++ /dev/null @@ -1,71 +0,0 @@ -package org.openapitools.client.auth; - -import java.util.HashMap; -import java.util.ArrayList; -import java.util.Map; -import java.util.List; - -import org.openapitools.client.Pair; -import org.junit.*; -import static org.junit.Assert.*; - - -public class ApiKeyAuthTest { - @Test - public void testApplyToParamsInQuery() { - List queryParams = new ArrayList(); - Map headerParams = new HashMap(); - Map cookieParams = new HashMap(); - - ApiKeyAuth auth = new ApiKeyAuth("query", "api_key"); - auth.setApiKey("my-api-key"); - auth.applyToParams(queryParams, headerParams, cookieParams); - - assertEquals(1, queryParams.size()); - for (Pair queryParam : queryParams) { - assertEquals("my-api-key", queryParam.getValue()); - } - - // no changes to header or cookie parameters - assertEquals(0, headerParams.size()); - assertEquals(0, cookieParams.size()); - } - - @Test - public void testApplyToParamsInHeaderWithPrefix() { - List queryParams = new ArrayList(); - Map headerParams = new HashMap(); - Map cookieParams = new HashMap(); - - ApiKeyAuth auth = new ApiKeyAuth("header", "X-API-TOKEN"); - auth.setApiKey("my-api-token"); - auth.setApiKeyPrefix("Token"); - auth.applyToParams(queryParams, headerParams, cookieParams); - - // no changes to query or cookie parameters - assertEquals(0, queryParams.size()); - assertEquals(0, cookieParams.size()); - - assertEquals(1, headerParams.size()); - assertEquals("Token my-api-token", headerParams.get("X-API-TOKEN")); - } - - @Test - public void testApplyToParamsInCookieWithPrefix() { - List queryParams = new ArrayList(); - Map headerParams = new HashMap(); - Map cookieParams = new HashMap(); - - ApiKeyAuth auth = new ApiKeyAuth("cookie", "X-API-TOKEN"); - auth.setApiKey("my-api-token"); - auth.setApiKeyPrefix("Token"); - auth.applyToParams(queryParams, headerParams, cookieParams); - - // no changes to query or header parameters - assertEquals(0, queryParams.size()); - assertEquals(0, headerParams.size()); - - assertEquals(1, cookieParams.size()); - assertEquals("Token my-api-token", cookieParams.get("X-API-TOKEN")); - } -} diff --git a/CI/samples.ci/client/petstore/java/test-manual/jersey1/auth/HttpBasicAuthTest.java b/CI/samples.ci/client/petstore/java/test-manual/jersey1/auth/HttpBasicAuthTest.java deleted file mode 100644 index 458e73e8a7e6..000000000000 --- a/CI/samples.ci/client/petstore/java/test-manual/jersey1/auth/HttpBasicAuthTest.java +++ /dev/null @@ -1,54 +0,0 @@ -package org.openapitools.client.auth; - -import java.util.HashMap; -import java.util.ArrayList; -import java.util.Map; -import java.util.List; - -import org.openapitools.client.Pair; -import org.junit.*; -import static org.junit.Assert.*; - - -public class HttpBasicAuthTest { - HttpBasicAuth auth = null; - - @Before - public void setup() { - auth = new HttpBasicAuth(); - } - - @Test - public void testApplyToParams() { - List queryParams = new ArrayList(); - Map headerParams = new HashMap(); - Map cookieParams = new HashMap(); - - auth.setUsername("my-username"); - auth.setPassword("my-password"); - auth.applyToParams(queryParams, headerParams, cookieParams); - - // no changes to query or cookie parameters - assertEquals(0, queryParams.size()); - assertEquals(0, cookieParams.size()); - assertEquals(1, headerParams.size()); - // the string below is base64-encoded result of "my-username:my-password" with the "Basic " prefix - String expected = "Basic bXktdXNlcm5hbWU6bXktcGFzc3dvcmQ="; - assertEquals(expected, headerParams.get("Authorization")); - - // null username should be treated as empty string - auth.setUsername(null); - auth.applyToParams(queryParams, headerParams, cookieParams); - // the string below is base64-encoded result of ":my-password" with the "Basic " prefix - expected = "Basic Om15LXBhc3N3b3Jk"; - assertEquals(expected, headerParams.get("Authorization")); - - // null password should be treated as empty string - auth.setUsername("my-username"); - auth.setPassword(null); - auth.applyToParams(queryParams, headerParams, cookieParams); - // the string below is base64-encoded result of "my-username:" with the "Basic " prefix - expected = "Basic bXktdXNlcm5hbWU6"; - assertEquals(expected, headerParams.get("Authorization")); - } -} diff --git a/CI/samples.ci/client/petstore/java/test-manual/jersey1/model/EnumValueTest.java b/CI/samples.ci/client/petstore/java/test-manual/jersey1/model/EnumValueTest.java deleted file mode 100644 index 47bfe940d3c3..000000000000 --- a/CI/samples.ci/client/petstore/java/test-manual/jersey1/model/EnumValueTest.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.openapitools.client.model; - -import org.junit.Test; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.ObjectWriter; -import com.fasterxml.jackson.databind.SerializationFeature; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - -public class EnumValueTest { - - @Test - public void testEnumClass() { - assertEquals(EnumClass._ABC.toString(), "_abc"); - assertEquals(EnumClass._EFG.toString(), "-efg"); - assertEquals(EnumClass._XYZ_.toString(), "(xyz)"); - } - - @Test - public void testEnumTest() { - // test enum value - EnumTest enumTest = new EnumTest(); - enumTest.setEnumString(EnumTest.EnumStringEnum.LOWER); - enumTest.setEnumInteger(EnumTest.EnumIntegerEnum.NUMBER_1); - enumTest.setEnumNumber(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1); - - assertEquals(EnumTest.EnumStringEnum.UPPER.toString(), "UPPER"); - assertEquals(EnumTest.EnumStringEnum.UPPER.getValue(), "UPPER"); - assertEquals(EnumTest.EnumStringEnum.LOWER.toString(), "lower"); - assertEquals(EnumTest.EnumStringEnum.LOWER.getValue(), "lower"); - - assertEquals(EnumTest.EnumIntegerEnum.NUMBER_1.toString(), "1"); - assertTrue(EnumTest.EnumIntegerEnum.NUMBER_1.getValue() == 1); - assertEquals(EnumTest.EnumIntegerEnum.NUMBER_MINUS_1.toString(), "-1"); - assertTrue(EnumTest.EnumIntegerEnum.NUMBER_MINUS_1.getValue() == -1); - - assertEquals(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1.toString(), "1.1"); - assertTrue(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1.getValue() == 1.1); - assertEquals(EnumTest.EnumNumberEnum.NUMBER_MINUS_1_DOT_2.toString(), "-1.2"); - assertTrue(EnumTest.EnumNumberEnum.NUMBER_MINUS_1_DOT_2.getValue() == -1.2); - - try { - // test serialization (object => json) - ObjectMapper mapper = new ObjectMapper(); - mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); - ObjectWriter ow = mapper.writer(); - String json = ow.writeValueAsString(enumTest); - assertEquals(json, "{\"enum_string\":\"lower\",\"enum_string_required\":null,\"enum_integer\":1,\"enum_number\":1.1,\"outerEnum\":null}"); - - // test deserialization (json => object) - EnumTest fromString = mapper.readValue(json, EnumTest.class); - assertEquals(fromString.getEnumString().toString(), "lower"); - assertEquals(fromString.getEnumInteger().toString(), "1"); - assertEquals(fromString.getEnumNumber().toString(), "1.1"); - - } catch (Exception e) { - fail("Exception thrown during serialization/deserialzation of JSON: " + e.getMessage()); - } - } -} diff --git a/CI/samples.ci/client/petstore/java/test-manual/jersey2-java8/JSONComposedSchemaTest.java b/CI/samples.ci/client/petstore/java/test-manual/jersey2-java8/JSONComposedSchemaTest.java deleted file mode 100644 index 89227f3d252c..000000000000 --- a/CI/samples.ci/client/petstore/java/test-manual/jersey2-java8/JSONComposedSchemaTest.java +++ /dev/null @@ -1,68 +0,0 @@ -package org.openapitools.client; - -import org.openapitools.client.model.Mammal; -import org.openapitools.client.model.AppleReq; -import org.openapitools.client.model.BananaReq; -import org.openapitools.client.model.FruitReq; -import org.openapitools.client.model.BasquePig; -import org.openapitools.client.model.Pig; -import org.openapitools.client.model.Whale; -import org.openapitools.client.model.Zebra; -import java.lang.Exception; - -import org.junit.*; -import static org.junit.Assert.*; - - -public class JSONComposedSchemaTest { - JSON json = null; - Mammal mammal = null; - - @Before - public void setup() { - json = new JSON(); - mammal = new Mammal(); - } - - /** - * Validate a oneOf schema can be deserialized into the expected class. - * The oneOf schema does not have a discriminator. - */ - @Test - public void testOneOfSchemaWithoutDiscriminator() throws Exception { - // BananaReq and AppleReq have explicitly defined properties that are different by name. - // There is no discriminator property. - String str = "{ \"cultivar\": \"golden delicious\", \"mealy\": false }"; - FruitReq o = json.getContext(null).readValue(str, FruitReq.class); - assertTrue(o.getActualInstance() instanceof AppleReq); - } - - /** - * Validate a oneOf schema can be deserialized into the expected class. - * The oneOf schema has a discriminator. - */ - @Test - public void testOneOfSchemaWithDiscriminator() throws Exception { - // Mammal can be one of whale, pig and zebra. - // pig has sub-classes. - String str = "{ \"className\": \"whale\", \"hasBaleen\": true, \"hasTeeth\": false }"; - /* - DISABLING unit test for now until ambiguity of discriminator is resolved. - - // Note that the 'zebra' schema does not have any explicit property defined AND - // it has additionalProperties: true. Hence without a discriminator the above - // JSON payload would match both 'whale' and 'zebra'. This is because the 'hasBaleen' - // and 'hasTeeth' would be considered additional (undeclared) properties for 'zebra'. - Mammal o = json.getContext(null).readValue(str, Mammal.class); - assertTrue(o.getActualInstance() instanceof Whale); - - str = "{ \"className\": \"zebra\" }"; - o = json.getContext(null).readValue(str, Mammal.class); - assertTrue(o.getActualInstance() instanceof Zebra); - - str = "{ \"className\": \"BasquePig\" }"; - o = json.getContext(null).readValue(str, Mammal.class); - assertTrue(o.getActualInstance() instanceof BasquePig); - */ - } -} \ No newline at end of file diff --git a/CI/samples.ci/client/petstore/java/test-manual/jersey2-java8/JSONTest.java b/CI/samples.ci/client/petstore/java/test-manual/jersey2-java8/JSONTest.java deleted file mode 100644 index 7fb307a3df8d..000000000000 --- a/CI/samples.ci/client/petstore/java/test-manual/jersey2-java8/JSONTest.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.openapitools.client; - -import org.openapitools.client.model.Order; - -import java.lang.Exception; - -import java.time.OffsetDateTime; -import java.time.ZoneId; -import java.time.format.DateTimeFormatter; -import org.junit.*; -import static org.junit.Assert.*; - - -public class JSONTest { - JSON json = null; - Order order = null; - - @Before - public void setup() { - json = new JSON(); - order = new Order(); - } - - @Test - public void testDefaultDate() throws Exception { - final DateTimeFormatter dateFormat = DateTimeFormatter.ISO_OFFSET_DATE_TIME; - final String dateStr = "2015-11-07T14:11:05.267Z"; - order.setShipDate(dateFormat.parse(dateStr, OffsetDateTime::from)); - - String str = json.getContext(null).writeValueAsString(order); - Order o = json.getContext(null).readValue(str, Order.class); - assertEquals(dateStr, dateFormat.format(o.getShipDate())); - } - - @Test - public void testCustomDate() throws Exception { - final DateTimeFormatter dateFormat = DateTimeFormatter.ISO_OFFSET_DATE_TIME.withZone(ZoneId.of("Etc/GMT+2")); - final String dateStr = "2015-11-07T14:11:05-02:00"; - order.setShipDate(dateFormat.parse(dateStr, OffsetDateTime::from)); - - String str = json.getContext(null).writeValueAsString(order); - Order o = json.getContext(null).readValue(str, Order.class); - assertEquals(dateStr, dateFormat.format(o.getShipDate())); - } -} \ No newline at end of file diff --git a/CI/samples.ci/client/petstore/java/test-manual/jersey2/ApiClientTest.java b/CI/samples.ci/client/petstore/java/test-manual/jersey2/ApiClientTest.java deleted file mode 100644 index 1fcc0bca7f48..000000000000 --- a/CI/samples.ci/client/petstore/java/test-manual/jersey2/ApiClientTest.java +++ /dev/null @@ -1,249 +0,0 @@ -package org.openapitools.client; - -import org.openapitools.client.auth.*; - -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.*; - -import org.junit.*; -import static org.junit.Assert.*; - - -public class ApiClientTest { - ApiClient apiClient = null; - - @Before - public void setup() { - apiClient = new ApiClient(); - } - - @Test - public void testParseAndFormatDate() { - // default date format - String dateStr = "2015-11-07T03:49:09.356Z"; - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09.356+00:00"))); - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09.356Z"))); - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T05:49:09.356+02:00"))); - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T02:49:09.356-01:00"))); - - // custom date format: without milli-seconds, custom time zone - DateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX", Locale.ROOT); - format.setTimeZone(TimeZone.getTimeZone("GMT+10")); - apiClient.setDateFormat(format); - dateStr = "2015-11-07T13:49:09+10:00"; - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09+00:00"))); - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09Z"))); - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T00:49:09-03:00"))); - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T13:49:09+10:00"))); - } - - @Test - public void testIsJsonMime() { - assertFalse(apiClient.isJsonMime(null)); - assertFalse(apiClient.isJsonMime("")); - assertFalse(apiClient.isJsonMime("text/plain")); - assertFalse(apiClient.isJsonMime("application/xml")); - assertFalse(apiClient.isJsonMime("application/jsonp")); - assertFalse(apiClient.isJsonMime("example/json")); - assertFalse(apiClient.isJsonMime("example/foo+bar+jsonx")); - assertFalse(apiClient.isJsonMime("example/foo+bar+xjson")); - - assertTrue(apiClient.isJsonMime("application/json")); - assertTrue(apiClient.isJsonMime("application/json; charset=UTF8")); - assertTrue(apiClient.isJsonMime("APPLICATION/JSON")); - - assertTrue(apiClient.isJsonMime("application/problem+json")); - assertTrue(apiClient.isJsonMime("APPLICATION/PROBLEM+JSON")); - assertTrue(apiClient.isJsonMime("application/json\t")); - assertTrue(apiClient.isJsonMime("example/foo+bar+json")); - assertTrue(apiClient.isJsonMime("example/foo+json;x;y")); - assertTrue(apiClient.isJsonMime("example/foo+json\t;")); - assertTrue(apiClient.isJsonMime("Example/fOO+JSON")); - } - - @Test - public void testSelectHeaderAccept() { - String[] accepts = {"application/json", "application/xml"}; - assertEquals("application/json", apiClient.selectHeaderAccept(accepts)); - - accepts = new String[]{"APPLICATION/XML", "APPLICATION/JSON"}; - assertEquals("APPLICATION/JSON", apiClient.selectHeaderAccept(accepts)); - - accepts = new String[]{"application/xml", "application/json; charset=UTF8"}; - assertEquals("application/json; charset=UTF8", apiClient.selectHeaderAccept(accepts)); - - accepts = new String[]{"text/plain", "application/xml"}; - assertEquals("text/plain,application/xml", apiClient.selectHeaderAccept(accepts)); - - accepts = new String[]{}; - assertNull(apiClient.selectHeaderAccept(accepts)); - } - - @Test - public void testSelectHeaderContentType() { - String[] contentTypes = {"application/json", "application/xml"}; - assertEquals("application/json", apiClient.selectHeaderContentType(contentTypes)); - - contentTypes = new String[]{"APPLICATION/JSON", "APPLICATION/XML"}; - assertEquals("APPLICATION/JSON", apiClient.selectHeaderContentType(contentTypes)); - - contentTypes = new String[]{"application/xml", "application/json; charset=UTF8"}; - assertEquals("application/json; charset=UTF8", apiClient.selectHeaderContentType(contentTypes)); - - contentTypes = new String[]{"text/plain", "application/xml"}; - assertEquals("text/plain", apiClient.selectHeaderContentType(contentTypes)); - - contentTypes = new String[]{}; - assertEquals("application/json", apiClient.selectHeaderContentType(contentTypes)); - } - - @Test - public void testGetAuthentications() { - Map auths = apiClient.getAuthentications(); - - Authentication auth = auths.get("api_key"); - assertNotNull(auth); - assertTrue(auth instanceof ApiKeyAuth); - ApiKeyAuth apiKeyAuth = (ApiKeyAuth) auth; - assertEquals("header", apiKeyAuth.getLocation()); - assertEquals("api_key", apiKeyAuth.getParamName()); - - auth = auths.get("petstore_auth"); - assertTrue(auth instanceof OAuth); - assertSame(auth, apiClient.getAuthentication("petstore_auth")); - - assertNull(auths.get("unknown")); - - try { - auths.put("my_auth", new HttpBasicAuth()); - fail("the authentications returned should not be modifiable"); - } catch (UnsupportedOperationException e) { - } - } - - @Test - public void testSetUsernameAndPassword() { - HttpBasicAuth auth = null; - for (Authentication _auth : apiClient.getAuthentications().values()) { - if (_auth instanceof HttpBasicAuth) { - auth = (HttpBasicAuth) _auth; - break; - } - } - auth.setUsername(null); - auth.setPassword(null); - - apiClient.setUsername("my-username"); - apiClient.setPassword("my-password"); - assertEquals("my-username", auth.getUsername()); - assertEquals("my-password", auth.getPassword()); - - // reset values - auth.setUsername(null); - auth.setPassword(null); - } - - @Test - public void testSetApiKeyAndPrefix() { - ApiKeyAuth auth = null; - for (Authentication _auth : apiClient.getAuthentications().values()) { - if (_auth instanceof ApiKeyAuth) { - auth = (ApiKeyAuth) _auth; - break; - } - } - auth.setApiKey(null); - auth.setApiKeyPrefix(null); - - apiClient.setApiKey("my-api-key"); - apiClient.setApiKeyPrefix("Token"); - assertEquals("my-api-key", auth.getApiKey()); - assertEquals("Token", auth.getApiKeyPrefix()); - - // reset values - auth.setApiKey(null); - auth.setApiKeyPrefix(null); - } - - @Test - public void testParameterToPairsWhenNameIsInvalid() throws Exception { - List pairs_a = apiClient.parameterToPairs("csv", null, new Integer(1)); - List pairs_b = apiClient.parameterToPairs("csv", "", new Integer(1)); - - assertTrue(pairs_a.isEmpty()); - assertTrue(pairs_b.isEmpty()); - } - - @Test - public void testParameterToPairsWhenValueIsNull() throws Exception { - List pairs = apiClient.parameterToPairs("csv", "param-a", null); - - assertTrue(pairs.isEmpty()); - } - - @Test - public void testParameterToPairsWhenValueIsEmptyStrings() throws Exception { - - // single empty string - List pairs = apiClient.parameterToPairs("csv", "param-a", " "); - assertEquals(1, pairs.size()); - - // list of empty strings - List strs = new ArrayList(); - strs.add(" "); - strs.add(" "); - strs.add(" "); - - List concatStrings = apiClient.parameterToPairs("csv", "param-a", strs); - - assertEquals(1, concatStrings.size()); - assertFalse(concatStrings.get(0).getValue().isEmpty()); // should contain some delimiters - } - - @Test - public void testParameterToPairsWhenValueIsNotCollection() throws Exception { - String name = "param-a"; - Integer value = 1; - - List pairs = apiClient.parameterToPairs("csv", name, value); - - assertEquals(1, pairs.size()); - assertEquals(value, Integer.valueOf(pairs.get(0).getValue())); - } - - @Test - public void testParameterToPairsWhenValueIsCollection() throws Exception { - Map collectionFormatMap = new HashMap(); - collectionFormatMap.put("csv", ","); - collectionFormatMap.put("tsv", "\t"); - collectionFormatMap.put("ssv", " "); - collectionFormatMap.put("pipes", "\\|"); - collectionFormatMap.put("", ","); // no format, must default to csv - collectionFormatMap.put("unknown", ","); // all other formats, must default to csv - - String name = "param-a"; - - List values = new ArrayList(); - values.add("value-a"); - values.add(123); - values.add(new Date()); - - // check for multi separately - List multiPairs = apiClient.parameterToPairs("multi", name, values); - assertEquals(values.size(), multiPairs.size()); - - // all other formats - for (String collectionFormat : collectionFormatMap.keySet()) { - List pairs = apiClient.parameterToPairs(collectionFormat, name, values); - - assertEquals(1, pairs.size()); - - String delimiter = collectionFormatMap.get(collectionFormat); - String[] pairValueSplit = pairs.get(0).getValue().split(delimiter); - - // must equal input values - assertEquals(values.size(), pairValueSplit.length); - } - } -} diff --git a/CI/samples.ci/client/petstore/java/test-manual/jersey2/JSONTest.java b/CI/samples.ci/client/petstore/java/test-manual/jersey2/JSONTest.java deleted file mode 100644 index f21b852065c3..000000000000 --- a/CI/samples.ci/client/petstore/java/test-manual/jersey2/JSONTest.java +++ /dev/null @@ -1,58 +0,0 @@ -package org.openapitools.client; - -import org.openapitools.client.model.Order; -import org.junit.Before; -import org.junit.Test; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.ZoneId; -import org.threeten.bp.format.DateTimeFormatter; - -import static org.junit.Assert.*; - - -public class JSONTest { - private JSON json = null; - private Order order = null; - - @Before - public void setup() { - json = new ApiClient().getJSON(); - order = new Order(); - } - - @Test - public void testDefaultDate() throws Exception { - final DateTimeFormatter dateFormat = DateTimeFormatter.ISO_OFFSET_DATE_TIME; - final String dateStr = "2015-11-07T14:11:05.267Z"; - order.setShipDate(dateFormat.parse(dateStr, OffsetDateTime.FROM)); - - String str = json.getContext(null).writeValueAsString(order); - Order o = json.getContext(null).readValue(str, Order.class); - assertEquals(dateStr, dateFormat.format(o.getShipDate())); - } - - @Test - public void testCustomDate() throws Exception { - final DateTimeFormatter dateFormat = DateTimeFormatter.ISO_OFFSET_DATE_TIME.withZone(ZoneId.of("Etc/GMT+2")); - final String dateStr = "2015-11-07T14:11:05-02:00"; - order.setShipDate(dateFormat.parse(dateStr, OffsetDateTime.FROM)); - - String str = json.getContext(null).writeValueAsString(order); - Order o = json.getContext(null).readValue(str, Order.class); - assertEquals(dateStr, dateFormat.format(o.getShipDate())); - } - - @Test - public void testSqlDateSerialization() throws Exception { - String str = json.getContext(null).writeValueAsString(new java.sql.Date(10)); - assertEquals("\"1970-01-01\"", str); - } - - @Test - public void testSqlDateDeserialization() throws Exception { - final String str = "1970-01-01"; - java.sql.Date date = json.getContext(null).readValue("\"" + str + "\"", java.sql.Date.class); - assertEquals(date.toString(), str); - } - -} \ No newline at end of file diff --git a/CI/samples.ci/client/petstore/java/test-manual/jersey2/auth/ApiKeyAuthTest.java b/CI/samples.ci/client/petstore/java/test-manual/jersey2/auth/ApiKeyAuthTest.java deleted file mode 100644 index 3e3351520928..000000000000 --- a/CI/samples.ci/client/petstore/java/test-manual/jersey2/auth/ApiKeyAuthTest.java +++ /dev/null @@ -1,70 +0,0 @@ -package org.openapitools.client.auth; - -import java.util.HashMap; -import java.util.ArrayList; -import java.util.Map; -import java.util.List; - -import org.openapitools.client.ApiException; -import org.openapitools.client.Pair; -import org.junit.*; -import static org.junit.Assert.*; - - -public class ApiKeyAuthTest { - @Test - public void testApplyToParamsInQuery() throws ApiException { - List queryParams = new ArrayList(); - Map headerParams = new HashMap(); - Map cookieParams = new HashMap(); - - ApiKeyAuth auth = new ApiKeyAuth("query", "api_key"); - auth.setApiKey("my-api-key"); - auth.applyToParams(queryParams, headerParams, cookieParams, null, null, null); - - assertEquals(1, queryParams.size()); - for (Pair queryParam : queryParams) { - assertEquals("my-api-key", queryParam.getValue()); - } - - // no changes to header or cookie parameters - assertEquals(0, headerParams.size()); - assertEquals(0, cookieParams.size()); - } - - @Test - public void testApplyToParamsInHeaderWithPrefix() throws ApiException { - List queryParams = new ArrayList(); - Map headerParams = new HashMap(); - Map cookieParams = new HashMap(); - - ApiKeyAuth auth = new ApiKeyAuth("header", "X-API-TOKEN"); - auth.setApiKey("my-api-token"); - auth.setApiKeyPrefix("Token"); - auth.applyToParams(queryParams, headerParams, cookieParams, null, null, null); - - // no changes to query parameters - assertEquals(0, queryParams.size()); - assertEquals(0, cookieParams.size()); - assertEquals(1, headerParams.size()); - assertEquals("Token my-api-token", headerParams.get("X-API-TOKEN")); - } - - @Test - public void testApplyToParamsInCookieWithPrefix() throws ApiException { - List queryParams = new ArrayList(); - Map headerParams = new HashMap(); - Map cookieParams = new HashMap(); - - ApiKeyAuth auth = new ApiKeyAuth("cookie", "X-API-TOKEN"); - auth.setApiKey("my-api-token"); - auth.setApiKeyPrefix("Token"); - auth.applyToParams(queryParams, headerParams, cookieParams, null, null, null); - - // no changes to query or header parameters - assertEquals(0, queryParams.size()); - assertEquals(0, headerParams.size()); - assertEquals(1, cookieParams.size()); - assertEquals("Token my-api-token", cookieParams.get("X-API-TOKEN")); - } -} diff --git a/CI/samples.ci/client/petstore/java/test-manual/jersey2/auth/HttpBasicAuthTest.java b/CI/samples.ci/client/petstore/java/test-manual/jersey2/auth/HttpBasicAuthTest.java deleted file mode 100644 index 88b2105e24f2..000000000000 --- a/CI/samples.ci/client/petstore/java/test-manual/jersey2/auth/HttpBasicAuthTest.java +++ /dev/null @@ -1,54 +0,0 @@ -package org.openapitools.client.auth; - -import java.util.HashMap; -import java.util.ArrayList; -import java.util.Map; -import java.util.List; - -import org.openapitools.client.ApiException; -import org.openapitools.client.Pair; -import org.junit.*; -import static org.junit.Assert.*; - - -public class HttpBasicAuthTest { - HttpBasicAuth auth = null; - - @Before - public void setup() { - auth = new HttpBasicAuth(); - } - - @Test - public void testApplyToParams() throws ApiException { - List queryParams = new ArrayList(); - Map headerParams = new HashMap(); - Map cookieParams = new HashMap(); - - auth.setUsername("my-username"); - auth.setPassword("my-password"); - auth.applyToParams(queryParams, headerParams, cookieParams, null, null, null); - - // no changes to query parameters - assertEquals(0, queryParams.size()); - assertEquals(1, headerParams.size()); - // the string below is base64-encoded result of "my-username:my-password" with the "Basic " prefix - String expected = "Basic bXktdXNlcm5hbWU6bXktcGFzc3dvcmQ="; - assertEquals(expected, headerParams.get("Authorization")); - - // null username should be treated as empty string - auth.setUsername(null); - auth.applyToParams(queryParams, headerParams, cookieParams, null, null, null); - // the string below is base64-encoded result of ":my-password" with the "Basic " prefix - expected = "Basic Om15LXBhc3N3b3Jk"; - assertEquals(expected, headerParams.get("Authorization")); - - // null password should be treated as empty string - auth.setUsername("my-username"); - auth.setPassword(null); - auth.applyToParams(queryParams, headerParams, cookieParams, null, null, null); - // the string below is base64-encoded result of "my-username:" with the "Basic " prefix - expected = "Basic bXktdXNlcm5hbWU6"; - assertEquals(expected, headerParams.get("Authorization")); - } -} diff --git a/CI/samples.ci/client/petstore/java/test-manual/jersey2/model/EnumValueTest.java b/CI/samples.ci/client/petstore/java/test-manual/jersey2/model/EnumValueTest.java deleted file mode 100644 index 47bfe940d3c3..000000000000 --- a/CI/samples.ci/client/petstore/java/test-manual/jersey2/model/EnumValueTest.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.openapitools.client.model; - -import org.junit.Test; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.ObjectWriter; -import com.fasterxml.jackson.databind.SerializationFeature; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - -public class EnumValueTest { - - @Test - public void testEnumClass() { - assertEquals(EnumClass._ABC.toString(), "_abc"); - assertEquals(EnumClass._EFG.toString(), "-efg"); - assertEquals(EnumClass._XYZ_.toString(), "(xyz)"); - } - - @Test - public void testEnumTest() { - // test enum value - EnumTest enumTest = new EnumTest(); - enumTest.setEnumString(EnumTest.EnumStringEnum.LOWER); - enumTest.setEnumInteger(EnumTest.EnumIntegerEnum.NUMBER_1); - enumTest.setEnumNumber(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1); - - assertEquals(EnumTest.EnumStringEnum.UPPER.toString(), "UPPER"); - assertEquals(EnumTest.EnumStringEnum.UPPER.getValue(), "UPPER"); - assertEquals(EnumTest.EnumStringEnum.LOWER.toString(), "lower"); - assertEquals(EnumTest.EnumStringEnum.LOWER.getValue(), "lower"); - - assertEquals(EnumTest.EnumIntegerEnum.NUMBER_1.toString(), "1"); - assertTrue(EnumTest.EnumIntegerEnum.NUMBER_1.getValue() == 1); - assertEquals(EnumTest.EnumIntegerEnum.NUMBER_MINUS_1.toString(), "-1"); - assertTrue(EnumTest.EnumIntegerEnum.NUMBER_MINUS_1.getValue() == -1); - - assertEquals(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1.toString(), "1.1"); - assertTrue(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1.getValue() == 1.1); - assertEquals(EnumTest.EnumNumberEnum.NUMBER_MINUS_1_DOT_2.toString(), "-1.2"); - assertTrue(EnumTest.EnumNumberEnum.NUMBER_MINUS_1_DOT_2.getValue() == -1.2); - - try { - // test serialization (object => json) - ObjectMapper mapper = new ObjectMapper(); - mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); - ObjectWriter ow = mapper.writer(); - String json = ow.writeValueAsString(enumTest); - assertEquals(json, "{\"enum_string\":\"lower\",\"enum_string_required\":null,\"enum_integer\":1,\"enum_number\":1.1,\"outerEnum\":null}"); - - // test deserialization (json => object) - EnumTest fromString = mapper.readValue(json, EnumTest.class); - assertEquals(fromString.getEnumString().toString(), "lower"); - assertEquals(fromString.getEnumInteger().toString(), "1"); - assertEquals(fromString.getEnumNumber().toString(), "1.1"); - - } catch (Exception e) { - fail("Exception thrown during serialization/deserialzation of JSON: " + e.getMessage()); - } - } -} diff --git a/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/ApiClientTest.java b/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/ApiClientTest.java deleted file mode 100644 index 626901593bd2..000000000000 --- a/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/ApiClientTest.java +++ /dev/null @@ -1,347 +0,0 @@ -package org.openapitools.client; - -import okhttp3.OkHttpClient; -import org.openapitools.client.auth.*; - -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.*; -import java.util.TimeZone; - -import org.junit.*; -import static org.junit.Assert.*; -import static org.hamcrest.CoreMatchers.*; - - -public class ApiClientTest { - ApiClient apiClient; - JSON json; - - @Before - public void setup() { - apiClient = new ApiClient(); - json = apiClient.getJSON(); - } - - @Test - public void testIsJsonMime() { - assertFalse(apiClient.isJsonMime(null)); - assertFalse(apiClient.isJsonMime("")); - assertFalse(apiClient.isJsonMime("text/plain")); - assertFalse(apiClient.isJsonMime("application/xml")); - assertFalse(apiClient.isJsonMime("application/jsonp")); - assertFalse(apiClient.isJsonMime("example/json")); - assertFalse(apiClient.isJsonMime("example/foo+bar+jsonx")); - assertFalse(apiClient.isJsonMime("example/foo+bar+xjson")); - - assertTrue(apiClient.isJsonMime("application/json")); - assertTrue(apiClient.isJsonMime("application/json; charset=UTF8")); - assertTrue(apiClient.isJsonMime("APPLICATION/JSON")); - - assertTrue(apiClient.isJsonMime("application/problem+json")); - assertTrue(apiClient.isJsonMime("APPLICATION/PROBLEM+JSON")); - assertTrue(apiClient.isJsonMime("application/json\t")); - assertTrue(apiClient.isJsonMime("example/foo+bar+json")); - assertTrue(apiClient.isJsonMime("example/foo+json;x;y")); - assertTrue(apiClient.isJsonMime("example/foo+json\t;")); - assertTrue(apiClient.isJsonMime("Example/fOO+JSON")); - - assertTrue(apiClient.isJsonMime("application/json-patch+json")); - } - - @Test - public void testSelectHeaderAccept() { - String[] accepts = {"application/json", "application/xml"}; - assertEquals("application/json", apiClient.selectHeaderAccept(accepts)); - - accepts = new String[]{"APPLICATION/XML", "APPLICATION/JSON"}; - assertEquals("APPLICATION/JSON", apiClient.selectHeaderAccept(accepts)); - - accepts = new String[]{"application/xml", "application/json; charset=UTF8"}; - assertEquals("application/json; charset=UTF8", apiClient.selectHeaderAccept(accepts)); - - accepts = new String[]{"text/plain", "application/xml"}; - assertEquals("text/plain,application/xml", apiClient.selectHeaderAccept(accepts)); - - accepts = new String[]{}; - assertNull(apiClient.selectHeaderAccept(accepts)); - } - - @Test - public void testSelectHeaderContentType() { - String[] contentTypes = {"application/json", "application/xml"}; - assertEquals("application/json", apiClient.selectHeaderContentType(contentTypes)); - - contentTypes = new String[]{"APPLICATION/JSON", "APPLICATION/XML"}; - assertEquals("APPLICATION/JSON", apiClient.selectHeaderContentType(contentTypes)); - - contentTypes = new String[]{"application/xml", "application/json; charset=UTF8"}; - assertEquals("application/json; charset=UTF8", apiClient.selectHeaderContentType(contentTypes)); - - contentTypes = new String[]{"text/plain", "application/xml"}; - assertEquals("text/plain", apiClient.selectHeaderContentType(contentTypes)); - - contentTypes = new String[]{}; - assertEquals("application/json", apiClient.selectHeaderContentType(contentTypes)); - } - - @Test - public void testGetAuthentications() { - Map auths = apiClient.getAuthentications(); - - Authentication auth = auths.get("api_key"); - assertNotNull(auth); - assertTrue(auth instanceof ApiKeyAuth); - ApiKeyAuth apiKeyAuth = (ApiKeyAuth) auth; - assertEquals("header", apiKeyAuth.getLocation()); - assertEquals("api_key", apiKeyAuth.getParamName()); - - auth = auths.get("petstore_auth"); - assertTrue(auth instanceof OAuth); - assertSame(auth, apiClient.getAuthentication("petstore_auth")); - - assertNull(auths.get("unknown")); - - try { - auths.put("my_auth", new HttpBasicAuth()); - fail("the authentications returned should not be modifiable"); - } catch (UnsupportedOperationException e) { - } - } - - /* - @Test - public void testSetUsernameAndPassword() { - HttpBasicAuth auth = null; - for (Authentication _auth : apiClient.getAuthentications().values()) { - if (_auth instanceof HttpBasicAuth) { - auth = (HttpBasicAuth) _auth; - break; - } - } - auth.setUsername(null); - auth.setPassword(null); - - apiClient.setUsername("my-username"); - apiClient.setPassword("my-password"); - assertEquals("my-username", auth.getUsername()); - assertEquals("my-password", auth.getPassword()); - - // reset values - auth.setUsername(null); - auth.setPassword(null); - } - */ - - @Test - public void testSetApiKeyAndPrefix() { - ApiKeyAuth auth = null; - for (Authentication _auth : apiClient.getAuthentications().values()) { - if (_auth instanceof ApiKeyAuth) { - auth = (ApiKeyAuth) _auth; - break; - } - } - auth.setApiKey(null); - auth.setApiKeyPrefix(null); - - apiClient.setApiKey("my-api-key"); - apiClient.setApiKeyPrefix("Token"); - assertEquals("my-api-key", auth.getApiKey()); - assertEquals("Token", auth.getApiKeyPrefix()); - - // reset values - auth.setApiKey(null); - auth.setApiKeyPrefix(null); - } - - @Test - public void testGetAndSetConnectTimeout() { - // connect timeout defaults to 10 seconds - assertEquals(10000, apiClient.getConnectTimeout()); - assertEquals(10000, apiClient.getHttpClient().connectTimeoutMillis()); - - apiClient.setConnectTimeout(0); - assertEquals(0, apiClient.getConnectTimeout()); - assertEquals(0, apiClient.getHttpClient().connectTimeoutMillis()); - - apiClient.setConnectTimeout(10000); - } - - @Test - public void testGetAndSetReadTimeout() { - // read timeout defaults to 10 seconds - assertEquals(10000, apiClient.getReadTimeout()); - assertEquals(10000, apiClient.getHttpClient().readTimeoutMillis()); - - apiClient.setReadTimeout(0); - assertEquals(0, apiClient.getReadTimeout()); - assertEquals(0, apiClient.getHttpClient().readTimeoutMillis()); - - apiClient.setReadTimeout(10000); - } - - @Test - public void testGetAndSetWriteTimeout() { - // write timeout defaults to 10 seconds - assertEquals(10000, apiClient.getWriteTimeout()); - assertEquals(10000, apiClient.getHttpClient().writeTimeoutMillis()); - - apiClient.setWriteTimeout(0); - assertEquals(0, apiClient.getWriteTimeout()); - assertEquals(0, apiClient.getHttpClient().writeTimeoutMillis()); - - apiClient.setWriteTimeout(10000); - } - - @Test - public void testParameterToPairWhenNameIsInvalid() throws Exception { - List pairs_a = apiClient.parameterToPair(null, new Integer(1)); - List pairs_b = apiClient.parameterToPair("", new Integer(1)); - - assertTrue(pairs_a.isEmpty()); - assertTrue(pairs_b.isEmpty()); - } - - @Test - public void testParameterToPairWhenValueIsNull() throws Exception { - List pairs = apiClient.parameterToPair("param-a", null); - - assertTrue(pairs.isEmpty()); - } - - @Test - public void testParameterToPairWhenValueIsEmptyString() throws Exception { - // single empty string - List pairs = apiClient.parameterToPair("param-a", " "); - assertEquals(1, pairs.size()); - } - - @Test - public void testParameterToPairWhenValueIsNotCollection() throws Exception { - String name = "param-a"; - Integer value = 1; - - List pairs = apiClient.parameterToPair(name, value); - - assertEquals(1, pairs.size()); - assertEquals(value, Integer.valueOf(pairs.get(0).getValue())); - } - - @Test - public void testParameterToPairWhenValueIsCollection() throws Exception { - List values = new ArrayList(); - values.add("value-a"); - values.add(123); - values.add(new Date()); - - List pairs = apiClient.parameterToPair("param-a", values); - assertEquals(0, pairs.size()); - } - - @Test - public void testParameterToPairsWhenNameIsInvalid() throws Exception { - List objects = new ArrayList(); - objects.add(new Integer(1)); - - List pairs_a = apiClient.parameterToPairs("csv", null, objects); - List pairs_b = apiClient.parameterToPairs("csv", "", objects); - - assertTrue(pairs_a.isEmpty()); - assertTrue(pairs_b.isEmpty()); - } - - @Test - public void testParameterToPairsWhenValueIsNull() throws Exception { - List pairs = apiClient.parameterToPairs("csv", "param-a", null); - - assertTrue(pairs.isEmpty()); - } - - @Test - public void testParameterToPairsWhenValueIsEmptyStrings() throws Exception { - // list of empty strings - List strs = new ArrayList(); - strs.add(" "); - strs.add(" "); - strs.add(" "); - - List concatStrings = apiClient.parameterToPairs("csv", "param-a", strs); - - assertEquals(1, concatStrings.size()); - assertFalse(concatStrings.get(0).getValue().isEmpty()); // should contain some delimiters - } - - @Test - public void testParameterToPairsWhenValueIsCollection() throws Exception { - Map collectionFormatMap = new HashMap(); - collectionFormatMap.put("csv", ","); - collectionFormatMap.put("tsv", "\t"); - collectionFormatMap.put("ssv", " "); - collectionFormatMap.put("pipes", "|"); - collectionFormatMap.put("", ","); // no format, must default to csv - collectionFormatMap.put("unknown", ","); // all other formats, must default to csv - - String name = "param-a"; - - List values = new ArrayList(); - values.add("value-a"); - values.add(123); - values.add(new Date()); - - // check for multi separately - List multiPairs = apiClient.parameterToPairs("multi", name, values); - assertEquals(values.size(), multiPairs.size()); - for (int i = 0; i < values.size(); i++) { - assertEquals(apiClient.escapeString(apiClient.parameterToString(values.get(i))), multiPairs.get(i).getValue()); - } - - // all other formats - for (String collectionFormat : collectionFormatMap.keySet()) { - List pairs = apiClient.parameterToPairs(collectionFormat, name, values); - - assertEquals(1, pairs.size()); - - String delimiter = collectionFormatMap.get(collectionFormat); - if (!delimiter.equals(",")) { - // commas are not escaped because they are reserved characters in URIs - delimiter = apiClient.escapeString(delimiter); - } - String[] pairValueSplit = pairs.get(0).getValue().split(delimiter); - - // must equal input values - assertEquals(values.size(), pairValueSplit.length); - for (int i = 0; i < values.size(); i++) { - assertEquals(apiClient.escapeString(apiClient.parameterToString(values.get(i))), pairValueSplit[i]); - } - } - } - - @Test - public void testSanitizeFilename() { - assertEquals("sun", apiClient.sanitizeFilename("sun")); - assertEquals("sun.gif", apiClient.sanitizeFilename("sun.gif")); - assertEquals("sun.gif", apiClient.sanitizeFilename("../sun.gif")); - assertEquals("sun.gif", apiClient.sanitizeFilename("/var/tmp/sun.gif")); - assertEquals("sun.gif", apiClient.sanitizeFilename("./sun.gif")); - assertEquals("sun.gif", apiClient.sanitizeFilename("..\\sun.gif")); - assertEquals("sun.gif", apiClient.sanitizeFilename("\\var\\tmp\\sun.gif")); - assertEquals("sun.gif", apiClient.sanitizeFilename("c:\\var\\tmp\\sun.gif")); - assertEquals("sun.gif", apiClient.sanitizeFilename(".\\sun.gif")); - } - - @Test - public void testNewHttpClient() { - OkHttpClient oldClient = apiClient.getHttpClient(); - apiClient.setHttpClient(oldClient.newBuilder().build()); - assertThat(apiClient.getHttpClient(), is(not(oldClient))); - } - - /** - * Tests the invariant that the HttpClient for the ApiClient must never be null - */ - @Test(expected = NullPointerException.class) - public void testNullHttpClient() { - apiClient.setHttpClient(null); - } -} diff --git a/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/JSONTest.java b/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/JSONTest.java deleted file mode 100644 index 1c825e392562..000000000000 --- a/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/JSONTest.java +++ /dev/null @@ -1,202 +0,0 @@ -package org.openapitools.client; - -import com.google.gson.reflect.TypeToken; - -import org.openapitools.client.model.Order; - -import java.lang.Exception; -import java.lang.reflect.Type; -import java.nio.charset.StandardCharsets; -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.Date; -import java.util.GregorianCalendar; -import java.util.Locale; -import java.util.TimeZone; - -import okio.ByteString; -import org.junit.*; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.ZoneId; -import org.threeten.bp.ZoneOffset; -import org.threeten.bp.format.DateTimeFormatter; - -import static org.junit.Assert.*; - -public class JSONTest { - private ApiClient apiClient = null; - private JSON json = null; - private Order order = null; - - @Before - public void setup() { - apiClient = new ApiClient(); - json = apiClient.getJSON(); - order = new Order(); - } - - @Test - public void testSqlDateTypeAdapter() { - final String str = "\"2015-11-07\""; - final java.sql.Date date = java.sql.Date.valueOf("2015-11-07"); - - assertEquals(str, json.serialize(date)); - assertEquals(json.deserialize(str, java.sql.Date.class), date); - assertEquals(json.deserialize("\"2015-11-07T03:49:09.356" + getCurrentTimezoneOffset() + "\"", java.sql.Date.class).toString(), date.toString()); - - // custom date format: without day - DateFormat format = new SimpleDateFormat("yyyy-MM", Locale.ROOT); - apiClient.setSqlDateFormat(format); - String dateStr = "\"2015-11\""; - assertEquals(dateStr, json.serialize(json.deserialize("\"2015-11-07T03:49:09Z\"", java.sql.Date.class))); - assertEquals(dateStr, json.serialize(json.deserialize("\"2015-11\"", java.sql.Date.class))); - } - - @Test - public void testDateTypeAdapter() { - Calendar cal = new GregorianCalendar(2015, 10, 7, 3, 49, 9); - cal.setTimeZone(TimeZone.getTimeZone("UTC")); - - assertEquals(json.deserialize("\"2015-11-07T05:49:09+02\"", Date.class), cal.getTime()); - - cal.set(Calendar.MILLISECOND, 300); - assertEquals(json.deserialize("\"2015-11-07T03:49:09.3Z\"", Date.class), cal.getTime()); - - cal.set(Calendar.MILLISECOND, 356); - Date date = cal.getTime(); - - final String utcDate = "\"2015-11-07T03:49:09.356Z\""; - assertEquals(json.deserialize(utcDate, Date.class), date); - assertEquals(json.deserialize("\"2015-11-07T03:49:09.356+00:00\"", Date.class), date); - assertEquals(json.deserialize("\"2015-11-07T05:49:09.356+02:00\"", Date.class), date); - assertEquals(json.deserialize("\"2015-11-07T02:49:09.356-01:00\"", Date.class), date); - assertEquals(json.deserialize("\"2015-11-07T03:49:09.356Z\"", Date.class), date); - assertEquals(json.deserialize("\"2015-11-07T03:49:09.356+00\"", Date.class), date); - assertEquals(json.deserialize("\"2015-11-07T02:49:09.356-0100\"", Date.class), date); - assertEquals(json.deserialize("\"2015-11-07T03:49:09.356456789Z\"", Date.class), date); - - assertEquals(utcDate, json.serialize(date)); - - // custom datetime format: without milli-seconds, custom time zone - DateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX", Locale.ROOT); - format.setTimeZone(TimeZone.getTimeZone("GMT+10")); - apiClient.setDateFormat(format); - - String dateStr = "\"2015-11-07T13:49:09+10:00\""; - assertEquals(dateStr, json.serialize(json.deserialize("\"2015-11-07T03:49:09+00:00\"", Date.class))); - assertEquals(dateStr, json.serialize(json.deserialize("\"2015-11-07T03:49:09Z\"", Date.class))); - assertEquals(dateStr, json.serialize(json.deserialize("\"2015-11-07T00:49:09-03:00\"", Date.class))); - - try { - // invalid time zone format - json.deserialize("\"2015-11-07T03:49:09+00\"", Date.class); - fail("json parsing should fail"); - } catch (RuntimeException e) { - // OK - } - try { - // unexpected miliseconds - json.deserialize("\"2015-11-07T03:49:09.000Z\"", Date.class); - fail("json parsing should fail"); - } catch (RuntimeException e) { - // OK - } - - } - - @Test - public void testOffsetDateTimeTypeAdapter() { - final String str = "\"2016-09-09T08:02:03.123-03:00\""; - OffsetDateTime date = OffsetDateTime.of(2016, 9, 9, 8, 2, 3, 123000000, ZoneOffset.of("-3")); - - assertEquals(str, json.serialize(date)); - //Use toString() instead of isEqual to verify that the offset is preserved - assertEquals(json.deserialize(str, OffsetDateTime.class).toString(), date.toString()); - } - - @Test - public void testLocalDateTypeAdapter() { - final String str = "\"2016-09-09\""; - final LocalDate date = LocalDate.of(2016, 9, 9); - - assertEquals(str, json.serialize(date)); - assertEquals(json.deserialize(str, LocalDate.class), date); - } - - - @Test - public void testDefaultDate() throws Exception { - final DateTimeFormatter datetimeFormat = DateTimeFormatter.ISO_OFFSET_DATE_TIME; - final String dateStr = "2015-11-07T14:11:05.267Z"; - order.setShipDate(datetimeFormat.parse(dateStr, OffsetDateTime.FROM)); - - String str = json.serialize(order); - Type type = new TypeToken() { }.getType(); - Order o = json.deserialize(str, type); - assertEquals(dateStr, datetimeFormat.format(o.getShipDate())); - } - - @Test - public void testCustomDate() throws Exception { - final DateTimeFormatter datetimeFormat = DateTimeFormatter.ISO_OFFSET_DATE_TIME.withZone(ZoneId.of("Etc/GMT+2")); - final String dateStr = "2015-11-07T14:11:05-02:00"; - order.setShipDate(datetimeFormat.parse(dateStr, OffsetDateTime.FROM)); - - String str = json.serialize(order); - Type type = new TypeToken() { }.getType(); - Order o = json.deserialize(str, type); - assertEquals(dateStr, datetimeFormat.format(o.getShipDate())); - } - - @Test - public void testByteArrayTypeAdapterSerialization() { - // Arrange - final String expectedBytesAsString = "Let's pretend this a jpg or something"; - final byte[] expectedBytes = expectedBytesAsString.getBytes(StandardCharsets.UTF_8); - - // Act - String serializedBytesWithQuotes = json.serialize(expectedBytes); - - // Assert - String serializedBytes = serializedBytesWithQuotes.substring(1, serializedBytesWithQuotes.length() - 1); - if (json.getGson().htmlSafe()) { - serializedBytes = serializedBytes.replaceAll("\\\\u003d", "="); - } - ByteString actualAsByteString = ByteString.decodeBase64(serializedBytes); - byte[] actualBytes = actualAsByteString.toByteArray(); - assertEquals(expectedBytesAsString, new String(actualBytes, StandardCharsets.UTF_8)); - } - - @Test - public void testByteArrayTypeAdapterDeserialization() { - // Arrange - final String expectedBytesAsString = "Let's pretend this a jpg or something"; - final byte[] expectedBytes = expectedBytesAsString.getBytes(StandardCharsets.UTF_8); - final ByteString expectedByteString = ByteString.of(expectedBytes); - final String serializedBytes = expectedByteString.base64(); - final String serializedBytesWithQuotes = "\"" + serializedBytes + "\""; - Type type = new TypeToken() { }.getType(); - - // Act - byte[] actualDeserializedBytes = json.deserialize(serializedBytesWithQuotes, type); - - // Assert - assertEquals(expectedBytesAsString, new String(actualDeserializedBytes, StandardCharsets.UTF_8)); - } - - // Obtained 22JAN2018 from stackoverflow answer by PuguaSoft https://stackoverflow.com/questions/11399491/java-timezone-offset - // Direct link https://stackoverflow.com/a/16680815/3166133 - public static String getCurrentTimezoneOffset() { - - TimeZone tz = TimeZone.getDefault(); - Calendar cal = GregorianCalendar.getInstance(tz, Locale.ROOT); - int offsetInMillis = tz.getOffset(cal.getTimeInMillis()); - - String offset = String.format(Locale.ROOT,"%02d:%02d", Math.abs(offsetInMillis / 3600000), Math.abs((offsetInMillis / 60000) % 60)); - offset = (offsetInMillis >= 0 ? "+" : "-") + offset; - - return offset; - } -} \ No newline at end of file diff --git a/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/api/PetApiTest.java b/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/api/PetApiTest.java deleted file mode 100644 index 9562854f24c0..000000000000 --- a/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/api/PetApiTest.java +++ /dev/null @@ -1,564 +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.api; - -import org.openapitools.client.ApiException; -import org.openapitools.client.model.Pet; -import org.openapitools.client.auth.*; -import org.openapitools.client.model.*; -import org.openapitools.client.*; - -import java.lang.reflect.Type; -import java.util.Arrays; -import java.util.ArrayList; -import java.util.concurrent.ConcurrentLinkedQueue; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.ThreadLocalRandom; -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileWriter; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import org.junit.*; - -import static org.junit.Assert.*; - -/** - * API tests for PetApi - */ -public class PetApiTest { - - private PetApi api = new PetApi(); - private static final Logger LOG = LoggerFactory.getLogger(PetApiTest.class); - // In the circle.yml file, /etc/host is configured with an entry to resolve petstore.swagger.io to 127.0.0.1 - private static String basePath = "http://petstore.swagger.io:80/v2"; - - @Before - public void setup() { - // setup authentication - ApiKeyAuth apiKeyAuth = (ApiKeyAuth) api.getApiClient().getAuthentication("api_key"); - apiKeyAuth.setApiKey("special-key"); - api.getApiClient().setBasePath(basePath); - } - - @Test - public void testApiClient() { - // the default api client is used - assertEquals(Configuration.getDefaultApiClient(), api.getApiClient()); - assertNotNull(api.getApiClient()); - assertEquals(basePath, api.getApiClient().getBasePath()); - assertFalse(api.getApiClient().isDebugging()); - - ApiClient oldClient = api.getApiClient(); - - ApiClient newClient = new ApiClient(); - newClient.setVerifyingSsl(true); - newClient.setBasePath("http://example.com"); - newClient.setDebugging(true); - - // set api client via constructor - api = new PetApi(newClient); - assertNotNull(api.getApiClient()); - assertEquals("http://example.com", api.getApiClient().getBasePath()); - assertTrue(api.getApiClient().isDebugging()); - - // set api client via setter method - api.setApiClient(oldClient); - assertNotNull(api.getApiClient()); - assertEquals(basePath, api.getApiClient().getBasePath()); - assertFalse(api.getApiClient().isDebugging()); - } - - @Test - public void testCreateAndGetPet() throws Exception { - Pet pet = createPet(); - api.addPet(pet); - - Pet fetched = api.getPetById(pet.getId()); - assertPetMatches(pet, fetched); - api.deletePet(pet.getId(), null); - } - - @Test - public void testCreateAndGetPetWithHttpInfo() throws Exception { - Pet pet = createPet(); - api.addPetWithHttpInfo(pet); - - ApiResponse resp = api.getPetByIdWithHttpInfo(pet.getId()); - assertEquals(200, resp.getStatusCode()); - assertEquals("application/json", resp.getHeaders().get("Content-Type").get(0)); - Pet fetched = resp.getData(); - - assertPetMatches(pet, fetched); - api.deletePet(pet.getId(), null); - } - - @Test - public void testCreateAndGetPetAsync() throws Exception { - Pet pet = createPet(); - api.addPet(pet); - // to store returned Pet or error message/exception - final Map result = new HashMap(); - - api.getPetByIdAsync(pet.getId(), new ApiCallback() { - @Override - public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { - result.put("error", e.getMessage()); - } - - @Override - public void onSuccess(Pet pet, int statusCode, Map> responseHeaders) { - result.put("pet", pet); - } - - @Override - public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { - //empty - } - - @Override - public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { - //empty - } - }); - - // wait for the asynchronous call to finish (at most 10 seconds) - final int maxTry = 10; - int tryCount = 1; - Pet fetched = null; - do { - if (tryCount > maxTry) fail("have not got result of getPetByIdAsync after 10 seconds"); - Thread.sleep(1000); - tryCount += 1; - if (result.get("error") != null) fail((String) result.get("error")); - if (result.get("pet") != null) { - fetched = (Pet) result.get("pet"); - break; - } - } while (result.isEmpty()); - assertPetMatches(pet, fetched); - api.deletePet(pet.getId(), null); - } - - @Test - public void testCreateAndGetPetAsyncInvalidID() throws Exception { - Pet pet = createPet(); - api.addPet(pet); - // to store returned Pet or error message/exception - final Map result = new HashMap(); - - // test getting a nonexistent pet - result.clear(); - api.getPetByIdAsync(-10000L, new ApiCallback() { - @Override - public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { - result.put("exception", e); - } - - @Override - public void onSuccess(Pet pet, int statusCode, Map> responseHeaders) { - result.put("pet", pet); - } - - @Override - public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { - //empty - } - - @Override - public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { - //empty - } - }); - - // wait for the asynchronous call to finish (at most 10 seconds) - final int maxTry = 10; - int tryCount = 1; - Pet fetched = null; - ApiException exception = null; - - do { - if (tryCount > maxTry) fail("have not got result of getPetByIdAsync after 10 seconds"); - Thread.sleep(1000); - tryCount += 1; - if (result.get("pet") != null) fail("expected an error"); - if (result.get("exception") != null) { - exception = (ApiException) result.get("exception"); - break; - } - } while (result.isEmpty()); - assertNotNull(exception); - assertEquals(404, exception.getCode()); - assertEquals("Not Found", exception.getMessage()); - assertEquals("application/json", exception.getResponseHeaders().get("Content-Type").get(0)); - api.deletePet(pet.getId(), null); - } - - @Test - public void testCreateAndGetMultiplePetsAsync() throws Exception { - Pet pet1 = createPet(); - Pet pet2 = createPet(); - - final CountDownLatch addLatch = new CountDownLatch(2); - final TestApiCallback addCallback1 = new TestApiCallback(addLatch); - final TestApiCallback addCallback2 = new TestApiCallback(addLatch); - - // Make 2 simultaneous calls - api.addPetAsync(pet1, addCallback1); - api.addPetAsync(pet2, addCallback2); - - // wait for both asynchronous calls to finish (at most 10 seconds) - assertTrue(addLatch.await(10, TimeUnit.SECONDS)); - - assertTrue(addCallback1.isDone()); - assertTrue(addCallback2.isDone()); - - if (!addCallback1.isSuccess()) throw addCallback1.getException(); - if (!addCallback2.isSuccess()) throw addCallback2.getException(); - - assertValidProgress(addCallback1.getUploadProgress()); - assertValidProgress(addCallback2.getUploadProgress()); - - final CountDownLatch getLatch = new CountDownLatch(3); - final TestApiCallback getCallback1 = new TestApiCallback(getLatch); - final TestApiCallback getCallback2 = new TestApiCallback(getLatch); - final TestApiCallback getCallback3 = new TestApiCallback(getLatch); - - api.getPetByIdAsync(pet1.getId(), getCallback1); - api.getPetByIdAsync(pet2.getId(), getCallback2); - // Get nonexistent pet - api.getPetByIdAsync(-10000L, getCallback3); - - // wait for all asynchronous calls to finish (at most 10 seconds) - assertTrue(getLatch.await(10, TimeUnit.SECONDS)); - - assertTrue(getCallback1.isDone()); - assertTrue(getCallback2.isDone()); - assertTrue(getCallback3.isDone()); - - if (!getCallback1.isSuccess()) throw getCallback1.getException(); - if (!getCallback2.isSuccess()) throw getCallback2.getException(); - - assertPetMatches(pet1, getCallback1.getResult()); - assertPetMatches(pet2, getCallback2.getResult()); - - assertValidProgress(getCallback1.getDownloadProgress()); - assertValidProgress(getCallback2.getDownloadProgress()); - - // Last callback should fail with ApiException - assertFalse(getCallback3.isSuccess()); - final ApiException exception = getCallback3.getException(); - assertNotNull(exception); - assertEquals(404, exception.getCode()); - api.deletePet(pet1.getId(), null); - api.deletePet(pet2.getId(), null); - } - - - @Test - public void testUpdatePet() throws Exception { - Pet pet = createPet(); - api.addPet(pet); - pet.setName("programmer"); - - api.updatePet(pet); - - Pet fetched = api.getPetById(pet.getId()); - assertPetMatches(pet, fetched); - api.deletePet(pet.getId(), null); - } - - @Test - public void testFindPetsByStatus() throws Exception { - assertEquals(basePath, api.getApiClient().getBasePath()); - Pet pet = createPet(); - api.addPet(pet); - pet.setName("programmer"); - pet.setStatus(Pet.StatusEnum.PENDING); - api.updatePet(pet); - - List pets = api.findPetsByStatus(Arrays.asList("pending")); - assertNotNull(pets); - - boolean found = false; - for (Pet fetched : pets) { - if (fetched.getId().equals(pet.getId())) { - found = true; - break; - } - } - - assertTrue(found); - - api.deletePet(pet.getId(), null); - } - - @Test - @Ignore - public void testFindPetsByTags() throws Exception { - Pet pet = createPet(); - pet.setName("monster"); - pet.setStatus(Pet.StatusEnum.AVAILABLE); - - List tags = new ArrayList(); - Tag tag1 = new Tag(); - tag1.setName("friendly"); - tags.add(tag1); - pet.setTags(tags); - - api.updatePet(pet); - - Set pets = api.findPetsByTags(new HashSet<>(Arrays.asList("friendly"))); - assertNotNull(pets); - - boolean found = false; - for (Pet fetched : pets) { - if (fetched.getId().equals(pet.getId())) { - found = true; - break; - } - } - assertTrue(found); - - api.deletePet(pet.getId(), null); - } - - @Test - public void testUpdatePetWithForm() throws Exception { - Pet pet = createPet(); - pet.setName("frank"); - api.addPet(pet); - - Pet fetched = api.getPetById(pet.getId()); - - api.updatePetWithForm(fetched.getId(), "furt", null); - Pet updated = api.getPetById(fetched.getId()); - - assertEquals(updated.getName(), "furt"); - api.deletePet(pet.getId(), null); - } - - @Test - public void testDeletePet() throws Exception { - Pet pet = createPet(); - api.addPet(pet); - - Pet fetched = api.getPetById(pet.getId()); - api.deletePet(pet.getId(), null); - - try { - fetched = api.getPetById(fetched.getId()); - fail("expected an error"); - } catch (ApiException e) { - LOG.info("Code: {}. Message: {}", e.getCode(), e.getMessage()); - assertEquals(404, e.getCode()); - } - } - - @Test - public void testUploadFile() throws Exception { - Pet pet = createPet(); - api.addPet(pet); - - File file = new File("hello.txt"); - BufferedWriter writer = new BufferedWriter(new FileWriter(file)); - writer.write("Hello world!"); - writer.close(); - - api.uploadFile(pet.getId(), "a test file", new File(file.getAbsolutePath())); - api.deletePet(pet.getId(), null); - } - - @Test - public void testEqualsAndHashCode() { - Pet pet1 = new Pet(); - Pet pet2 = new Pet(); - assertTrue(pet1.equals(pet2)); - assertTrue(pet2.equals(pet1)); - assertTrue(pet1.hashCode() == pet2.hashCode()); - assertTrue(pet1.equals(pet1)); - assertTrue(pet1.hashCode() == pet1.hashCode()); - - pet2.setName("really-happy"); - pet2.setPhotoUrls(new HashSet<>(Arrays.asList("http://foo.bar.com/1", "http://foo.bar.com/2"))); - assertFalse(pet1.equals(pet2)); - assertFalse(pet2.equals(pet1)); - assertFalse(pet1.hashCode() == (pet2.hashCode())); - assertTrue(pet2.equals(pet2)); - assertTrue(pet2.hashCode() == pet2.hashCode()); - - pet1.setName("really-happy"); - pet1.setPhotoUrls(new HashSet<>(Arrays.asList("http://foo.bar.com/1", "http://foo.bar.com/2"))); - assertTrue(pet1.equals(pet2)); - assertTrue(pet2.equals(pet1)); - assertTrue(pet1.hashCode() == pet2.hashCode()); - assertTrue(pet1.equals(pet1)); - assertTrue(pet1.hashCode() == pet1.hashCode()); - } - - - private Pet createPet() { - Pet pet = new Pet(); - pet.setId(ThreadLocalRandom.current().nextLong(Long.MAX_VALUE)); - pet.setName("gorilla"); - - Category category = new Category(); - category.setName("really-happy"); - - pet.setCategory(category); - pet.setStatus(Pet.StatusEnum.AVAILABLE); - Set photos = new HashSet<>(Arrays.asList("http://foo.bar.com/1", "http://foo.bar.com/2")); - pet.setPhotoUrls(photos); - - return pet; - } - - private String serializeJson(Object o, ApiClient apiClient) { - return apiClient.getJSON().serialize(o); - } - - private T deserializeJson(String json, Type type, ApiClient apiClient) { - return (T) apiClient.getJSON().deserialize(json, type); - } - - private void assertPetMatches(Pet expected, Pet actual) { - assertNotNull(actual); - assertEquals(expected.getId(), actual.getId()); - assertNotNull(actual.getCategory()); - assertEquals(expected.getCategory().getName(), - actual.getCategory().getName()); - } - - /** - * Assert that the given upload/download progress list satisfies the - * following constraints: - *

- * - List is not empty - * - Byte count should be nondecreasing - * - The last element, and only the last element, should have done=true - */ - private void assertValidProgress(List progressList) { - assertFalse(progressList.isEmpty()); - - Progress prev = null; - int index = 0; - for (Progress progress : progressList) { - if (prev != null) { - if (prev.done || prev.bytes > progress.bytes) { - fail("Progress list out of order at index " + index - + ": " + progressList); - } - } - prev = progress; - index += 1; - } - - if (!prev.done) { - fail("Last progress item should have done=true: " + progressList); - } - } - - private static class TestApiCallback implements ApiCallback { - - private final CountDownLatch latch; - private final ConcurrentLinkedQueue uploadProgress = - new ConcurrentLinkedQueue(); - private final ConcurrentLinkedQueue downloadProgress = - new ConcurrentLinkedQueue(); - - private boolean done; - private boolean success; - private ApiException exception; - private T result; - - public TestApiCallback(CountDownLatch latch) { - this.latch = latch; - this.done = false; - } - - @Override - public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { - exception = e; - this.done = true; - this.success = false; - latch.countDown(); - } - - @Override - public void onSuccess(T result, int statusCode, Map> responseHeaders) { - this.result = result; - this.done = true; - this.success = true; - latch.countDown(); - } - - @Override - public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { - uploadProgress.add(new Progress(bytesWritten, contentLength, done)); - } - - @Override - public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { - downloadProgress.add(new Progress(bytesRead, contentLength, done)); - } - - public boolean isDone() { - return done; - } - - public boolean isSuccess() { - return success; - } - - public ApiException getException() { - return exception; - } - - public T getResult() { - return result; - } - - public List getUploadProgress() { - return new ArrayList(uploadProgress); - } - - public List getDownloadProgress() { - return new ArrayList(downloadProgress); - } - } - - private static class Progress { - public final long bytes; - public final long contentLength; - public final boolean done; - - public Progress(long bytes, long contentLength, boolean done) { - this.bytes = bytes; - this.contentLength = contentLength; - this.done = done; - } - - @Override - public String toString() { - return ""; - } - } -} diff --git a/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/auth/ApiKeyAuthTest.java b/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/auth/ApiKeyAuthTest.java deleted file mode 100644 index da25043b27e6..000000000000 --- a/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/auth/ApiKeyAuthTest.java +++ /dev/null @@ -1,119 +0,0 @@ -package org.openapitools.client.auth; - -import java.util.HashMap; -import java.util.ArrayList; -import java.util.Map; -import java.util.List; - -import org.openapitools.client.Pair; -import org.junit.*; -import static org.junit.Assert.*; - - -public class ApiKeyAuthTest { - @Test - public void testApplyToParamsInQuery() { - List queryParams = new ArrayList(); - Map headerParams = new HashMap(); - Map cookieParams = new HashMap(); - - ApiKeyAuth auth = new ApiKeyAuth("query", "api_key"); - auth.setApiKey("my-api-key"); - auth.applyToParams(queryParams, headerParams, cookieParams); - - assertEquals(1, queryParams.size()); - for (Pair queryParam : queryParams) { - assertEquals("my-api-key", queryParam.getValue()); - } - - // no changes to header or cookie parameters - assertEquals(0, headerParams.size()); - assertEquals(0, cookieParams.size()); - } - - @Test - public void testApplyToParamsInQueryWithNullValue() { - List queryParams = new ArrayList(); - Map headerParams = new HashMap(); - Map cookieParams = new HashMap(); - - ApiKeyAuth auth = new ApiKeyAuth("query", "api_key"); - auth.setApiKey(null); - auth.applyToParams(queryParams, headerParams, cookieParams); - - // no changes to parameters - assertEquals(0, queryParams.size()); - assertEquals(0, headerParams.size()); - assertEquals(0, cookieParams.size()); - } - - @Test - public void testApplyToParamsInHeaderWithPrefix() { - List queryParams = new ArrayList(); - Map headerParams = new HashMap(); - Map cookieParams = new HashMap(); - - ApiKeyAuth auth = new ApiKeyAuth("header", "X-API-TOKEN"); - auth.setApiKey("my-api-token"); - auth.setApiKeyPrefix("Token"); - auth.applyToParams(queryParams, headerParams, cookieParams); - - // no changes to query or cookie parameters - assertEquals(0, queryParams.size()); - assertEquals(0, cookieParams.size()); - assertEquals(1, headerParams.size()); - assertEquals("Token my-api-token", headerParams.get("X-API-TOKEN")); - } - - @Test - public void testApplyToParamsInHeaderWithNullValue() { - List queryParams = new ArrayList(); - Map headerParams = new HashMap(); - Map cookieParams = new HashMap(); - - ApiKeyAuth auth = new ApiKeyAuth("header", "X-API-TOKEN"); - auth.setApiKey(null); - auth.setApiKeyPrefix("Token"); - auth.applyToParams(queryParams, headerParams, cookieParams); - - // no changes to parameters - assertEquals(0, queryParams.size()); - assertEquals(0, cookieParams.size()); - assertEquals(0, headerParams.size()); - } - - @Test - public void testApplyToParamsInCookieWithPrefix() { - List queryParams = new ArrayList(); - Map headerParams = new HashMap(); - Map cookieParams = new HashMap(); - - ApiKeyAuth auth = new ApiKeyAuth("cookie", "X-API-TOKEN"); - auth.setApiKey("my-api-token"); - auth.setApiKeyPrefix("Token"); - auth.applyToParams(queryParams, headerParams, cookieParams); - - // no changes to query or header parameters - assertEquals(0, queryParams.size()); - assertEquals(0, headerParams.size()); - assertEquals(1, cookieParams.size()); - assertEquals("Token my-api-token", cookieParams.get("X-API-TOKEN")); - } - - @Test - public void testApplyToParamsInCookieWithNullValue() { - List queryParams = new ArrayList(); - Map headerParams = new HashMap(); - Map cookieParams = new HashMap(); - - ApiKeyAuth auth = new ApiKeyAuth("cookie", "X-API-TOKEN"); - auth.setApiKey(null); - auth.setApiKeyPrefix("Token"); - auth.applyToParams(queryParams, headerParams, cookieParams); - - // no changes to parameters - assertEquals(0, queryParams.size()); - assertEquals(0, cookieParams.size()); - assertEquals(0, headerParams.size()); - } -} diff --git a/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/auth/HttpBasicAuthTest.java b/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/auth/HttpBasicAuthTest.java deleted file mode 100644 index e963ea24f7f3..000000000000 --- a/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/auth/HttpBasicAuthTest.java +++ /dev/null @@ -1,64 +0,0 @@ -package org.openapitools.client.auth; - -import java.util.HashMap; -import java.util.ArrayList; -import java.util.Map; -import java.util.List; - -import org.openapitools.client.Pair; -import org.junit.*; -import static org.junit.Assert.*; - - -public class HttpBasicAuthTest { - HttpBasicAuth auth = null; - - @Before - public void setup() { - auth = new HttpBasicAuth(); - } - - @Test - public void testApplyToParams() { - List queryParams = new ArrayList(); - Map headerParams = new HashMap(); - Map cookieParams = new HashMap(); - - auth.setUsername("my-username"); - auth.setPassword("my-password"); - auth.applyToParams(queryParams, headerParams, cookieParams); - - // no changes to query or cookie parameters - assertEquals(0, queryParams.size()); - assertEquals(0, cookieParams.size()); - assertEquals(1, headerParams.size()); - // the string below is base64-encoded result of "my-username:my-password" with the "Basic " prefix - String expected = "Basic bXktdXNlcm5hbWU6bXktcGFzc3dvcmQ="; - assertEquals(expected, headerParams.get("Authorization")); - - // null username should be treated as empty string - auth.setUsername(null); - auth.applyToParams(queryParams, headerParams, cookieParams); - // the string below is base64-encoded result of ":my-password" with the "Basic " prefix - expected = "Basic Om15LXBhc3N3b3Jk"; - assertEquals(expected, headerParams.get("Authorization")); - - // null password should be treated as empty string - auth.setUsername("my-username"); - auth.setPassword(null); - auth.applyToParams(queryParams, headerParams, cookieParams); - // the string below is base64-encoded result of "my-username:" with the "Basic " prefix - expected = "Basic bXktdXNlcm5hbWU6"; - assertEquals(expected, headerParams.get("Authorization")); - - // null username and password should be ignored - queryParams = new ArrayList(); - headerParams = new HashMap(); - auth.setUsername(null); - auth.setPassword(null); - auth.applyToParams(queryParams, headerParams, cookieParams); - // no changes to parameters - assertEquals(0, queryParams.size()); - assertEquals(0, headerParams.size()); - } -} diff --git a/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/model/ArrayOfArrayOfNumberOnlyTest.java b/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/model/ArrayOfArrayOfNumberOnlyTest.java deleted file mode 100644 index 27121aec515e..000000000000 --- a/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/model/ArrayOfArrayOfNumberOnlyTest.java +++ /dev/null @@ -1,72 +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.builder.EqualsBuilder; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - -/** - * Model tests for ArrayOfArrayOfNumberOnly - */ -public class ArrayOfArrayOfNumberOnlyTest { - private final ArrayOfArrayOfNumberOnly model = new ArrayOfArrayOfNumberOnly(); - - /** - * Model tests for ArrayOfArrayOfNumberOnly - */ - @Test - public void test() { - // TODO: test ArrayOfArrayOfNumberOnly - } - - /** - * Test the property 'arrayArrayNumber' - */ - @Test - public void arrayArrayNumberTest() { - BigDecimal b1 = new BigDecimal("12.3"); - BigDecimal b2 = new BigDecimal("5.6"); - List arrayArrayNumber = new ArrayList(); - arrayArrayNumber.add(b1); - arrayArrayNumber.add(b2); - model.setArrayArrayNumber(new ArrayList>()); - model.getArrayArrayNumber().add(arrayArrayNumber); - - // create another instance for comparison - BigDecimal b3 = new BigDecimal("12.3"); - BigDecimal b4 = new BigDecimal("5.6"); - ArrayOfArrayOfNumberOnly model2 = new ArrayOfArrayOfNumberOnly(); - List arrayArrayNumber2 = new ArrayList(); - arrayArrayNumber2.add(b1); - arrayArrayNumber2.add(b2); - model2.setArrayArrayNumber(new ArrayList>()); - model2.getArrayArrayNumber().add(arrayArrayNumber2); - - Assert.assertTrue(model2.equals(model)); - } - -} diff --git a/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/model/EnumValueTest.java b/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/model/EnumValueTest.java deleted file mode 100644 index 73440e547b25..000000000000 --- a/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/model/EnumValueTest.java +++ /dev/null @@ -1,56 +0,0 @@ -package org.openapitools.client.model; - -import org.junit.Test; - -import com.google.gson.Gson; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -public class EnumValueTest { - - @Test - public void testEnumClass() { - assertEquals(EnumClass._ABC.toString(), "_abc"); - assertEquals(EnumClass._EFG.toString(), "-efg"); - assertEquals(EnumClass._XYZ_.toString(), "(xyz)"); - } - - @Test - public void testEnumTest() { - // test enum value - EnumTest enumTest = new EnumTest(); - enumTest.setEnumString(EnumTest.EnumStringEnum.LOWER); - enumTest.setEnumInteger(EnumTest.EnumIntegerEnum.NUMBER_1); - enumTest.setEnumNumber(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1); - - assertEquals(EnumTest.EnumStringEnum.UPPER.toString(), "UPPER"); - assertEquals(EnumTest.EnumStringEnum.UPPER.getValue(), "UPPER"); - assertEquals(EnumTest.EnumStringEnum.LOWER.toString(), "lower"); - assertEquals(EnumTest.EnumStringEnum.LOWER.getValue(), "lower"); - - assertEquals(EnumTest.EnumIntegerEnum.NUMBER_1.toString(), "1"); - assertTrue(EnumTest.EnumIntegerEnum.NUMBER_1.getValue() == 1); - assertEquals(EnumTest.EnumIntegerEnum.NUMBER_MINUS_1.toString(), "-1"); - assertTrue(EnumTest.EnumIntegerEnum.NUMBER_MINUS_1.getValue() == -1); - - assertEquals(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1.toString(), "1.1"); - assertTrue(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1.getValue() == 1.1); - assertEquals(EnumTest.EnumNumberEnum.NUMBER_MINUS_1_DOT_2.toString(), "-1.2"); - assertTrue(EnumTest.EnumNumberEnum.NUMBER_MINUS_1_DOT_2.getValue() == -1.2); - - // test serialization - Gson gson = new Gson(); - String json = gson.toJson(enumTest); - assertEquals(json, "{\"enum_string\":\"lower\",\"enum_integer\":1,\"enum_number\":1.1}"); - - // test deserialization - EnumTest fromString = gson.fromJson(json, EnumTest.class); - assertEquals(fromString.getEnumString().toString(), "lower"); - assertEquals(fromString.getEnumString().getValue(), "lower"); - assertEquals(fromString.getEnumInteger().toString(), "1"); - assertTrue(fromString.getEnumInteger().getValue() == 1); - assertEquals(fromString.getEnumNumber().toString(), "1.1"); - assertTrue(fromString.getEnumNumber().getValue() == 1.1); - } -} diff --git a/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/model/PetTest.java b/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/model/PetTest.java deleted file mode 100644 index 3f4c1e8365d7..000000000000 --- a/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/model/PetTest.java +++ /dev/null @@ -1,103 +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 com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.client.model.Category; -import org.openapitools.client.model.Tag; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Model tests for Pet - */ -public class PetTest { - private final Pet model = new Pet(); - - /** - * Model tests for Pet - */ - @Test - public void testPet() { - // test Pet - model.setId(1029L); - model.setName("Dog"); - - Pet model2 = new Pet(); - model2.setId(1029L); - model2.setName("Dog"); - - Assert.assertTrue(model.equals(model2)); - } - - /** - * Test the property 'id' - */ - @Test - public void idTest() { - // TODO: test id - } - - /** - * Test the property 'category' - */ - @Test - public void categoryTest() { - // TODO: test category - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - - /** - * Test the property 'photoUrls' - */ - @Test - public void photoUrlsTest() { - // TODO: test photoUrls - } - - /** - * Test the property 'tags' - */ - @Test - public void tagsTest() { - // TODO: test tags - } - - /** - * Test the property 'status' - */ - @Test - public void statusTest() { - // TODO: test status - } - -} diff --git a/CI/samples.ci/client/petstore/java/test-manual/resttemplate/ApiClientTest.java b/CI/samples.ci/client/petstore/java/test-manual/resttemplate/ApiClientTest.java deleted file mode 100644 index 62068d754ea1..000000000000 --- a/CI/samples.ci/client/petstore/java/test-manual/resttemplate/ApiClientTest.java +++ /dev/null @@ -1,253 +0,0 @@ -package org.openapitools.client; - -import org.openapitools.client.auth.*; - -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.*; - -import org.junit.*; -import org.springframework.http.MediaType; -import org.springframework.util.MultiValueMap; - -import static org.junit.Assert.*; - - -public class ApiClientTest { - ApiClient apiClient = null; - - @Before - public void setup() { - apiClient = new ApiClient(); - } - - /** - * - */ - @Test - public void testParseAndFormatDate() { - // default date format - String dateStr = "2015-11-07T03:49:09.356Z"; - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09.356+00:00"))); - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09.356Z"))); - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T05:49:09.356+02:00"))); - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T02:49:09.356-01:00"))); - - // custom date format: without milli-seconds, custom time zone - DateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX", Locale.ROOT); - format.setTimeZone(TimeZone.getTimeZone("GMT+10")); - apiClient.setDateFormat(format); - dateStr = "2015-11-07T13:49:09+10:00"; - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09+00:00"))); - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09Z"))); - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T00:49:09-03:00"))); - assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T13:49:09+10:00"))); - } - - @Test - public void testIsJsonMime() { - assertFalse(apiClient.isJsonMime((String) null)); - assertFalse(apiClient.isJsonMime("")); - assertFalse(apiClient.isJsonMime("text/plain")); - assertFalse(apiClient.isJsonMime("application/xml")); - assertFalse(apiClient.isJsonMime("application/jsonp")); - assertFalse(apiClient.isJsonMime("example/json")); - assertFalse(apiClient.isJsonMime("example/foo+bar+jsonx")); - assertFalse(apiClient.isJsonMime("example/foo+bar+xjson")); - - assertTrue(apiClient.isJsonMime("application/json")); - assertTrue(apiClient.isJsonMime("application/json; charset=UTF8")); - assertTrue(apiClient.isJsonMime("APPLICATION/JSON")); - - assertTrue(apiClient.isJsonMime("application/problem+json")); - assertTrue(apiClient.isJsonMime("APPLICATION/PROBLEM+JSON")); - assertTrue(apiClient.isJsonMime("application/json\t")); - assertTrue(apiClient.isJsonMime("example/foo+bar+json")); - assertTrue(apiClient.isJsonMime("example/foo+json;x;y")); - assertTrue(apiClient.isJsonMime("example/foo+json\t;")); - assertTrue(apiClient.isJsonMime("Example/fOO+JSON")); - } - - @Test - public void testSelectHeaderAccept() { - String[] accepts = {"application/json", "application/xml"}; - assertEquals(Arrays.asList(MediaType.parseMediaType("application/json")), apiClient.selectHeaderAccept(accepts)); - - accepts = new String[]{"APPLICATION/XML", "APPLICATION/JSON"}; - assertEquals(Arrays.asList(MediaType.parseMediaType("APPLICATION/JSON")), apiClient.selectHeaderAccept(accepts)); - - accepts = new String[]{"application/xml", "application/json; charset=UTF8"}; - assertEquals(Arrays.asList(MediaType.parseMediaType("application/json; charset=UTF8")), apiClient.selectHeaderAccept(accepts)); - - accepts = new String[]{"text/plain", "application/xml"}; - assertEquals(Arrays.asList(MediaType.parseMediaType("text/plain"),MediaType.parseMediaType("application/xml")), apiClient.selectHeaderAccept(accepts)); - - accepts = new String[]{}; - assertNull(apiClient.selectHeaderAccept(accepts)); - } - - @Test - public void testSelectHeaderContentType() { - String[] contentTypes = {"application/json", "application/xml"}; - assertEquals(MediaType.parseMediaType("application/json"), apiClient.selectHeaderContentType(contentTypes)); - - contentTypes = new String[]{"APPLICATION/JSON", "APPLICATION/XML"}; - assertEquals(MediaType.parseMediaType("APPLICATION/JSON"), apiClient.selectHeaderContentType(contentTypes)); - - contentTypes = new String[]{"application/xml", "application/json; charset=UTF8"}; - assertEquals(MediaType.parseMediaType("application/json; charset=UTF8"), apiClient.selectHeaderContentType(contentTypes)); - - contentTypes = new String[]{"text/plain", "application/xml"}; - assertEquals(MediaType.parseMediaType("text/plain"), apiClient.selectHeaderContentType(contentTypes)); - - contentTypes = new String[]{}; - assertEquals(MediaType.parseMediaType("application/json"), apiClient.selectHeaderContentType(contentTypes)); - } - - @Test - public void testGetAuthentications() { - Map auths = apiClient.getAuthentications(); - - Authentication auth = auths.get("api_key"); - assertNotNull(auth); - assertTrue(auth instanceof ApiKeyAuth); - ApiKeyAuth apiKeyAuth = (ApiKeyAuth) auth; - assertEquals("header", apiKeyAuth.getLocation()); - assertEquals("api_key", apiKeyAuth.getParamName()); - - auth = auths.get("petstore_auth"); - assertTrue(auth instanceof OAuth); - assertSame(auth, apiClient.getAuthentication("petstore_auth")); - - assertNull(auths.get("unknown")); - - try { - auths.put("my_auth", new HttpBasicAuth()); - fail("the authentications returned should not be modifiable"); - } catch (UnsupportedOperationException e) { - } - } - - @Test - public void testSetUsernameAndPassword() { - HttpBasicAuth auth = null; - for (Authentication _auth : apiClient.getAuthentications().values()) { - if (_auth instanceof HttpBasicAuth) { - auth = (HttpBasicAuth) _auth; - break; - } - } - auth.setUsername(null); - auth.setPassword(null); - - apiClient.setUsername("my-username"); - apiClient.setPassword("my-password"); - assertEquals("my-username", auth.getUsername()); - assertEquals("my-password", auth.getPassword()); - - // reset values - auth.setUsername(null); - auth.setPassword(null); - } - - @Test - public void testSetApiKeyAndPrefix() { - ApiKeyAuth auth = null; - for (Authentication _auth : apiClient.getAuthentications().values()) { - if (_auth instanceof ApiKeyAuth) { - auth = (ApiKeyAuth) _auth; - break; - } - } - auth.setApiKey(null); - auth.setApiKeyPrefix(null); - - apiClient.setApiKey("my-api-key"); - apiClient.setApiKeyPrefix("Token"); - assertEquals("my-api-key", auth.getApiKey()); - assertEquals("Token", auth.getApiKeyPrefix()); - - // reset values - auth.setApiKey(null); - auth.setApiKeyPrefix(null); - } - - @Test - public void testParameterToMultiValueMapWhenNameIsInvalid() throws Exception { - MultiValueMap pairs_a = apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.CSV, null, new Integer(1)); - MultiValueMap pairs_b = apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.CSV, "", new Integer(1)); - - assertTrue(pairs_a.isEmpty()); - assertTrue(pairs_b.isEmpty()); - } - - @Test - public void testParameterToMultiValueMapWhenValueIsNull() throws Exception { - MultiValueMap pairs = apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.CSV, "param-a", null); - - assertTrue(pairs.isEmpty()); - } - - @Test - public void testParameterToMultiValueMapWhenValueIsEmptyStrings() throws Exception { - - // single empty string - MultiValueMap pairs = apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.CSV, "param-a", " "); - assertEquals(1, pairs.size()); - - // list of empty strings - List strs = new ArrayList(); - strs.add(" "); - strs.add(" "); - strs.add(" "); - - MultiValueMap concatStrings = apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.CSV, "param-a", strs); - - assertEquals(1, concatStrings.get("param-a").size()); - assertFalse(concatStrings.get("param-a").isEmpty()); // should contain some delimiters - } - - @Test - public void testParameterToMultiValueMapWhenValueIsNotCollection() throws Exception { - String name = "param-a"; - Integer value = 1; - - MultiValueMap pairs = apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.CSV, name, value); - - assertEquals(1, pairs.get(name).size()); - assertEquals(value, Integer.valueOf(pairs.get(name).get(0))); - } - - @Test - public void testParameterToMultiValueMapWhenValueIsCollection() throws Exception { - Map collectionFormatMap = new HashMap(); - collectionFormatMap.put(ApiClient.CollectionFormat.CSV, ","); - collectionFormatMap.put(ApiClient.CollectionFormat.TSV, "\t"); - collectionFormatMap.put(ApiClient.CollectionFormat.SSV, " "); - collectionFormatMap.put(ApiClient.CollectionFormat.PIPES, "\\|"); - collectionFormatMap.put(null, ","); // no format, must default to csv - - String name = "param-a"; - - List values = new ArrayList(); - values.add("value-a"); - values.add(123); - values.add(new Date()); - - // check for multi separately - MultiValueMap multiValueMap = apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.MULTI, name, values); - assertEquals(values.size(), multiValueMap.get(name).size()); - - // all other formats - for (ApiClient.CollectionFormat collectionFormat : collectionFormatMap.keySet()) { - MultiValueMap pairs = apiClient.parameterToMultiValueMap(collectionFormat, name, values); - - assertEquals(1, pairs.size()); - - String delimiter = collectionFormatMap.get(collectionFormat); - String[] pairValueSplit = pairs.get(name).get(0).split(delimiter); - - assertEquals(values.size(), pairValueSplit.length); - } - } -} diff --git a/CI/samples.ci/client/petstore/java/test-manual/resttemplate/auth/ApiKeyAuthTest.java b/CI/samples.ci/client/petstore/java/test-manual/resttemplate/auth/ApiKeyAuthTest.java deleted file mode 100644 index 2a21136cfe0c..000000000000 --- a/CI/samples.ci/client/petstore/java/test-manual/resttemplate/auth/ApiKeyAuthTest.java +++ /dev/null @@ -1,69 +0,0 @@ -package org.openapitools.client.auth; - -import java.util.HashMap; -import java.util.ArrayList; -import java.util.Map; -import java.util.List; - -import org.junit.*; -import org.springframework.http.HttpHeaders; -import org.springframework.util.LinkedMultiValueMap; -import org.springframework.util.MultiValueMap; - -import static org.junit.Assert.*; - -public class ApiKeyAuthTest { - @Test - public void testApplyToParamsInQuery() { - MultiValueMap queryParams = new LinkedMultiValueMap(); - HttpHeaders headerParams = new HttpHeaders(); - MultiValueMap cookieParams = new LinkedMultiValueMap(); - - ApiKeyAuth auth = new ApiKeyAuth("query", "api_key"); - auth.setApiKey("my-api-key"); - auth.applyToParams(queryParams, headerParams, cookieParams); - - assertEquals(1, queryParams.size()); - assertEquals("my-api-key", queryParams.get("api_key").get(0)); - - // no changes to header or cookie parameters - assertEquals(0, headerParams.size()); - assertEquals(0, cookieParams.size()); - } - - @Test - public void testApplyToParamsInHeaderWithPrefix() { - MultiValueMap queryParams = new LinkedMultiValueMap(); - HttpHeaders headerParams = new HttpHeaders(); - MultiValueMap cookieParams = new LinkedMultiValueMap(); - - ApiKeyAuth auth = new ApiKeyAuth("header", "X-API-TOKEN"); - auth.setApiKey("my-api-token"); - auth.setApiKeyPrefix("Token"); - auth.applyToParams(queryParams, headerParams, cookieParams); - - // no changes to query or cookie parameters - assertEquals(0, queryParams.size()); - assertEquals(0, cookieParams.size()); - assertEquals(1, headerParams.size()); - assertEquals("Token my-api-token", headerParams.get("X-API-TOKEN").get(0)); - } - - @Test - public void testApplyToParamsInCookieWithPrefix() { - MultiValueMap queryParams = new LinkedMultiValueMap(); - HttpHeaders headerParams = new HttpHeaders(); - MultiValueMap cookieParams = new LinkedMultiValueMap(); - - ApiKeyAuth auth = new ApiKeyAuth("cookie", "X-API-TOKEN"); - auth.setApiKey("my-api-token"); - auth.setApiKeyPrefix("Token"); - auth.applyToParams(queryParams, headerParams, cookieParams); - - // no changes to query or cookie parameters - assertEquals(0, queryParams.size()); - assertEquals(0, headerParams.size()); - assertEquals(1, cookieParams.size()); - assertEquals("Token my-api-token", cookieParams.get("X-API-TOKEN").get(0)); - } -} diff --git a/CI/samples.ci/client/petstore/java/test-manual/resttemplate/auth/HttpBasicAuthTest.java b/CI/samples.ci/client/petstore/java/test-manual/resttemplate/auth/HttpBasicAuthTest.java deleted file mode 100644 index 79eec957fcbc..000000000000 --- a/CI/samples.ci/client/petstore/java/test-manual/resttemplate/auth/HttpBasicAuthTest.java +++ /dev/null @@ -1,56 +0,0 @@ -package org.openapitools.client.auth; - -import java.util.HashMap; -import java.util.ArrayList; -import java.util.Map; -import java.util.List; - -import org.junit.*; -import org.springframework.http.HttpHeaders; -import org.springframework.util.LinkedMultiValueMap; -import org.springframework.util.MultiValueMap; - -import static org.junit.Assert.*; - -public class HttpBasicAuthTest { - HttpBasicAuth auth = null; - - @Before - public void setup() { - auth = new HttpBasicAuth(); - } - - @Test - public void testApplyToParams() { - MultiValueMap queryParams = new LinkedMultiValueMap(); - HttpHeaders headerParams = new HttpHeaders(); - MultiValueMap cookieParams = new LinkedMultiValueMap(); - - auth.setUsername("my-username"); - auth.setPassword("my-password"); - auth.applyToParams(queryParams, headerParams, cookieParams); - - // no changes to query or cookie parameters - assertEquals(0, queryParams.size()); - assertEquals(0, cookieParams.size()); - assertEquals(1, headerParams.size()); - // the string below is base64-encoded result of "my-username:my-password" with the "Basic " prefix - String expected = "Basic bXktdXNlcm5hbWU6bXktcGFzc3dvcmQ="; - assertEquals(expected, headerParams.get("Authorization").get(0)); - - // null username should be treated as empty string - auth.setUsername(null); - auth.applyToParams(queryParams, headerParams, cookieParams); - // the string below is base64-encoded result of ":my-password" with the "Basic " prefix - expected = "Basic Om15LXBhc3N3b3Jk"; - assertEquals(expected, headerParams.get("Authorization").get(1)); - - // null password should be treated as empty string - auth.setUsername("my-username"); - auth.setPassword(null); - auth.applyToParams(queryParams, headerParams, cookieParams); - // the string below is base64-encoded result of "my-username:" with the "Basic " prefix - expected = "Basic bXktdXNlcm5hbWU6"; - assertEquals(expected, headerParams.get("Authorization").get(2)); - } -} diff --git a/CI/samples.ci/client/petstore/java/test-manual/resttemplate/model/EnumValueTest.java b/CI/samples.ci/client/petstore/java/test-manual/resttemplate/model/EnumValueTest.java deleted file mode 100644 index 47bfe940d3c3..000000000000 --- a/CI/samples.ci/client/petstore/java/test-manual/resttemplate/model/EnumValueTest.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.openapitools.client.model; - -import org.junit.Test; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.ObjectWriter; -import com.fasterxml.jackson.databind.SerializationFeature; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - -public class EnumValueTest { - - @Test - public void testEnumClass() { - assertEquals(EnumClass._ABC.toString(), "_abc"); - assertEquals(EnumClass._EFG.toString(), "-efg"); - assertEquals(EnumClass._XYZ_.toString(), "(xyz)"); - } - - @Test - public void testEnumTest() { - // test enum value - EnumTest enumTest = new EnumTest(); - enumTest.setEnumString(EnumTest.EnumStringEnum.LOWER); - enumTest.setEnumInteger(EnumTest.EnumIntegerEnum.NUMBER_1); - enumTest.setEnumNumber(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1); - - assertEquals(EnumTest.EnumStringEnum.UPPER.toString(), "UPPER"); - assertEquals(EnumTest.EnumStringEnum.UPPER.getValue(), "UPPER"); - assertEquals(EnumTest.EnumStringEnum.LOWER.toString(), "lower"); - assertEquals(EnumTest.EnumStringEnum.LOWER.getValue(), "lower"); - - assertEquals(EnumTest.EnumIntegerEnum.NUMBER_1.toString(), "1"); - assertTrue(EnumTest.EnumIntegerEnum.NUMBER_1.getValue() == 1); - assertEquals(EnumTest.EnumIntegerEnum.NUMBER_MINUS_1.toString(), "-1"); - assertTrue(EnumTest.EnumIntegerEnum.NUMBER_MINUS_1.getValue() == -1); - - assertEquals(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1.toString(), "1.1"); - assertTrue(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1.getValue() == 1.1); - assertEquals(EnumTest.EnumNumberEnum.NUMBER_MINUS_1_DOT_2.toString(), "-1.2"); - assertTrue(EnumTest.EnumNumberEnum.NUMBER_MINUS_1_DOT_2.getValue() == -1.2); - - try { - // test serialization (object => json) - ObjectMapper mapper = new ObjectMapper(); - mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); - ObjectWriter ow = mapper.writer(); - String json = ow.writeValueAsString(enumTest); - assertEquals(json, "{\"enum_string\":\"lower\",\"enum_string_required\":null,\"enum_integer\":1,\"enum_number\":1.1,\"outerEnum\":null}"); - - // test deserialization (json => object) - EnumTest fromString = mapper.readValue(json, EnumTest.class); - assertEquals(fromString.getEnumString().toString(), "lower"); - assertEquals(fromString.getEnumInteger().toString(), "1"); - assertEquals(fromString.getEnumNumber().toString(), "1.1"); - - } catch (Exception e) { - fail("Exception thrown during serialization/deserialzation of JSON: " + e.getMessage()); - } - } -} diff --git a/CI/samples.ci/client/petstore/kotlin-string/pom.xml b/CI/samples.ci/client/petstore/kotlin-string/pom.xml deleted file mode 100644 index a8d5f88f257b..000000000000 --- a/CI/samples.ci/client/petstore/kotlin-string/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ - - 4.0.0 - org.openapitools - KotlinPetstoreStringTests - pom - 1.0-SNAPSHOT - kotlin-string - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - bundle-test - integration-test - - exec - - - gradle - - test - - - - - - - - diff --git a/CI/samples.ci/client/petstore/kotlin-threetenbp/pom.xml b/CI/samples.ci/client/petstore/kotlin-threetenbp/pom.xml deleted file mode 100644 index 7a670388889a..000000000000 --- a/CI/samples.ci/client/petstore/kotlin-threetenbp/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ - - 4.0.0 - org.openapitools - KotlinPetstoreThreetenbpTests - pom - 1.0-SNAPSHOT - kotlin-threetenbp - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - bundle-test - integration-test - - exec - - - gradle - - test - - - - - - - - diff --git a/CI/samples.ci/client/petstore/typescript-fetch/builds/default/pom.xml b/CI/samples.ci/client/petstore/typescript-fetch/builds/default/pom.xml deleted file mode 100644 index b40b83a0c751..000000000000 --- a/CI/samples.ci/client/petstore/typescript-fetch/builds/default/pom.xml +++ /dev/null @@ -1,26 +0,0 @@ - - 4.0.0 - org.openapitools - TypeScriptAngularBuildPestoreClientTests - pom - 1.0-SNAPSHOT - TS Fetch Default Petstore Client - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - - diff --git a/CI/samples.ci/client/petstore/typescript-fetch/builds/es6-target/pom.xml b/CI/samples.ci/client/petstore/typescript-fetch/builds/es6-target/pom.xml deleted file mode 100644 index db6dfdfeb6aa..000000000000 --- a/CI/samples.ci/client/petstore/typescript-fetch/builds/es6-target/pom.xml +++ /dev/null @@ -1,59 +0,0 @@ - - 4.0.0 - org.openapitools - TypeScriptAngularBuildES6PestoreClientTests - pom - 1.0-SNAPSHOT - TS Fetch ES6 Petstore Client - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - npm-install - integration-test - - exec - - - npm - - install - - - - - npm-test - integration-test - - exec - - - npm - - test - - - - - - - - diff --git a/CI/samples.ci/client/petstore/typescript-fetch/builds/multiple-parameters/pom.xml b/CI/samples.ci/client/petstore/typescript-fetch/builds/multiple-parameters/pom.xml deleted file mode 100644 index a6fc39c4f08d..000000000000 --- a/CI/samples.ci/client/petstore/typescript-fetch/builds/multiple-parameters/pom.xml +++ /dev/null @@ -1,26 +0,0 @@ - - 4.0.0 - org.openapitools - TypeScriptAngularBuildPestoreClientTests - pom - 1.0-SNAPSHOT - TS Fetch Multiple Parameters Petstore Client - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - - diff --git a/CI/samples.ci/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/pom.xml b/CI/samples.ci/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/pom.xml deleted file mode 100644 index 35c073c7dcaf..000000000000 --- a/CI/samples.ci/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/pom.xml +++ /dev/null @@ -1,73 +0,0 @@ - - 4.0.0 - org.openapitools - TypeScriptFetchBuildPrefixParameterInterfacesPestoreClientTests - pom - 1.0-SNAPSHOT - TS Fetch Petstore Client (with namespacing for parameter interfaces) - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - npm-install - integration-test - - exec - - - npm - - install - - - - - npm-build - integration-test - - exec - - - npm - - run - build - - - - - npm-test - integration-test - - exec - - - npm - - test - - - - - - - - diff --git a/CI/samples.ci/client/petstore/typescript-fetch/builds/with-npm-version/pom.xml b/CI/samples.ci/client/petstore/typescript-fetch/builds/with-npm-version/pom.xml deleted file mode 100644 index 339fe7665186..000000000000 --- a/CI/samples.ci/client/petstore/typescript-fetch/builds/with-npm-version/pom.xml +++ /dev/null @@ -1,73 +0,0 @@ - - 4.0.0 - org.openapitools - TypeScriptAngularBuildWithNPMVersionPestoreClientTests - pom - 1.0-SNAPSHOT - TS Fetch Petstore Client (with npm) - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - npm-install - integration-test - - exec - - - npm - - install - - - - - npm-build - integration-test - - exec - - - npm - - run - build - - - - - npm-test - integration-test - - exec - - - npm - - test - - - - - - - - diff --git a/CI/samples.ci/client/petstore/typescript-fetch/tests/default/pom.xml b/CI/samples.ci/client/petstore/typescript-fetch/tests/default/pom.xml deleted file mode 100644 index 92063ea7bcc5..000000000000 --- a/CI/samples.ci/client/petstore/typescript-fetch/tests/default/pom.xml +++ /dev/null @@ -1,59 +0,0 @@ - - 4.0.0 - org.openapitools - TypeScriptFetchPestoreClientTests - pom - 1.0-SNAPSHOT - TS Fetch Petstore Test Client - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - npm-install - pre-integration-test - - exec - - - npm - - install - - - - - npm-test - integration-test - - exec - - - npm - - test - - - - - - - - diff --git a/CI/samples.ci/server/petstore/java-play-framework-api-package-override/pom.xml b/CI/samples.ci/server/petstore/java-play-framework-api-package-override/pom.xml deleted file mode 100644 index 640424c4ac6f..000000000000 --- a/CI/samples.ci/server/petstore/java-play-framework-api-package-override/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ - - 4.0.0 - org.openapitools - PlayServerTests-api-package-override - pom - 1.0-SNAPSHOT - java-play-framework-api-package-override Project - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.6.0 - - - Play Test - integration-test - - exec - - - sbt - - test - - - - - - - - diff --git a/CI/samples.ci/server/petstore/java-play-framework-controller-only/pom.xml b/CI/samples.ci/server/petstore/java-play-framework-controller-only/pom.xml deleted file mode 100644 index ecc1280f2d0c..000000000000 --- a/CI/samples.ci/server/petstore/java-play-framework-controller-only/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ - - 4.0.0 - org.openapitools - PlayServerTests-controller-only - pom - 1.0-SNAPSHOT - java-play-framework-controller-only Project - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.6.0 - - - Play Test - integration-test - - exec - - - sbt - - test - - - - - - - - diff --git a/CI/samples.ci/server/petstore/java-play-framework-fake-endpoints/pom.xml b/CI/samples.ci/server/petstore/java-play-framework-fake-endpoints/pom.xml deleted file mode 100644 index 46597a4a02dd..000000000000 --- a/CI/samples.ci/server/petstore/java-play-framework-fake-endpoints/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ - - 4.0.0 - org.openapitools - PlayServerTests-fake-endpoints - pom - 1.0-SNAPSHOT - java-play-framework-fake-endpoints Project - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.6.0 - - - Play Test - integration-test - - exec - - - sbt - - test - - - - - - - - diff --git a/CI/samples.ci/server/petstore/java-play-framework-no-bean-validation/pom.xml b/CI/samples.ci/server/petstore/java-play-framework-no-bean-validation/pom.xml deleted file mode 100644 index 495a44e9bc1e..000000000000 --- a/CI/samples.ci/server/petstore/java-play-framework-no-bean-validation/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ - - 4.0.0 - org.openapitools - PlayServerTests-no-bean-validation - pom - 1.0-SNAPSHOT - java-play-framework-no-bean-validation Project - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.6.0 - - - Play Test - integration-test - - exec - - - sbt - - test - - - - - - - - diff --git a/CI/samples.ci/server/petstore/java-play-framework-no-exception-handling/pom.xml b/CI/samples.ci/server/petstore/java-play-framework-no-exception-handling/pom.xml deleted file mode 100644 index 1943f3165799..000000000000 --- a/CI/samples.ci/server/petstore/java-play-framework-no-exception-handling/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ - - 4.0.0 - org.openapitools - PlayServerTests-no-exception-handling - pom - 1.0-SNAPSHOT - java-play-framework-no-exception-handling Project - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.6.0 - - - Play Test - integration-test - - exec - - - sbt - - test - - - - - - - - diff --git a/CI/samples.ci/server/petstore/java-play-framework-no-interface/pom.xml b/CI/samples.ci/server/petstore/java-play-framework-no-interface/pom.xml deleted file mode 100644 index 29b0d52b87c9..000000000000 --- a/CI/samples.ci/server/petstore/java-play-framework-no-interface/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ - - 4.0.0 - org.openapitools - PlayServerTests-no-interface - pom - 1.0-SNAPSHOT - java-play-framework-no-interface Project - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.6.0 - - - Play Test - integration-test - - exec - - - sbt - - test - - - - - - - - diff --git a/CI/samples.ci/server/petstore/java-play-framework-no-swagger-ui/pom.xml b/CI/samples.ci/server/petstore/java-play-framework-no-swagger-ui/pom.xml deleted file mode 100644 index d088603f853c..000000000000 --- a/CI/samples.ci/server/petstore/java-play-framework-no-swagger-ui/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ - - 4.0.0 - org.openapitools - PlayServerTests-no-swagger-ui - pom - 1.0-SNAPSHOT - java-play-framework-no-swagger-ui Project - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.6.0 - - - Play Test - integration-test - - exec - - - sbt - - test - - - - - - - - diff --git a/CI/samples.ci/server/petstore/java-play-framework-no-wrap-calls/pom.xml b/CI/samples.ci/server/petstore/java-play-framework-no-wrap-calls/pom.xml deleted file mode 100644 index 258bba058736..000000000000 --- a/CI/samples.ci/server/petstore/java-play-framework-no-wrap-calls/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ - - 4.0.0 - org.openapitools - PlayServerTests-no-wrap-calls - pom - 1.0-SNAPSHOT - java-play-framework-no-wrap-calls Project - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.6.0 - - - Play Test - integration-test - - exec - - - sbt - - test - - - - - - - - diff --git a/CI/samples.ci/server/petstore/java-play-framework/pom.xml b/CI/samples.ci/server/petstore/java-play-framework/pom.xml deleted file mode 100644 index 91bbd25815ec..000000000000 --- a/CI/samples.ci/server/petstore/java-play-framework/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ - - 4.0.0 - org.openapitools - PlayServerTests - pom - 1.0-SNAPSHOT - java-play-framework Project - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.6.0 - - - Play Test - integration-test - - exec - - - sbt - - test - - - - - - - - diff --git a/CI/samples.ci/server/petstore/kotlin-server/ktor/pom.xml b/CI/samples.ci/server/petstore/kotlin-server/ktor/pom.xml deleted file mode 100644 index 3123ad353a50..000000000000 --- a/CI/samples.ci/server/petstore/kotlin-server/ktor/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ - - 4.0.0 - org.openapitools - KotlinPetstoreKtorTests - pom - 1.0-SNAPSHOT - kotlin-server-ktor - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - bundle-test - integration-test - - exec - - - gradle - - test - - - - - - - - diff --git a/CI/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/obj/Debug/Org.OpenAPITools.Test.csproj.CoreCompileInputs.cache b/CI/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/obj/Debug/Org.OpenAPITools.Test.csproj.CoreCompileInputs.cache deleted file mode 100644 index 4096123585d5..000000000000 --- a/CI/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/obj/Debug/Org.OpenAPITools.Test.csproj.CoreCompileInputs.cache +++ /dev/null @@ -1 +0,0 @@ -c2fcc2ae9693a8e8d02b25e286844aad88188fcb diff --git a/CI/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/obj/Debug/Org.OpenAPITools.Test.csprojResolveAssemblyReference.cache b/CI/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/obj/Debug/Org.OpenAPITools.Test.csprojResolveAssemblyReference.cache deleted file mode 100644 index 76cdea6cfa73..000000000000 Binary files a/CI/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/obj/Debug/Org.OpenAPITools.Test.csprojResolveAssemblyReference.cache and /dev/null differ diff --git a/appveyor.yml b/appveyor.yml index 0da5ff07a0c8..dd8ab4c8bc33 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -52,8 +52,6 @@ build_script: # run the locally installed openapi-generator-gradle-plugin - gradle -b modules\openapi-generator-gradle-plugin\samples\local-spec\build.gradle buildGoSdk --stacktrace test_script: - # restore test-related files - - copy /b/v/y CI\samples.ci\client\petstore\csharp\OpenAPIClient\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj samples\client\petstore\csharp\OpenAPIClient\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj # test c# API client (netcore) - dotnet test samples\client\petstore\csharp-netcore\OpenAPIClient\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - dotnet test samples\client\petstore\csharp-netcore\OpenAPIClientCore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj @@ -62,11 +60,12 @@ test_script: # test c# API client (with PropertyChanged) - nunit3-console samples\client\petstore\csharp\OpenAPIClientWithPropertyChanged\src\Org.OpenAPITools.Test\bin\Debug\Org.OpenAPITools.Test.dll --result=myresults.xml;format=AppVeyor +### TODO: Execute all generators via powershell or other # generate all petstore clients - - .\bin\windows\run-all-petstore.cmd - + # - .\bin\windows\run-all-petstore.cmd # generate all petstore clients (openapi3) - - .\bin\openapi3\windows\run-all-petstore.cmd + # - .\bin\openapi3\windows\run-all-petstore.cmd + # test ps pestore - ps: | $ErrorActionPreference = "Stop" diff --git a/bin/ada-petstore.sh b/bin/ada-petstore.sh deleted file mode 100755 index 5441bd13ec31..000000000000 --- a/bin/ada-petstore.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env bash - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -model="modules/openapi-generator/src/test/resources/2_0/petstore.yaml" -ags="generate --template-dir modules/openapi-generator/src/main/resources/Ada -g ada $@" -ags="$ags -i $model -t modules/openapi-generator/src/main/resources/Ada -o samples/client/petstore/ada" -ags="$ags --additional-properties projectName=Petstore --model-package Samples.Petstore" - -java $JAVA_OPTS -jar $executable $ags -rm -rf samples/client/petstore/ada/src/server diff --git a/bin/android-petstore-all.sh b/bin/android-petstore-all.sh deleted file mode 100755 index 08a03263a856..000000000000 --- a/bin/android-petstore-all.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -./bin/android-petstore-httpclient.sh -./bin/android-petstore-volley.sh - diff --git a/bin/android-petstore-httpclient.sh b/bin/android-petstore-httpclient.sh deleted file mode 100755 index d0982cec14fc..000000000000 --- a/bin/android-petstore-httpclient.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/android -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g android --additional-properties library=httpclient -o samples/client/petstore/android/httpclient $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/android-petstore-volley.json b/bin/android-petstore-volley.json deleted file mode 100644 index 7366f4817c98..000000000000 --- a/bin/android-petstore-volley.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "library": "volley", - "artifactId": "petstore-android-volley" -} diff --git a/bin/android-petstore-volley.sh b/bin/android-petstore-volley.sh deleted file mode 100755 index af7edc7c393f..000000000000 --- a/bin/android-petstore-volley.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g android -c bin/android-petstore-volley.json -o samples/client/petstore/android/volley $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/apache2-petstore-config.sh b/bin/apache2-petstore-config.sh deleted file mode 100755 index ee7f1e05cc6e..000000000000 --- a/bin/apache2-petstore-config.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bash - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -g apache2 -t modules/openapi-generator/src/main/resources/apache2/ -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -o samples/config/petstore/apache2 $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/apex-petstore.sh b/bin/apex-petstore.sh deleted file mode 100755 index bdafe9e58252..000000000000 --- a/bin/apex-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/apex -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g apex -o samples/client/petstore/apex --global-property skipFormModel=true $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/asciidoc-documentation-petstore.sh b/bin/asciidoc-documentation-petstore.sh deleted file mode 100755 index 2f72f2eeb024..000000000000 --- a/bin/asciidoc-documentation-petstore.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" - -while [ -h "$SCRIPT" ] ; do - ls=$(ls -ld "$SCRIPT") - link=$(expr "$ls" : '.*-> \(.*\)$') - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=$(dirname "$SCRIPT")/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=$(dirname "$SCRIPT")/.. - APP_DIR=$(cd "${APP_DIR}"; pwd) -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/asciidoc-documentation --additional-properties=specDir=modules/openapi-generator/src/main/resources/asciidoc-documentation,snippetDir=. -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g asciidoc -o samples/documentation/asciidoc $@" - -java ${JAVA_OPTS} -jar ${executable} ${ags} diff --git a/bin/aspnetcore-petstore-server-3.0.sh b/bin/aspnetcore-petstore-server-3.0.sh deleted file mode 100755 index 1da77bd3e97a..000000000000 --- a/bin/aspnetcore-petstore-server-3.0.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bash - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -g aspnetcore -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -t modules/openapi-generator/src/main/resources/aspnetcore/3.0/ -o samples/server/petstore/aspnetcore-3.0 --additional-properties packageGuid={3C799344-F285-4669-8FD5-7ED9B795D5C5} --additional-properties aspnetCoreVersion=3.0 $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/aspnetcore-petstore-server-3.1.sh b/bin/aspnetcore-petstore-server-3.1.sh deleted file mode 100755 index 15310c75b2cf..000000000000 --- a/bin/aspnetcore-petstore-server-3.1.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bash - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -g aspnetcore -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -t modules/openapi-generator/src/main/resources/aspnetcore/3.0/ -o samples/server/petstore/aspnetcore-3.1 --additional-properties packageGuid={3C799344-F285-4669-8FD5-7ED9B795D5C5} --additional-properties aspnetCoreVersion=3.1 $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/aspnetcore-petstore-server.sh b/bin/aspnetcore-petstore-server.sh deleted file mode 100755 index ec6aa29eed37..000000000000 --- a/bin/aspnetcore-petstore-server.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bash - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -g aspnetcore -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -t modules/openapi-generator/src/main/resources/aspnetcore/2.1/ -o samples/server/petstore/aspnetcore --additional-properties packageGuid={3C799344-F285-4669-8FD5-7ED9B795D5C5} $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/aspnetcore3-petstore-server.sh b/bin/aspnetcore3-petstore-server.sh deleted file mode 100644 index 56c3be609ced..000000000000 --- a/bin/aspnetcore3-petstore-server.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bash - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -g aspnetcore -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -t modules/openapi-generator/src/main/resources/aspnetcore/3.0/ -o samples/server/petstore/aspnetcore3 --additional-properties packageGuid={3C799344-F285-4669-8FD5-7ED9B795D5C5} --additional-properties aspnetCoreVersion=3.0 $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/avro-petstore.sh b/bin/avro-petstore.sh deleted file mode 100755 index 7b8045fcf88f..000000000000 --- a/bin/avro-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/avro-schema -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g avro-schema -o samples/openapi3/schema/petstore/avro-schema $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/bash-petstore.sh b/bin/bash-petstore.sh deleted file mode 100755 index d5c4766731a5..000000000000 --- a/bin/bash-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -args="generate -t modules/openapi-generator/src/main/resources/bash -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g bash -o samples/client/petstore/bash -c modules/openapi-generator/src/test/resources/2_0/bash-config.json --additional-properties hideGenerationTimestamp=true $@" - -java $JAVA_OPTS -jar $executable $args diff --git a/bin/c-petstore.sh b/bin/c-petstore.sh deleted file mode 100755 index 19a69b8d0ea6..000000000000 --- a/bin/c-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/C-libcurl -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g c -o samples/client/petstore/c $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/ci/apex-petstore.json b/bin/ci/apex-petstore.json deleted file mode 100644 index 73773132dfc9..000000000000 --- a/bin/ci/apex-petstore.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "generatorName": "apex", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/apex", - "templateDir": "modules/openapi-generator/src/main/resources/apex" -} \ No newline at end of file diff --git a/bin/ci/csharp-netcore-petstore-1.json b/bin/ci/csharp-netcore-petstore-1.json deleted file mode 100644 index c2e1797c85b8..000000000000 --- a/bin/ci/csharp-netcore-petstore-1.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "generatorName": "csharp-netcore", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/client/petstore/csharp-netcore/OpenAPIClientCore", - "templateDir": "modules/openapi-generator/src/main/resources/csharp-netcore/", - "additionalProperties": { - "packageGuid": "{321C8C3F-0156-40C1-AE42-D59761FB9B6C}", - "useCompareNetObjects": true, - "targetFramework": "netcoreapp2.0" - } -} \ No newline at end of file diff --git a/bin/ci/csharp-netcore-petstore.json b/bin/ci/csharp-netcore-petstore.json deleted file mode 100644 index 506d74d1ab63..000000000000 --- a/bin/ci/csharp-netcore-petstore.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "generatorName": "csharp-netcore", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/client/petstore/csharp-netcore/OpenAPIClient", - "templateDir": "modules/openapi-generator/src/main/resources/csharp-netcore/", - "additionalProperties": { - "packageGuid": "{321C8C3F-0156-40C1-AE42-D59761FB9B6C}", - "useCompareNetObjects": true - } -} \ No newline at end of file diff --git a/bin/ci/csharp-petstore.json b/bin/ci/csharp-petstore.json deleted file mode 100644 index fe5a9104e139..000000000000 --- a/bin/ci/csharp-petstore.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "generatorName": "csharp", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/client/petstore/csharp/OpenAPIClient", - "additionalProperties": { - "packageGuid": "{321C8C3F-0156-40C1-AE42-D59761FB9B6C}" - } -} \ No newline at end of file diff --git a/bin/ci/dart-flutter-petstore.json b/bin/ci/dart-flutter-petstore.json deleted file mode 100644 index 81213f1c1044..000000000000 --- a/bin/ci/dart-flutter-petstore.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "generatorName": "dart", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/dart/flutter_petstore/openapi", - "templateDir": "modules/openapi-generator/src/main/resources/dart", - "additionalProperties": { - "hideGenerationTimestamp": true, - "browserClient": false, - "supportDart2": false - } -} \ No newline at end of file diff --git a/bin/ci/dart-jaguar-petstore-1.json b/bin/ci/dart-jaguar-petstore-1.json deleted file mode 100644 index 2226b49c6ff9..000000000000 --- a/bin/ci/dart-jaguar-petstore-1.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "generatorName": "dart-jaguar", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/dart-jaguar/flutter_petstore/openapi", - "templateDir": "modules/openapi-generator/src/main/resources/dart-jaguar", - "additionalProperties": { - "hideGenerationTimestamp": true, - "pubName": "openapi" - } -} \ No newline at end of file diff --git a/bin/ci/dart-jaguar-petstore-2.json b/bin/ci/dart-jaguar-petstore-2.json deleted file mode 100644 index 2eed934b1cb3..000000000000 --- a/bin/ci/dart-jaguar-petstore-2.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "generatorName": "dart-jaguar", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-proto.yaml", - "outputDir": "samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi", - "templateDir": "modules/openapi-generator/src/main/resources/dart-jaguar", - "additionalProperties": { - "serialization": "proto", - "hideGenerationTimestamp": true, - "pubName": "openapi" - } -} \ No newline at end of file diff --git a/bin/ci/dart-jaguar-petstore-3.json b/bin/ci/dart-jaguar-petstore-3.json deleted file mode 100644 index d41ef5d40c66..000000000000 --- a/bin/ci/dart-jaguar-petstore-3.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "generatorName": "dart-jaguar", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-proto.yaml", - "outputDir": "samples/client/petstore/dart-jaguar/openapi_proto", - "templateDir": "modules/openapi-generator/src/main/resources/dart-jaguar", - "additionalProperties": { - "serialization": "proto", - "hideGenerationTimestamp": true, - "pubName": "openapi" - } -} \ No newline at end of file diff --git a/bin/ci/dart-jaguar-petstore.json b/bin/ci/dart-jaguar-petstore.json deleted file mode 100644 index 761296fa286a..000000000000 --- a/bin/ci/dart-jaguar-petstore.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "generatorName": "dart-jaguar", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/dart-jaguar/openapi", - "templateDir": "modules/openapi-generator/src/main/resources/dart-jaguar", - "additionalProperties": { - "hideGenerationTimestamp": true, - "pubName": "openapi" - } -} \ No newline at end of file diff --git a/bin/ci/dart-petstore-flutter.json b/bin/ci/dart-petstore-flutter.json deleted file mode 100644 index 81213f1c1044..000000000000 --- a/bin/ci/dart-petstore-flutter.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "generatorName": "dart", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/dart/flutter_petstore/openapi", - "templateDir": "modules/openapi-generator/src/main/resources/dart", - "additionalProperties": { - "hideGenerationTimestamp": true, - "browserClient": false, - "supportDart2": false - } -} \ No newline at end of file diff --git a/bin/ci/dart-petstore-openapi-browser-client.json b/bin/ci/dart-petstore-openapi-browser-client.json deleted file mode 100644 index c26293f2f42f..000000000000 --- a/bin/ci/dart-petstore-openapi-browser-client.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "generatorName": "dart", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/dart/openapi-browser-client", - "templateDir": "modules/openapi-generator/src/main/resources/dart", - "additionalProperties": { - "hideGenerationTimestamp": true, - "browserClient": true, - "supportDart2": false - } -} \ No newline at end of file diff --git a/bin/ci/dart-petstore.json b/bin/ci/dart-petstore.json deleted file mode 100644 index 3f3691a82e7b..000000000000 --- a/bin/ci/dart-petstore.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "generatorName": "dart", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/dart/openapi", - "templateDir": "modules/openapi-generator/src/main/resources/dart", - "additionalProperties": { - "hideGenerationTimestamp": true, - "browserClient": false, - "supportDart2": false - } -} \ No newline at end of file diff --git a/bin/ci/dart2-petstore.json b/bin/ci/dart2-petstore.json deleted file mode 100644 index c12549e213d2..000000000000 --- a/bin/ci/dart2-petstore.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "generatorName": "dart", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/dart2/openapi", - "templateDir": "modules/openapi-generator/src/main/resources/dart2", - "additionalProperties": { - "hideGenerationTimestamp": true - } -} \ No newline at end of file diff --git a/bin/ci/elixir-petstore.json b/bin/ci/elixir-petstore.json deleted file mode 100644 index e8ce9b6b1166..000000000000 --- a/bin/ci/elixir-petstore.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "generatorName": "elixir", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/client/petstore/elixir/", - "templateDir": "modules/openapi-generator/src/main/resources/elixir", - "additionalProperties": { - "invokerPackage": "OpenapiPetstore" - } -} \ No newline at end of file diff --git a/bin/ci/go-gin-petstore-server.json b/bin/ci/go-gin-petstore-server.json deleted file mode 100644 index 9e55159bbc31..000000000000 --- a/bin/ci/go-gin-petstore-server.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "generatorName": "go-gin-server", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/server/petstore/go-gin-api-server", - "templateDir": "modules/openapi-generator/src/main/resources/go-gin-server", - "additionalProperties": { - "packageName": "petstoreserver", - "hideGenerationTimestamp": true - } -} \ No newline at end of file diff --git a/bin/ci/go-petstore-withxml.json b/bin/ci/go-petstore-withxml.json deleted file mode 100644 index 6fdc619534a3..000000000000 --- a/bin/ci/go-petstore-withxml.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "generatorName": "go", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/client/petstore/go/go-petstore-withXml", - "templateDir": "modules/openapi-generator/src/main/resources/go", - "additionalProperties": { - "packageName": "petstore", - "withXml": true, - "withGoCodegenComment": true - } -} \ No newline at end of file diff --git a/bin/ci/go-petstore.json b/bin/ci/go-petstore.json deleted file mode 100644 index ed3ae37ab26d..000000000000 --- a/bin/ci/go-petstore.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "generatorName": "go", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/client/petstore/go/go-petstore", - "templateDir": "modules/openapi-generator/src/main/resources/go", - "additionalProperties": { - "packageName": "petstore" - } -} \ No newline at end of file diff --git a/bin/ci/groovy-petstore.json b/bin/ci/groovy-petstore.json deleted file mode 100644 index 6ed0f5f8c9ca..000000000000 --- a/bin/ci/groovy-petstore.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "generatorName": "groovy", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/groovy", - "templateDir": "modules/openapi-generator/src/main/resources/Groovy/", - "additionalProperties": { - "hideGenerationTimestamp": true - } -} \ No newline at end of file diff --git a/bin/ci/haskell-http-client-petstore.json b/bin/ci/haskell-http-client-petstore.json deleted file mode 100644 index 49b28a41e578..000000000000 --- a/bin/ci/haskell-http-client-petstore.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "generatorName": "haskell-http-client", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/client/petstore/haskell-http-client", - "templateDir": "modules/openapi-generator/src/main/resources/haskell-http-client" -} \ No newline at end of file diff --git a/bin/ci/java-feign.json b/bin/ci/java-feign.json deleted file mode 100644 index 8d2c23fa7ea4..000000000000 --- a/bin/ci/java-feign.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "!include": "bin/java-petstore-feign-9x.json", - "generatorName": "java", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/client/petstore/java/feign", - "templateDir": "modules/openapi-generator/src/main/resources/Java", - "additionalProperties": { - "hideGenerationTimestamp": true, - "booleanGetterPrefix": "is", - "additionalModelTypeAnnotations": "@javax.annotation.concurrent.Immutable" - } -} \ No newline at end of file diff --git a/bin/ci/java-feign10x.json b/bin/ci/java-feign10x.json deleted file mode 100644 index 50574a954232..000000000000 --- a/bin/ci/java-feign10x.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "!include": "bin/java-petstore-feign-10x.json", - "generatorName": "java", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/client/petstore/java/feign10x", - "templateDir": "modules/openapi-generator/src/main/resources/Java", - "additionalProperties": { - "hideGenerationTimestamp": true, - "booleanGetterPrefix": "is" - } -} \ No newline at end of file diff --git a/bin/ci/java-google-api-client.json b/bin/ci/java-google-api-client.json deleted file mode 100644 index e30057f3c914..000000000000 --- a/bin/ci/java-google-api-client.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "!include": "bin/java-petstore-google-api-client.json", - "generatorName": "java", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/client/petstore/java/google-api-client", - "templateDir": "modules/openapi-generator/src/main/resources/Java", - "additionalProperties": { - "hideGenerationTimestamp": true - } -} \ No newline at end of file diff --git a/bin/ci/java-jaxrs-cxf-annotated-base-path.json b/bin/ci/java-jaxrs-cxf-annotated-base-path.json deleted file mode 100644 index 5c914be89cd9..000000000000 --- a/bin/ci/java-jaxrs-cxf-annotated-base-path.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "artifactId": "cxf-annotated-basepath", - "generatorName": "jaxrs-cxf", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/server/petstore/jaxrs-cxf-annotated-base-path", - "templateDir": "modules/openapi-generator/src/main/resources/JavaJaxRS/cxf", - "additionalProperties": { - "hideGenerationTimestamp": true, - "useAnnotatedBasePath": true, - "serverPort": "8082" - } -} \ No newline at end of file diff --git a/bin/ci/java-jaxrs-cxf-cdi.json b/bin/ci/java-jaxrs-cxf-cdi.json deleted file mode 100644 index 2ce07d221596..000000000000 --- a/bin/ci/java-jaxrs-cxf-cdi.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "generatorName": "jaxrs-cxf-cdi", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/server/petstore/jaxrs-cxf-cdi", - "templateDir": "modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi", - "additionalProperties": { - "hideGenerationTimestamp": true - } -} \ No newline at end of file diff --git a/bin/ci/java-jaxrs-cxf-non-spring-app.json b/bin/ci/java-jaxrs-cxf-non-spring-app.json deleted file mode 100644 index d7864551b20a..000000000000 --- a/bin/ci/java-jaxrs-cxf-non-spring-app.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "artifactId": "cxf-server-non-spring", - "generatorName": "jaxrs-cxf", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/server/petstore/jaxrs-cxf-non-spring-app", - "templateDir": "modules/openapi-generator/src/main/resources/JavaJaxRS/cxf", - "additionalProperties": { - "hideGenerationTimestamp": true, - "generateNonSpringApplication": true, - "serverPort": "8082" - } -} \ No newline at end of file diff --git a/bin/ci/java-jaxrs-cxf.json b/bin/ci/java-jaxrs-cxf.json deleted file mode 100644 index 3d80df7a5817..000000000000 --- a/bin/ci/java-jaxrs-cxf.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "generatorName": "jaxrs-cxf", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/server/petstore/jaxrs-cxf", - "templateDir": "modules/openapi-generator/src/main/resources/JavaJaxRS/cxf", - "additionalProperties": { - "hideGenerationTimestamp": true, - "serverPort": "8082" - } -} \ No newline at end of file diff --git a/bin/ci/java-jaxrs-datelib-j8.json b/bin/ci/java-jaxrs-datelib-j8.json deleted file mode 100644 index f97c7cfa7187..000000000000 --- a/bin/ci/java-jaxrs-datelib-j8.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "!include": "bin/jaxrs-datelib-j8.json", - "generatorName": "jaxrs-jersey", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/server/petstore/jaxrs-datelib-j8/", - "templateDir": "modules/openapi-generator/src/main/resources/JavaJaxRS/", - "additionalProperties": { - "hideGenerationTimestamp": true, - "serverPort": "8082" - } -} \ No newline at end of file diff --git a/bin/ci/java-jaxrs-jersey.json b/bin/ci/java-jaxrs-jersey.json deleted file mode 100644 index 5065fb2c385e..000000000000 --- a/bin/ci/java-jaxrs-jersey.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "artifactId": "openapiv3-jaxrs-jersey-petstore-server", - "generatorName": "jaxrs-jersey", - "inputSpec": "modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/server/petstore/jaxrs-jersey", - "templateDir": "modules/openapi-generator/src/main/resources/JavaJaxRS/", - "additionalProperties": { - "hideGenerationTimestamp": true - } -} \ No newline at end of file diff --git a/bin/ci/java-jaxrs-jersey1-useTags.json b/bin/ci/java-jaxrs-jersey1-useTags.json deleted file mode 100644 index 2b1696d09256..000000000000 --- a/bin/ci/java-jaxrs-jersey1-useTags.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "artifactId": "jaxrs-jersey1-useTags", - "generatorName": "jaxrs-jersey", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "library": "jersey1", - "outputDir": "samples/server/petstore/jaxrs/jersey1-useTags", - "templateDir": "modules/openapi-generator/src/main/resources/JavaJaxRS", - "additionalProperties": { - "hideGenerationTimestamp": true, - "serverPort": "8082", - "useTags": true - } -} \ No newline at end of file diff --git a/bin/ci/java-jaxrs-jersey1.json b/bin/ci/java-jaxrs-jersey1.json deleted file mode 100644 index a2dde704e72d..000000000000 --- a/bin/ci/java-jaxrs-jersey1.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "artifactId": "jaxrs-jersey1-server", - "generatorName": "jaxrs-jersey", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "library": "jersey1", - "outputDir": "samples/server/petstore/jaxrs/jersey1", - "templateDir": "modules/openapi-generator/src/main/resources/JavaJaxRS", - "additionalProperties": { - "hideGenerationTimestamp": true, - "serverPort": "8082" - } -} \ No newline at end of file diff --git a/bin/ci/java-jaxrs-jersey2-useTags.json b/bin/ci/java-jaxrs-jersey2-useTags.json deleted file mode 100644 index 6c8aa420d312..000000000000 --- a/bin/ci/java-jaxrs-jersey2-useTags.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "artifactId": "jaxrs-jersey2-useTags", - "generatorName": "jaxrs-jersey", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/server/petstore/jaxrs/jersey2-useTags", - "templateDir": "modules/openapi-generator/src/main/resources/JavaJaxRS", - "additionalProperties": { - "hideGenerationTimestamp": true, - "serverPort": "8082", - "useTags": true - } -} \ No newline at end of file diff --git a/bin/ci/java-jaxrs-jersey2.json b/bin/ci/java-jaxrs-jersey2.json deleted file mode 100644 index 7c88d46e05ed..000000000000 --- a/bin/ci/java-jaxrs-jersey2.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "artifactId": "jaxrs-jersey-petstore-server", - "generatorName": "jaxrs-jersey", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/server/petstore/jaxrs/jersey2", - "templateDir": "modules/openapi-generator/src/main/resources/JavaJaxRS", - "additionalProperties": { - "hideGenerationTimestamp": true, - "serverPort": "8082" - } -} \ No newline at end of file diff --git a/bin/ci/java-jaxrs-resteasy-eap-java8-server.json b/bin/ci/java-jaxrs-resteasy-eap-java8-server.json deleted file mode 100644 index 2a7af42d82b5..000000000000 --- a/bin/ci/java-jaxrs-resteasy-eap-java8-server.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "!include": "bin/jaxrs-resteasy-eap-java8-petstore-server.json", - "artifactId": "jaxrs-resteasy-eap-java8-server", - "generatorName": "jaxrs-resteasy-eap", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/server/petstore/jaxrs-resteasy/eap-java8", - "templateDir": "modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap", - "additionalProperties": { - "hideGenerationTimestamp": true - } -} \ No newline at end of file diff --git a/bin/ci/java-jaxrs-resteasy-eap-joda-server.json b/bin/ci/java-jaxrs-resteasy-eap-joda-server.json deleted file mode 100644 index 242744045b12..000000000000 --- a/bin/ci/java-jaxrs-resteasy-eap-joda-server.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "!include": "bin/jaxrs-resteasy-eap-joda-petstore-server.json", - "artifactId": "jaxrs-resteasy-eap-joda-server", - "generatorName": "jaxrs-resteasy-eap", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/server/petstore/jaxrs-resteasy/eap-joda", - "templateDir": "modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap", - "additionalProperties": { - "hideGenerationTimestamp": true - } -} \ No newline at end of file diff --git a/bin/ci/java-jaxrs-resteasy-eap.json b/bin/ci/java-jaxrs-resteasy-eap.json deleted file mode 100644 index 2ce98a184ccb..000000000000 --- a/bin/ci/java-jaxrs-resteasy-eap.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "generatorName": "jaxrs-resteasy-eap", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/server/petstore/jaxrs-resteasy/eap", - "templateDir": "modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap", - "additionalProperties": { - "hideGenerationTimestamp": true - } -} \ No newline at end of file diff --git a/bin/ci/java-jaxrs-resteasy-joda-server.json b/bin/ci/java-jaxrs-resteasy-joda-server.json deleted file mode 100644 index aa243b2b0d2c..000000000000 --- a/bin/ci/java-jaxrs-resteasy-joda-server.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "!include": "bin/jaxrs-resteasy-joda-petstore-server.json", - "artifactId": "jaxrs-resteasy-joda-server", - "generatorName": "jaxrs-resteasy", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/server/petstore/jaxrs-resteasy/joda", - "templateDir": "modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy", - "additionalProperties": { - "hideGenerationTimestamp": true - } -} \ No newline at end of file diff --git a/bin/ci/java-jaxrs-resteasy.json b/bin/ci/java-jaxrs-resteasy.json deleted file mode 100644 index baf1a65e86c8..000000000000 --- a/bin/ci/java-jaxrs-resteasy.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "generatorName": "jaxrs-resteasy", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/server/petstore/jaxrs-resteasy/default", - "templateDir": "modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy", - "additionalProperties": { - "hideGenerationTimestamp": true - } -} \ No newline at end of file diff --git a/bin/ci/java-jaxrs-spec-interface.json b/bin/ci/java-jaxrs-spec-interface.json deleted file mode 100644 index e588bfbacb77..000000000000 --- a/bin/ci/java-jaxrs-spec-interface.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "artifactId": "jaxrs-spec-interface-petstore-server", - "generatorName": "jaxrs-spec", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/server/petstore/jaxrs-spec-interface", - "additionalProperties": { - "hideGenerationTimestamp": true, - "serializableModel": true, - "interfaceOnly": true - } -} \ No newline at end of file diff --git a/bin/ci/java-jaxrs-spec.json b/bin/ci/java-jaxrs-spec.json deleted file mode 100644 index b4ba832193ef..000000000000 --- a/bin/ci/java-jaxrs-spec.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "artifactId": "jaxrs-spec-petstore-server", - "generatorName": "jaxrs-spec", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/server/petstore/jaxrs-spec", - "additionalProperties": { - "hideGenerationTimestamp": true, - "serializableModel": true - } -} \ No newline at end of file diff --git a/bin/ci/java-jersey1.json b/bin/ci/java-jersey1.json deleted file mode 100644 index 2982da52b322..000000000000 --- a/bin/ci/java-jersey1.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "artifactId": "petstore-java-client-jersey1", - "generatorName": "java", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "library": "jersey1", - "outputDir": "samples/client/petstore/java/jersey1", - "templateDir": "modules/openapi-generator/src/main/resources/Java", - "additionalProperties": { - "hideGenerationTimestamp": true - } -} \ No newline at end of file diff --git a/bin/ci/java-jersey2-java6.json b/bin/ci/java-jersey2-java6.json deleted file mode 100644 index 1420161ffbde..000000000000 --- a/bin/ci/java-jersey2-java6.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "!include": "bin/java-petstore-jersey2.json", - "artifactId": "petstore-jersey2-java6", - "generatorName": "java", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/client/petstore/java/jersey2-java6", - "additionalProperties": { - "hideGenerationTimestamp": true, - "supportJava6": true, - "booleanGetterPrefix": "is" - } -} \ No newline at end of file diff --git a/bin/ci/java-jersey2-java8.json b/bin/ci/java-jersey2-java8.json deleted file mode 100644 index c1843fb8799e..000000000000 --- a/bin/ci/java-jersey2-java8.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "!include": "bin/java8-petstore-jersey2.json", - "artifactId": "petstore-jersey2-java8", - "generatorName": "java", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/client/petstore/java/jersey2-java8", - "additionalProperties": { - "hideGenerationTimestamp": true, - "serverPort": "8082" - } -} \ No newline at end of file diff --git a/bin/ci/java-jersey2.json b/bin/ci/java-jersey2.json deleted file mode 100644 index e0ad2e3c2847..000000000000 --- a/bin/ci/java-jersey2.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "!include": "bin/java-petstore-jersey2.json", - "generatorName": "java", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/client/petstore/java/jersey2", - "additionalProperties": { - "hideGenerationTimestamp": true - } -} \ No newline at end of file diff --git a/bin/ci/java-msf4j-petstore-server.json b/bin/ci/java-msf4j-petstore-server.json deleted file mode 100644 index 0389c62a24c7..000000000000 --- a/bin/ci/java-msf4j-petstore-server.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "generatorName": "java-msf4j", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/server/petstore/java-msf4j/", - "templateDir": "modules/openapi-generator/src/main/resources/java-msf4j-server", - "additionalProperties": { - "hideGenerationTimestamp": true, - "artifactId": "java-msf4j-server" - } -} \ No newline at end of file diff --git a/bin/ci/java-native.json b/bin/ci/java-native.json deleted file mode 100644 index 7d8c792e5bc7..000000000000 --- a/bin/ci/java-native.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "!include": "bin/java-petstore-native.json", - "generatorName": "java", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/client/petstore/java/native", - "templateDir": "modules/openapi-generator/src/main/resources/Java", - "additionalProperties": { - "hideGenerationTimestamp": true - } -} \ No newline at end of file diff --git a/bin/ci/java-okhttp-gson-parcelableModel.json b/bin/ci/java-okhttp-gson-parcelableModel.json deleted file mode 100644 index 332fa46a24f0..000000000000 --- a/bin/ci/java-okhttp-gson-parcelableModel.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "!include": "bin/java-petstore-okhttp-gson.json", - "artifactId": "petstore-okhttp-gson-parcelableModel", - "generatorName": "java", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/client/petstore/java/okhttp-gson-parcelableModel", - "templateDir": "modules/openapi-generator/src/main/resources/Java", - "additionalProperties": { - "hideGenerationTimestamp": true, - "parcelableModel": true - } -} \ No newline at end of file diff --git a/bin/ci/java-okhttp-gson.json b/bin/ci/java-okhttp-gson.json deleted file mode 100644 index cdba0e712874..000000000000 --- a/bin/ci/java-okhttp-gson.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "!include": "bin/java-petstore-okhttp-gson.json", - "generatorName": "java", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/client/petstore/java/okhttp-gson", - "templateDir": "modules/openapi-generator/src/main/resources/Java", - "additionalProperties": { - "hideGenerationTimestamp": true - } -} \ No newline at end of file diff --git a/bin/ci/java-petstore-feign-10x.json b/bin/ci/java-petstore-feign-10x.json deleted file mode 100644 index 50994004159b..000000000000 --- a/bin/ci/java-petstore-feign-10x.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "generatorName": "java", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "templateDir": "modules/openapi-generator/src/main/resources/Java", - "outputDir": "samples/client/petstore/java/feign10x", - "additionalProperties": { - "hideGenerationTimestamp": true, - "booleanGetterPrefix": "is" - }, - "!include": "bin/java-petstore-feign-10x.json" -} \ No newline at end of file diff --git a/bin/ci/java-play-framework-api-package-override.json b/bin/ci/java-play-framework-api-package-override.json deleted file mode 100644 index 6570af2c8b7c..000000000000 --- a/bin/ci/java-play-framework-api-package-override.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "generatorName": "java-play-framework", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/server/petstore/java-play-framework-api-package-override", - "templateDir": "modules/openapi-generator/src/main/resources/JavaPlayFramework", - "additionalProperties": { - "hideGenerationTimestamp": true, - "apiPackage": "com.puppies.store.apis" - } -} \ No newline at end of file diff --git a/bin/ci/java-play-framework-async.json b/bin/ci/java-play-framework-async.json deleted file mode 100644 index 0b8a3697078e..000000000000 --- a/bin/ci/java-play-framework-async.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "!include": "bin/java-play-framework-petstore-server-async.json", - "generatorName": "java-play-framework", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/server/petstore/java-play-framework-async", - "templateDir": "modules/openapi-generator/src/main/resources/JavaPlayFramework", - "additionalProperties": { - "hideGenerationTimestamp": true - } -} \ No newline at end of file diff --git a/bin/ci/java-play-framework-controller-only.json b/bin/ci/java-play-framework-controller-only.json deleted file mode 100644 index 4cb2c55db206..000000000000 --- a/bin/ci/java-play-framework-controller-only.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "generatorName": "java-play-framework", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/server/petstore/java-play-framework-controller-only", - "templateDir": "modules/openapi-generator/src/main/resources/JavaPlayFramework", - "additionalProperties": { - "hideGenerationTimestamp": true, - "controllerOnly": true - } -} \ No newline at end of file diff --git a/bin/ci/java-play-framework-fake-endpoints.json b/bin/ci/java-play-framework-fake-endpoints.json deleted file mode 100644 index abcf09793be3..000000000000 --- a/bin/ci/java-play-framework-fake-endpoints.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "generatorName": "java-play-framework", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/server/petstore/java-play-framework-fake-endpoints", - "templateDir": "modules/openapi-generator/src/main/resources/JavaPlayFramework", - "additionalProperties": { - "hideGenerationTimestamp": true - } -} \ No newline at end of file diff --git a/bin/ci/java-play-framework-no-bean-validation.json b/bin/ci/java-play-framework-no-bean-validation.json deleted file mode 100644 index d0065ff62691..000000000000 --- a/bin/ci/java-play-framework-no-bean-validation.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "generatorName": "java-play-framework", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/server/petstore/java-play-framework-no-bean-validation", - "templateDir": "modules/openapi-generator/src/main/resources/JavaPlayFramework", - "additionalProperties": { - "hideGenerationTimestamp": true, - "useBeanValidation": false - } -} \ No newline at end of file diff --git a/bin/ci/java-play-framework-no-exception-handling.json b/bin/ci/java-play-framework-no-exception-handling.json deleted file mode 100644 index 5eb86194321e..000000000000 --- a/bin/ci/java-play-framework-no-exception-handling.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "generatorName": "java-play-framework", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/server/petstore/java-play-framework-no-exception-handling", - "templateDir": "modules/openapi-generator/src/main/resources/JavaPlayFramework", - "additionalProperties": { - "hideGenerationTimestamp": true, - "handleExceptions": false - } -} \ No newline at end of file diff --git a/bin/ci/java-play-framework-no-interface.json b/bin/ci/java-play-framework-no-interface.json deleted file mode 100644 index 50de0e4d7b1c..000000000000 --- a/bin/ci/java-play-framework-no-interface.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "generatorName": "java-play-framework", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/server/petstore/java-play-framework-no-interface", - "templateDir": "modules/openapi-generator/src/main/resources/JavaPlayFramework", - "additionalProperties": { - "hideGenerationTimestamp": true, - "useInterfaces": false - } -} \ No newline at end of file diff --git a/bin/ci/java-play-framework-no-swagger-ui.json b/bin/ci/java-play-framework-no-swagger-ui.json deleted file mode 100644 index 388744e3a94f..000000000000 --- a/bin/ci/java-play-framework-no-swagger-ui.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "generatorName": "java-play-framework", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/server/petstore/java-play-framework-no-swagger-ui", - "templateDir": "modules/openapi-generator/src/main/resources/JavaPlayFramework", - "additionalProperties": { - "hideGenerationTimestamp": true, - "useSwaggerUI": false - } -} \ No newline at end of file diff --git a/bin/ci/java-play-framework-no-wrap-calls.json b/bin/ci/java-play-framework-no-wrap-calls.json deleted file mode 100644 index 36bb6672462f..000000000000 --- a/bin/ci/java-play-framework-no-wrap-calls.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "generatorName": "java-play-framework", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/server/petstore/java-play-framework-no-wrap-calls", - "templateDir": "modules/openapi-generator/src/main/resources/JavaPlayFramework", - "additionalProperties": { - "hideGenerationTimestamp": true, - "wrapCalls": false - } -} \ No newline at end of file diff --git a/bin/ci/java-play-framework.json b/bin/ci/java-play-framework.json deleted file mode 100644 index a94f7f54e953..000000000000 --- a/bin/ci/java-play-framework.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "generatorName": "java-play-framework", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/server/petstore/java-play-framework", - "templateDir": "modules/openapi-generator/src/main/resources/JavaPlayFramework", - "additionalProperties": { - "hideGenerationTimestamp": true - } -} \ No newline at end of file diff --git a/bin/ci/java-rest-assured-jackson.json b/bin/ci/java-rest-assured-jackson.json deleted file mode 100644 index c652a9bf7a2d..000000000000 --- a/bin/ci/java-rest-assured-jackson.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "!include": "bin/java-petstore-rest-assured-jackson.json", - "generatorName": "java", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/client/petstore/java/rest-assured-jackson", - "templateDir": "modules/openapi-generator/src/main/resources/Java", - "additionalProperties": { - "hideGenerationTimestamp": true, - "booleanGetterPrefix": "is", - "java8": "true", - "dateLibrary": "java8", - "serializationLibrary": "jackson", - "useBeanValidation": "true", - "performBeanValidation": "true" - } -} diff --git a/bin/ci/java-rest-assured.json b/bin/ci/java-rest-assured.json deleted file mode 100644 index c1328500ad3f..000000000000 --- a/bin/ci/java-rest-assured.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "!include": "bin/java-petstore-rest-assured.json", - "generatorName": "java", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/client/petstore/java/rest-assured", - "templateDir": "modules/openapi-generator/src/main/resources/Java", - "additionalProperties": { - "hideGenerationTimestamp": true, - "booleanGetterPrefix": "is" - } -} \ No newline at end of file diff --git a/bin/ci/java-resteasy.json b/bin/ci/java-resteasy.json deleted file mode 100644 index 8a86a9be1396..000000000000 --- a/bin/ci/java-resteasy.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "!include": "bin/java-petstore-resteasy.json", - "generatorName": "java", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/client/petstore/java/resteasy", - "additionalProperties": { - "hideGenerationTimestamp": true - } -} \ No newline at end of file diff --git a/bin/ci/java-resttemplate-withXml.json b/bin/ci/java-resttemplate-withXml.json deleted file mode 100644 index e05ea6c1cc54..000000000000 --- a/bin/ci/java-resttemplate-withXml.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "!include": "bin/java-petstore-resttemplate.json", - "artifactId": "petstore-resttemplate-withxml", - "generatorName": "java", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/client/petstore/java/resttemplate-withXml", - "additionalProperties": { - "hideGenerationTimestamp": true, - "withXml": true - } -} \ No newline at end of file diff --git a/bin/ci/java-resttemplate.json b/bin/ci/java-resttemplate.json deleted file mode 100644 index 9411e39e8bde..000000000000 --- a/bin/ci/java-resttemplate.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "!include": "bin/java-petstore-resttemplate.json", - "generatorName": "java", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/client/petstore/java/resttemplate", - "additionalProperties": { - "hideGenerationTimestamp": true - } -} \ No newline at end of file diff --git a/bin/ci/java-retrofit.json b/bin/ci/java-retrofit.json deleted file mode 100644 index 65ded148ba24..000000000000 --- a/bin/ci/java-retrofit.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "!include": "bin/java-petstore-retrofit.json", - "generatorName": "java", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/client/petstore/java/retrofit", - "additionalProperties": { - "hideGenerationTimestamp": true, - "dateLibrary": "joda" - } -} \ No newline at end of file diff --git a/bin/ci/java-retrofit2-play24.json b/bin/ci/java-retrofit2-play24.json deleted file mode 100644 index 208c9173ae29..000000000000 --- a/bin/ci/java-retrofit2-play24.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "!include": "bin/java-petstore-retrofit2-play24.json", - "artifactId": "petstore-java-client-retrofit2-play24", - "generatorName": "java", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/client/petstore/java/retrofit2-play24", - "additionalProperties": { - "hideGenerationTimestamp": true - } -} \ No newline at end of file diff --git a/bin/ci/java-retrofit2-play25.json b/bin/ci/java-retrofit2-play25.json deleted file mode 100644 index e28b883137a8..000000000000 --- a/bin/ci/java-retrofit2-play25.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "!include": "bin/java-petstore-retrofit2-play25.json", - "artifactId": "petstore-java-client-retrofit2-play25", - "generatorName": "java", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/client/petstore/java/retrofit2-play25", - "additionalProperties": { - "hideGenerationTimestamp": true - } -} \ No newline at end of file diff --git a/bin/ci/java-retrofit2-play26.json b/bin/ci/java-retrofit2-play26.json deleted file mode 100644 index 0068c156b24c..000000000000 --- a/bin/ci/java-retrofit2-play26.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "!include": "bin/java-petstore-retrofit2-play26.json", - "artifactId": "petstore-java-client-retrofit2-play26", - "generatorName": "java", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/client/petstore/java/retrofit2-play26", - "additionalProperties": { - "hideGenerationTimestamp": true - } -} \ No newline at end of file diff --git a/bin/ci/java-retrofit2.json b/bin/ci/java-retrofit2.json deleted file mode 100644 index 8f2c2a8fba19..000000000000 --- a/bin/ci/java-retrofit2.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "!include": "bin/java-petstore-retrofit2.json", - "generatorName": "java", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/client/petstore/java/retrofit2", - "templateDir": "modules/openapi-generator/src/main/resources/Java", - "additionalProperties": { - "hideGenerationTimestamp": true - } -} \ No newline at end of file diff --git a/bin/ci/java-retrofit2rx.json b/bin/ci/java-retrofit2rx.json deleted file mode 100644 index 35ca3ab5831c..000000000000 --- a/bin/ci/java-retrofit2rx.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "!include": "bin/java-petstore-retrofit2rx.json", - "generatorName": "java", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/client/petstore/java/retrofit2rx", - "templateDir": "modules/openapi-generator/src/main/resources/Java", - "additionalProperties": { - "useRxJava": true, - "hideGenerationTimestamp": true - } -} \ No newline at end of file diff --git a/bin/ci/java-retrofit2rx2.json b/bin/ci/java-retrofit2rx2.json deleted file mode 100644 index ce0d7d89d4c7..000000000000 --- a/bin/ci/java-retrofit2rx2.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "!include": "bin/java-petstore-retrofit2rx2.json", - "generatorName": "java", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/client/petstore/java/retrofit2rx2", - "templateDir": "modules/openapi-generator/src/main/resources/Java", - "additionalProperties": { - "useRxJava2": true, - "hideGenerationTimestamp": true - } -} \ No newline at end of file diff --git a/bin/ci/java-vertx.json b/bin/ci/java-vertx.json deleted file mode 100644 index 2eb162e1c375..000000000000 --- a/bin/ci/java-vertx.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "!include": "bin/java-petstore-vertx.json", - "generatorName": "java", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/client/petstore/java/vertx", - "templateDir": "modules/openapi-generator/src/main/resources/Java", - "additionalProperties": { - "hideGenerationTimestamp": true - } -} \ No newline at end of file diff --git a/bin/ci/java-webclient.json b/bin/ci/java-webclient.json deleted file mode 100644 index 6c2dfdee8836..000000000000 --- a/bin/ci/java-webclient.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "!include": "bin/java-petstore-webclient.json", - "generatorName": "java", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/client/petstore/java/webclient", - "additionalProperties": { - "hideGenerationTimestamp": true - } -} \ No newline at end of file diff --git a/bin/ci/javascript-petstore-1.json b/bin/ci/javascript-petstore-1.json deleted file mode 100644 index 820982bd59ed..000000000000 --- a/bin/ci/javascript-petstore-1.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "generatorName": "javascript", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/client/petstore/javascript-promise", - "templateDir": "modules/openapi-generator/src/main/resources/Javascript", - "additionalProperties": { - "usePromises": true, - "useES6": false, - "appName": "PetstoreClient" - } -} \ No newline at end of file diff --git a/bin/ci/javascript-petstore-2.json b/bin/ci/javascript-petstore-2.json deleted file mode 100644 index 5d545ded3289..000000000000 --- a/bin/ci/javascript-petstore-2.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "generatorName": "javascript", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/client/petstore/javascript-es6", - "templateDir": "modules/openapi-generator/src/main/resources/Javascript/es6", - "additionalProperties": { - "appName": "PetstoreClient" - } -} \ No newline at end of file diff --git a/bin/ci/javascript-petstore-3.json b/bin/ci/javascript-petstore-3.json deleted file mode 100644 index 662aca532097..000000000000 --- a/bin/ci/javascript-petstore-3.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "generatorName": "javascript", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/client/petstore/javascript-promise-es6", - "templateDir": "modules/openapi-generator/src/main/resources/Javascript/es6", - "additionalProperties": { - "appName": "PetstoreClient", - "usePromises": true, - "useES6": true - } -} \ No newline at end of file diff --git a/bin/ci/javascript-petstore.json b/bin/ci/javascript-petstore.json deleted file mode 100644 index 0e85caf8cf22..000000000000 --- a/bin/ci/javascript-petstore.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "generatorName": "javascript", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/client/petstore/javascript", - "templateDir": "modules/openapi-generator/src/main/resources/Javascript", - "additionalProperties": { - "appName": "PetstoreClient", - "useES6": false - } -} \ No newline at end of file diff --git a/bin/ci/kotlin-client-petstore-multiplatform.json b/bin/ci/kotlin-client-petstore-multiplatform.json deleted file mode 100644 index 1459a1dbf765..000000000000 --- a/bin/ci/kotlin-client-petstore-multiplatform.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "artifactId": "kotlin-client-petstore-multiplatform", - "generatorName": "kotlin", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/kotlin-multiplatform", - "templateDir": "modules/openapi-generator/src/main/resources/kotlin-client", - "library": "multiplatform", - "additionalProperties": { - "dateLibrary": "java8" - } -} \ No newline at end of file diff --git a/bin/ci/kotlin-client-petstore.json b/bin/ci/kotlin-client-petstore.json deleted file mode 100644 index 55faa24802fe..000000000000 --- a/bin/ci/kotlin-client-petstore.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "artifactId": "kotlin-petstore-client", - "generatorName": "kotlin", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/kotlin", - "templateDir": "modules/openapi-generator/src/main/resources/kotlin-client", - "additionalProperties": { - "dateLibrary": "java8", - "serializableModel": "true" - } -} \ No newline at end of file diff --git a/bin/ci/kotlin-client-string.json b/bin/ci/kotlin-client-string.json deleted file mode 100644 index cceb366c2ce9..000000000000 --- a/bin/ci/kotlin-client-string.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "artifactId": "kotlin-petstore-string", - "generatorName": "kotlin", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/kotlin-string", - "templateDir": "modules/openapi-generator/src/main/resources/kotlin-client", - "additionalProperties": { - "dateLibrary": "string", - "serializableModel": "true", - "sortParamsByRequiredFlag": "false", - "sortModelPropertiesByRequiredFlag": "false" - } -} \ No newline at end of file diff --git a/bin/ci/kotlin-client-threetenbp.json b/bin/ci/kotlin-client-threetenbp.json deleted file mode 100644 index 9f12cd38b2ab..000000000000 --- a/bin/ci/kotlin-client-threetenbp.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "artifactId": "kotlin-petstore-threetenbp", - "generatorName": "kotlin", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/kotlin-threetenbp", - "templateDir": "modules/openapi-generator/src/main/resources/kotlin-client", - "additionalProperties": { - "dateLibrary": "threetenbp" - } -} \ No newline at end of file diff --git a/bin/ci/kotlin-server-petstore.json b/bin/ci/kotlin-server-petstore.json deleted file mode 100644 index dfd64c142587..000000000000 --- a/bin/ci/kotlin-server-petstore.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "generatorName": "kotlin-server", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "library": "ktor", - "outputDir": "samples/server/petstore/kotlin-server/ktor", - "templateDir": "modules/openapi-generator/src/main/resources/kotlin-server", - "additionalProperties": { - "hideGenerationTimestamp": true, - "serializableModel": "true" - } -} \ No newline at end of file diff --git a/bin/ci/kotlin-springboot-petstore-server-reactive.json b/bin/ci/kotlin-springboot-petstore-server-reactive.json deleted file mode 100644 index fd2e318f8bb4..000000000000 --- a/bin/ci/kotlin-springboot-petstore-server-reactive.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "generatorName": "kotlin-spring", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/server/petstore/kotlin-springboot-reactive", - "templateDir": "modules/openapi-generator/src/main/resources/kotlin-spring", - "additionalProperties": { - "library": "spring-boot", - "beanValidations": true, - "swaggerAnnotations": true, - "serviceImplementation": true, - "reactive": true - } -} \ No newline at end of file diff --git a/bin/ci/kotlin-springboot-petstore-server.json b/bin/ci/kotlin-springboot-petstore-server.json deleted file mode 100644 index 71597b8df266..000000000000 --- a/bin/ci/kotlin-springboot-petstore-server.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "generatorName": "kotlin-spring", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/server/petstore/kotlin-springboot", - "templateDir": "modules/openapi-generator/src/main/resources/kotlin-spring", - "additionalProperties": { - "library": "spring-boot", - "beanValidations": true, - "swaggerAnnotations": true, - "serviceImplementation": true - } -} \ No newline at end of file diff --git a/bin/ci/mysql-schema-petstore.json b/bin/ci/mysql-schema-petstore.json deleted file mode 100644 index 6937721ece0f..000000000000 --- a/bin/ci/mysql-schema-petstore.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "generatorName": "mysql-schema", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/schema/petstore/mysql", - "templateDir": "modules/openapi-generator/src/main/resources/mysql-schema" -} \ No newline at end of file diff --git a/bin/ci/openapi3-jaxrs-jersey-petstore.json b/bin/ci/openapi3-jaxrs-jersey-petstore.json deleted file mode 100644 index 5065fb2c385e..000000000000 --- a/bin/ci/openapi3-jaxrs-jersey-petstore.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "artifactId": "openapiv3-jaxrs-jersey-petstore-server", - "generatorName": "jaxrs-jersey", - "inputSpec": "modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/server/petstore/jaxrs-jersey", - "templateDir": "modules/openapi-generator/src/main/resources/JavaJaxRS/", - "additionalProperties": { - "hideGenerationTimestamp": true - } -} \ No newline at end of file diff --git a/bin/ci/openapi3-php-petstore.json b/bin/ci/openapi3-php-petstore.json deleted file mode 100644 index 47e2dba98533..000000000000 --- a/bin/ci/openapi3-php-petstore.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "generatorName": "php", - "inputSpec": "modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/openapi3/client/petstore/php/OpenAPIClient-php", - "templateDir": "modules/openapi-generator/src/main/resources/php" -} \ No newline at end of file diff --git a/bin/ci/openapi3-python-petstore.json b/bin/ci/openapi3-python-petstore.json deleted file mode 100644 index 7945bd9d6d10..000000000000 --- a/bin/ci/openapi3-python-petstore.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "generatorName": "python", - "inputSpec": "modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/openapi3/client/petstore/python/", - "templateDir": "modules/openapi-generator/src/main/resources/python", - "additionalProperties": { - "packageName": "petstore_api" - } -} \ No newline at end of file diff --git a/bin/ci/openapi3-ruby-client-faraday-petstore.json b/bin/ci/openapi3-ruby-client-faraday-petstore.json deleted file mode 100644 index be0b61db9907..000000000000 --- a/bin/ci/openapi3-ruby-client-faraday-petstore.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "!include": "bin/openapi3/ruby-petstore-faraday.json", - "generatorName": "ruby", - "inputSpec": "modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/openapi3/client/petstore/ruby-faraday", - "templateDir": "modules/openapi-generator/src/main/resources/ruby-client", - "additionalProperties": { - "skipFormModel": true - } -} \ No newline at end of file diff --git a/bin/ci/openapi3-ruby-client-petstore.json b/bin/ci/openapi3-ruby-client-petstore.json deleted file mode 100644 index 91018e54a491..000000000000 --- a/bin/ci/openapi3-ruby-client-petstore.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "!include": "bin/ruby-petstore.json", - "generatorName": "ruby", - "inputSpec": "modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/openapi3/client/petstore/ruby", - "templateDir": "modules/openapi-generator/src/main/resources/ruby-client", - "additionalProperties": { - "skipFormModel": true - } -} \ No newline at end of file diff --git a/bin/ci/perl-petstore-1.json b/bin/ci/perl-petstore-1.json deleted file mode 100644 index 985f6b3bd1e7..000000000000 --- a/bin/ci/perl-petstore-1.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "generatorName": "perl", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/client/petstore/perl/deep_module_test", - "outputDir": "samples/client/petstore/perl/deep_module_test", - "additionalProperties": { - "hideGenerationTimestamp": true, - "moduleName": "Something::Deep" - } -} \ No newline at end of file diff --git a/bin/ci/perl-petstore.json b/bin/ci/perl-petstore.json deleted file mode 100644 index d726e633bd16..000000000000 --- a/bin/ci/perl-petstore.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "generatorName": "perl", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/client/petstore/perl", - "additionalProperties": { - "hideGenerationTimestamp": true - } -} \ No newline at end of file diff --git a/bin/ci/php-lumen-petstore-server.json b/bin/ci/php-lumen-petstore-server.json deleted file mode 100644 index 87755152ea4e..000000000000 --- a/bin/ci/php-lumen-petstore-server.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "generatorName": "php-lumen", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/server/petstore/php-lumen", - "templateDir": "modules/openapi-generator/src/main/resources/php-lumen" -} \ No newline at end of file diff --git a/bin/ci/php-petstore.json b/bin/ci/php-petstore.json deleted file mode 100644 index fd3f1d1c2451..000000000000 --- a/bin/ci/php-petstore.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "generatorName": "php", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/client/petstore/php/OpenAPIClient-php", - "templateDir": "modules/openapi-generator/src/main/resources/php" -} \ No newline at end of file diff --git a/bin/ci/php-silex-petstore-server.json b/bin/ci/php-silex-petstore-server.json deleted file mode 100644 index cffd6a8ceffc..000000000000 --- a/bin/ci/php-silex-petstore-server.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "generatorName": "php-silex-deprecated", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/server/petstore/php-silex/OpenAPIServer", - "templateDir": "modules/openapi-generator/src/main/resources/php-silex" -} \ No newline at end of file diff --git a/bin/ci/php-slim-server-petstore.json b/bin/ci/php-slim-server-petstore.json deleted file mode 100644 index 4341586b3306..000000000000 --- a/bin/ci/php-slim-server-petstore.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "generatorName": "php-slim-deprecated", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/server/petstore/php-slim", - "templateDir": "modules/openapi-generator/src/main/resources/php-slim-server" -} \ No newline at end of file diff --git a/bin/ci/php-slim4-server-petstore.json b/bin/ci/php-slim4-server-petstore.json deleted file mode 100644 index 48de8dd691d0..000000000000 --- a/bin/ci/php-slim4-server-petstore.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "generatorName": "php-slim4", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/server/petstore/php-slim4", - "templateDir": "modules/openapi-generator/src/main/resources/php-slim4-server" -} \ No newline at end of file diff --git a/bin/ci/php-symfony-petstore.json b/bin/ci/php-symfony-petstore.json deleted file mode 100644 index 8af199acbc56..000000000000 --- a/bin/ci/php-symfony-petstore.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "generatorName": "php-symfony", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/server/petstore/php-symfony/SymfonyBundle-php", - "templateDir": "modules/openapi-generator/src/main/resources/php-symfony" -} \ No newline at end of file diff --git a/bin/ci/php-ze-ph-petstore-server.json b/bin/ci/php-ze-ph-petstore-server.json deleted file mode 100644 index 2f02c99e22f8..000000000000 --- a/bin/ci/php-ze-ph-petstore-server.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "generatorName": "php-ze-ph", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/server/petstore/php-ze-ph", - "templateDir": "modules/openapi-generator/src/main/resources/php-ze-ph" -} \ No newline at end of file diff --git a/bin/ci/python-experimental.json b/bin/ci/python-experimental.json deleted file mode 100644 index d9f6d70db226..000000000000 --- a/bin/ci/python-experimental.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "generatorName": "python-experimental", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/python-client-experimental/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/client/petstore/python-experimental", - "templateDir": "modules/openapi-generator/src/main/resources/python", - "additionalProperties": { - "packageName": "petstore_api" - } -} \ No newline at end of file diff --git a/bin/ci/python-petstore-1.json b/bin/ci/python-petstore-1.json deleted file mode 100644 index 730545175cd2..000000000000 --- a/bin/ci/python-petstore-1.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "generatorName": "python", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/client/petstore/python", - "templateDir": "modules/openapi-generator/src/main/resources/python", - "additionalProperties": { - "packageName": "petstore_api" - } -} \ No newline at end of file diff --git a/bin/ci/python-petstore-2.json b/bin/ci/python-petstore-2.json deleted file mode 100644 index 1a48b15b608e..000000000000 --- a/bin/ci/python-petstore-2.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "generatorName": "python", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "library": "tornado", - "outputDir": "samples/client/petstore/python-tornado", - "templateDir": "modules/openapi-generator/src/main/resources/python", - "additionalProperties": { - "packageName": "petstore_api" - } -} \ No newline at end of file diff --git a/bin/ci/python-petstore.json b/bin/ci/python-petstore.json deleted file mode 100644 index 5af62cb71eea..000000000000 --- a/bin/ci/python-petstore.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "generatorName": "python", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "library": "asyncio", - "outputDir": "samples/client/petstore/python-asyncio", - "templateDir": "modules/openapi-generator/src/main/resources/python", - "additionalProperties": { - "packageName": "petstore_api" - } -} \ No newline at end of file diff --git a/bin/ci/r-petstore.json b/bin/ci/r-petstore.json deleted file mode 100644 index 26889a24f9d9..000000000000 --- a/bin/ci/r-petstore.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "generatorName": "r", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/R", - "templateDir": "modules/openapi-generator/src/main/resources/r", - "additionalProperties": { - "packageName": "petstore" - } -} \ No newline at end of file diff --git a/bin/ci/ruby-client-petstore-faraday.json b/bin/ci/ruby-client-petstore-faraday.json deleted file mode 100644 index cc3a4a6993c8..000000000000 --- a/bin/ci/ruby-client-petstore-faraday.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "!include": "bin/ruby-petstore-faraday.json", - "generatorName": "ruby", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/client/petstore/ruby-faraday", - "templateDir": "modules/openapi-generator/src/main/resources/ruby-client" -} \ No newline at end of file diff --git a/bin/ci/ruby-client-petstore.json b/bin/ci/ruby-client-petstore.json deleted file mode 100644 index 409f07df1142..000000000000 --- a/bin/ci/ruby-client-petstore.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "!include": "bin/ruby-petstore.json", - "generatorName": "ruby", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/client/petstore/ruby", - "templateDir": "modules/openapi-generator/src/main/resources/ruby-client" -} \ No newline at end of file diff --git a/bin/ci/rust-server-petstore-1.json b/bin/ci/rust-server-petstore-1.json deleted file mode 100644 index 9094bb9072dc..000000000000 --- a/bin/ci/rust-server-petstore-1.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "generateAliasAsModel": true, - "generatorName": "rust-server", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/rust-server/rust-server-test.yaml", - "outputDir": "samples/server/petstore/rust-server/output/rust-server-test", - "templateDir": "modules/openapi-generator/src/main/resources/rust-server", - "additionalProperties": { - "packageName": "rust-server-test", - "hideGenerationTimestamp": true - } -} \ No newline at end of file diff --git a/bin/ci/rust-server-petstore-2.json b/bin/ci/rust-server-petstore-2.json deleted file mode 100644 index 1ddfe29dd995..000000000000 --- a/bin/ci/rust-server-petstore-2.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "generateAliasAsModel": true, - "generatorName": "rust-server", - "inputSpec": "modules/openapi-generator/src/test/resources/3_0/rust-server/multipart-v3.yaml", - "outputDir": "samples/server/petstore/rust-server/output/multipart-v3", - "templateDir": "modules/openapi-generator/src/main/resources/rust-server", - "additionalProperties": { - "packageName": "multipart-v3", - "hideGenerationTimestamp": true - } -} \ No newline at end of file diff --git a/bin/ci/rust-server-petstore-3.json b/bin/ci/rust-server-petstore-3.json deleted file mode 100644 index 7291e9c73df5..000000000000 --- a/bin/ci/rust-server-petstore-3.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "generateAliasAsModel": true, - "generatorName": "rust-server", - "inputSpec": "modules/openapi-generator/src/test/resources/3_0/rust-server/openapi-v3.yaml", - "outputDir": "samples/server/petstore/rust-server/output/openapi-v3", - "templateDir": "modules/openapi-generator/src/main/resources/rust-server", - "additionalProperties": { - "packageName": "openapi-v3", - "hideGenerationTimestamp": true - } -} \ No newline at end of file diff --git a/bin/ci/rust-server-petstore-4.json b/bin/ci/rust-server-petstore-4.json deleted file mode 100644 index 0e85d34e8e36..000000000000 --- a/bin/ci/rust-server-petstore-4.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "generateAliasAsModel": true, - "generatorName": "rust-server", - "inputSpec": "modules/openapi-generator/src/test/resources/3_0/rust-server/ops-v3.yaml", - "outputDir": "samples/server/petstore/rust-server/output/ops-v3", - "templateDir": "modules/openapi-generator/src/main/resources/rust-server", - "additionalProperties": { - "packageName": "ops-v3", - "hideGenerationTimestamp": true - } -} \ No newline at end of file diff --git a/bin/ci/rust-server-petstore.json b/bin/ci/rust-server-petstore.json deleted file mode 100644 index e258a0600836..000000000000 --- a/bin/ci/rust-server-petstore.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "generateAliasAsModel": true, - "generatorName": "rust-server", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/rust-server/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing", - "templateDir": "modules/openapi-generator/src/main/resources/rust-server", - "additionalProperties": { - "packageName": "petstore-with-fake-endpoints-models-for-testing", - "hideGenerationTimestamp": true - } -} \ No newline at end of file diff --git a/bin/ci/spring-cloud-async.json b/bin/ci/spring-cloud-async.json deleted file mode 100644 index 85895219352d..000000000000 --- a/bin/ci/spring-cloud-async.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "!include": "bin/spring-cloud-feign-petstore.json", - "generatorName": "spring", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/spring-cloud-async", - "templateDir": "modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud", - "additionalProperties": { - "hideGenerationTimestamp": true, - "java8": true, - "async": true - } -} \ No newline at end of file diff --git a/bin/ci/spring-cloud-feign-petstore.json b/bin/ci/spring-cloud-feign-petstore.json deleted file mode 100644 index b402ba8c0042..000000000000 --- a/bin/ci/spring-cloud-feign-petstore.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "!include": "bin/spring-cloud-feign-petstore.json", - "generatorName": "spring", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/spring-cloud", - "templateDir": "modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud", - "additionalProperties": { - "hideGenerationTimestamp": true, - "responseWrapper": "HystrixCommand" - } -} \ No newline at end of file diff --git a/bin/ci/spring-petstore-10.json b/bin/ci/spring-petstore-10.json deleted file mode 100644 index ba76388c1bbd..000000000000 --- a/bin/ci/spring-petstore-10.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "!include": "bin/springboot-petstore-server-beanvalidation.json", - "generatorName": "spring", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/server/petstore/springboot-beanvalidation", - "templateDir": "modules/openapi-generator/src/main/resources/JavaSpring", - "additionalProperties": { - "hideGenerationTimestamp": true, - "java8": false - } -} \ No newline at end of file diff --git a/bin/ci/spring-petstore-11.json b/bin/ci/spring-petstore-11.json deleted file mode 100644 index 6f2efc55293d..000000000000 --- a/bin/ci/spring-petstore-11.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "!include": "bin/springboot-petstore-server-implicitHeaders.json", - "artifactId": "springboot-implicitHeaders", - "generatorName": "spring", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/server/petstore/springboot-implicitHeaders", - "templateDir": "modules/openapi-generator/src/main/resources/JavaSpring", - "additionalProperties": { - "hideGenerationTimestamp": true - } -} \ No newline at end of file diff --git a/bin/ci/spring-petstore-12.json b/bin/ci/spring-petstore-12.json deleted file mode 100644 index cab75e7ae332..000000000000 --- a/bin/ci/spring-petstore-12.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "!include": "bin/springboot-petstore-server-useOptional.json", - "generatorName": "spring", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/server/petstore/springboot-useoptional", - "templateDir": "modules/openapi-generator/src/main/resources/JavaSpring", - "additionalProperties": { - "hideGenerationTimestamp": true - } -} \ No newline at end of file diff --git a/bin/ci/spring-petstore-13.json b/bin/ci/spring-petstore-13.json deleted file mode 100644 index 375efe85a770..000000000000 --- a/bin/ci/spring-petstore-13.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "!include": "bin/springboot-virtualan-petstore-server.json", - "artifactId": "springboot-virtualan", - "generatorName": "spring", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/server/petstore/springboot-virtualan", - "templateDir": "modules/openapi-generator/src/main/resources/JavaSpring", - "additionalProperties": { - "hideGenerationTimestamp": true - } -} \ No newline at end of file diff --git a/bin/ci/spring-petstore-2.json b/bin/ci/spring-petstore-2.json deleted file mode 100644 index ba551398854e..000000000000 --- a/bin/ci/spring-petstore-2.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "artifactId": "spring-stubs", - "generatorName": "spring", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/spring-stubs", - "additionalProperties": { - "interfaceOnly": true, - "singleContentTypes": true, - "hideGenerationTimestamp": true - } -} \ No newline at end of file diff --git a/bin/ci/spring-petstore-3.json b/bin/ci/spring-petstore-3.json deleted file mode 100644 index 36ee23c72b75..000000000000 --- a/bin/ci/spring-petstore-3.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "!include": "bin/spring-mvc-petstore-server.json", - "generatorName": "spring", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/server/petstore/spring-mvc", - "templateDir": "modules/openapi-generator/src/main/resources/JavaSpring", - "additionalProperties": { - "hideGenerationTimestamp": true, - "java8": false, - "serverPort": "8002", - "booleanGetterPrefix": "get" - } -} \ No newline at end of file diff --git a/bin/ci/spring-petstore-4.json b/bin/ci/spring-petstore-4.json deleted file mode 100644 index 5b9f3b774adf..000000000000 --- a/bin/ci/spring-petstore-4.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "!include": "bin/spring-mvc-petstore-j8-async.json", - "generatorName": "spring", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/server/petstore/spring-mvc-j8-async", - "templateDir": "modules/openapi-generator/src/main/resources/JavaSpring", - "additionalProperties": { - "hideGenerationTimestamp": true, - "async": true, - "serverPort": "8002" - } -} \ No newline at end of file diff --git a/bin/ci/spring-petstore-5.json b/bin/ci/spring-petstore-5.json deleted file mode 100644 index 9978d15d09da..000000000000 --- a/bin/ci/spring-petstore-5.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "!include": "bin/spring-mvc-petstore-j8-localdatetime.json", - "generatorName": "spring", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/server/petstore/spring-mvc-j8-localdatetime", - "templateDir": "modules/openapi-generator/src/main/resources/JavaSpring", - "additionalProperties": { - "hideGenerationTimestamp": true, - "booleanGetterPrefix": "get", - "serverPort": "8002" - } -} \ No newline at end of file diff --git a/bin/ci/spring-petstore-6.json b/bin/ci/spring-petstore-6.json deleted file mode 100644 index 4a5aed031f52..000000000000 --- a/bin/ci/spring-petstore-6.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "artifactId": "springboot-delegate", - "generatorName": "spring", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/server/petstore/springboot-delegate", - "templateDir": "modules/openapi-generator/src/main/resources/JavaSpring", - "additionalProperties": { - "delegatePattern": true, - "hideGenerationTimestamp": true, - "java8": false - } -} \ No newline at end of file diff --git a/bin/ci/spring-petstore-7.json b/bin/ci/spring-petstore-7.json deleted file mode 100644 index 7863b8d9d7ad..000000000000 --- a/bin/ci/spring-petstore-7.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "artifactId": "springboot-delegate-j8", - "generatorName": "spring", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/server/petstore/springboot-delegate-j8", - "templateDir": "modules/openapi-generator/src/main/resources/JavaSpring", - "additionalProperties": { - "delegatePattern": true, - "hideGenerationTimestamp": true - } -} \ No newline at end of file diff --git a/bin/ci/spring-petstore-8.json b/bin/ci/spring-petstore-8.json deleted file mode 100644 index 840e4fa8c4ad..000000000000 --- a/bin/ci/spring-petstore-8.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "artifactId": "springboot", - "generatorName": "spring", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/server/petstore/springboot", - "templateDir": "modules/openapi-generator/src/main/resources/JavaSpring", - "additionalProperties": { - "hideGenerationTimestamp": true, - "snapshotVersion": true - } -} \ No newline at end of file diff --git a/bin/ci/spring-petstore-9.json b/bin/ci/spring-petstore-9.json deleted file mode 100644 index 1955fd579453..000000000000 --- a/bin/ci/spring-petstore-9.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "artifactId": "springboot-reactive", - "generatorName": "spring", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", - "outputDir": "samples/server/petstore/springboot-reactive", - "templateDir": "modules/openapi-generator/src/main/resources/JavaSpring", - "additionalProperties": { - "reactive": true, - "delegatePattern": true, - "hideGenerationTimestamp": true - } -} \ No newline at end of file diff --git a/bin/ci/spring-stubs.json b/bin/ci/spring-stubs.json deleted file mode 100644 index 583fed6e2571..000000000000 --- a/bin/ci/spring-stubs.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "generatorName": "spring", - "artifactId": "spring-stubs", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/spring-stubs", - "additionalProperties": { - "interfaceOnly": true, - "singleContentTypes": true, - "hideGenerationTimestamp": true - } -} \ No newline at end of file diff --git a/bin/ci/typescript-angular-petstore-1.json b/bin/ci/typescript-angular-petstore-1.json deleted file mode 100644 index a82cb8c0487c..000000000000 --- a/bin/ci/typescript-angular-petstore-1.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "!include": "bin/typescript-petstore-npm.json", - "generatorName": "typescript-angular", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/typescript-angular-v2/npm", - "additionalProperties": { - "ngVersion": "2" - } -} \ No newline at end of file diff --git a/bin/ci/typescript-angular-petstore-10.json b/bin/ci/typescript-angular-petstore-10.json deleted file mode 100644 index 0bbd411378ba..000000000000 --- a/bin/ci/typescript-angular-petstore-10.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "!include": "bin/typescript-angular-v7-petstore-not-provided-in-root-with-npm.json", - "generatorName": "typescript-angular", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm", - "additionalProperties": { - "ngVersion": "7.0.0", - "providedInRoot": false - } -} \ No newline at end of file diff --git a/bin/ci/typescript-angular-petstore-11.json b/bin/ci/typescript-angular-petstore-11.json deleted file mode 100644 index 8f62c2a7f0ab..000000000000 --- a/bin/ci/typescript-angular-petstore-11.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "generatorName": "typescript-angular", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default", - "additionalProperties": { - "ngVersion": "7.0.0" - } -} \ No newline at end of file diff --git a/bin/ci/typescript-angular-petstore-12.json b/bin/ci/typescript-angular-petstore-12.json deleted file mode 100644 index 3a7f64093941..000000000000 --- a/bin/ci/typescript-angular-petstore-12.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "!include": "bin/typescript-angular-v7-petstore-provided-in-root-with-npm.json", - "generatorName": "typescript-angular", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm", - "additionalProperties": { - "ngVersion": "7.0.0" - } -} \ No newline at end of file diff --git a/bin/ci/typescript-angular-petstore-13.json b/bin/ci/typescript-angular-petstore-13.json deleted file mode 100644 index 1fa9f8a20d66..000000000000 --- a/bin/ci/typescript-angular-petstore-13.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "!include": "bin/typescript-angular-v8-petstore-provided-in-root-with-npm.json", - "generatorName": "typescript-angular", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm", - "additionalProperties": { - "ngVersion": "8.0.0" - } -} \ No newline at end of file diff --git a/bin/ci/typescript-angular-petstore-2.json b/bin/ci/typescript-angular-petstore-2.json deleted file mode 100644 index 2e79f71fa8ce..000000000000 --- a/bin/ci/typescript-angular-petstore-2.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "generatorName": "typescript-angular", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/typescript-angular-v2/with-interfaces", - "additionalProperties": { - "ngVersion": "2", - "withInterfaces": true - } -} \ No newline at end of file diff --git a/bin/ci/typescript-angular-petstore-3.json b/bin/ci/typescript-angular-petstore-3.json deleted file mode 100644 index 3b343648d95d..000000000000 --- a/bin/ci/typescript-angular-petstore-3.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "!include": "bin/typescript-petstore-npm.json", - "generatorName": "typescript-angular", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/typescript-angular-v4/npm", - "additionalProperties": { - "ngVersion": "4" - } -} \ No newline at end of file diff --git a/bin/ci/typescript-angular-petstore-4.json b/bin/ci/typescript-angular-petstore-4.json deleted file mode 100644 index ffd19d1656e0..000000000000 --- a/bin/ci/typescript-angular-petstore-4.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "!include": "bin/typescript-petstore-npm.json", - "generatorName": "typescript-angular", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/typescript-angular-v4.3/npm", - "additionalProperties": { - "ngVersion": "4.3" - } -} \ No newline at end of file diff --git a/bin/ci/typescript-angular-petstore-5.json b/bin/ci/typescript-angular-petstore-5.json deleted file mode 100644 index 44c7e1fe13ab..000000000000 --- a/bin/ci/typescript-angular-petstore-5.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "generatorName": "typescript-angular", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default", - "additionalProperties": { - "ngVersion": "6.0.0", - "providedInRoot": false - } -} \ No newline at end of file diff --git a/bin/ci/typescript-angular-petstore-6.json b/bin/ci/typescript-angular-petstore-6.json deleted file mode 100644 index 5965a2e92f46..000000000000 --- a/bin/ci/typescript-angular-petstore-6.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "!include": "bin/typescript-angular-v6-petstore-not-provided-in-root-with-npm.json", - "generatorName": "typescript-angular", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm", - "additionalProperties": { - "ngVersion": "6.0.0", - "providedInRoot": false - } -} \ No newline at end of file diff --git a/bin/ci/typescript-angular-petstore-7.json b/bin/ci/typescript-angular-petstore-7.json deleted file mode 100644 index 638a3464efcc..000000000000 --- a/bin/ci/typescript-angular-petstore-7.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "generatorName": "typescript-angular", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default", - "additionalProperties": { - "ngVersion": "6.0.0" - } -} \ No newline at end of file diff --git a/bin/ci/typescript-angular-petstore-8.json b/bin/ci/typescript-angular-petstore-8.json deleted file mode 100644 index 9bf237a3b387..000000000000 --- a/bin/ci/typescript-angular-petstore-8.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "!include": "bin/typescript-angular-v6-petstore-provided-in-root-with-npm.json", - "generatorName": "typescript-angular", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm", - "additionalProperties": { - "ngVersion": "6.0.0" - } -} \ No newline at end of file diff --git a/bin/ci/typescript-angular-petstore-9.json b/bin/ci/typescript-angular-petstore-9.json deleted file mode 100644 index 0d672e6f09d2..000000000000 --- a/bin/ci/typescript-angular-petstore-9.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "generatorName": "typescript-angular", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default", - "additionalProperties": { - "ngVersion": "7.0.0", - "providedInRoot": false - } -} \ No newline at end of file diff --git a/bin/ci/typescript-angular-petstore.json b/bin/ci/typescript-angular-petstore.json deleted file mode 100644 index f086745732f8..000000000000 --- a/bin/ci/typescript-angular-petstore.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "generatorName": "typescript-angular", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/typescript-angular-v2/default", - "additionalProperties": { - "ngVersion": "2" - } -} \ No newline at end of file diff --git a/bin/ci/typescript-angularjs-petstore.json b/bin/ci/typescript-angularjs-petstore.json deleted file mode 100644 index 2f7f66827222..000000000000 --- a/bin/ci/typescript-angularjs-petstore.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "generatorName": "typescript-angularjs", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/typescript-angularjs" -} \ No newline at end of file diff --git a/bin/ci/typescript-aurelia-petstore.json b/bin/ci/typescript-aurelia-petstore.json deleted file mode 100644 index 24229cbdf71b..000000000000 --- a/bin/ci/typescript-aurelia-petstore.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "generatorName": "typescript-aurelia", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/typescript-aurelia/default" -} \ No newline at end of file diff --git a/bin/ci/typescript-axios-petstore-1.json b/bin/ci/typescript-axios-petstore-1.json deleted file mode 100644 index 5b63412ae852..000000000000 --- a/bin/ci/typescript-axios-petstore-1.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "!include": "bin/typescript-axios-petstore-with-npm-version.json", - "generatorName": "typescript-axios", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/typescript-axios/builds/with-npm-version" -} \ No newline at end of file diff --git a/bin/ci/typescript-axios-petstore-2.json b/bin/ci/typescript-axios-petstore-2.json deleted file mode 100644 index 3f8539dcae98..000000000000 --- a/bin/ci/typescript-axios-petstore-2.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "!include": "bin/typescript-axios-petstore-with-npm-version-and-separate-models-and-api.json", - "generatorName": "typescript-axios", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api" -} \ No newline at end of file diff --git a/bin/ci/typescript-axios-petstore-3.json b/bin/ci/typescript-axios-petstore-3.json deleted file mode 100644 index 0f25f11b31be..000000000000 --- a/bin/ci/typescript-axios-petstore-3.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "generatorName": "typescript-axios", - "inputSpec": "modules/openapi-generator/src/test/resources/3_0/petstore-with-complex-headers.yaml", - "outputDir": "samples/client/petstore/typescript-axios/builds/with-complex-headers" -} \ No newline at end of file diff --git a/bin/ci/typescript-axios-petstore-4.json b/bin/ci/typescript-axios-petstore-4.json deleted file mode 100644 index d552953c5853..000000000000 --- a/bin/ci/typescript-axios-petstore-4.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "generatorName": "typescript-axios", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/typescript-axios/builds/with-interfaces", - "additionalProperties": { - "withInterfaces": true - } -} \ No newline at end of file diff --git a/bin/ci/typescript-axios-petstore-5.json b/bin/ci/typescript-axios-petstore-5.json deleted file mode 100644 index f8d998f1c98e..000000000000 --- a/bin/ci/typescript-axios-petstore-5.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "generatorName": "typescript-axios", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/typescript-axios/builds/default" -} \ No newline at end of file diff --git a/bin/ci/typescript-axios-petstore.json b/bin/ci/typescript-axios-petstore.json deleted file mode 100644 index bb49285bb14a..000000000000 --- a/bin/ci/typescript-axios-petstore.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "!include": "bin/typescript-axios-petstore-target-es6.json", - "generatorName": "typescript-axios", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/typescript-axios/builds/es6-target" -} \ No newline at end of file diff --git a/bin/ci/typescript-fetch-petstore-1.json b/bin/ci/typescript-fetch-petstore-1.json deleted file mode 100644 index 40abb9ef245f..000000000000 --- a/bin/ci/typescript-fetch-petstore-1.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "!include": "bin/typescript-fetch-petstore-with-npm-version.json", - "generatorName": "typescript-fetch", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/typescript-fetch/builds/with-npm-version" -} \ No newline at end of file diff --git a/bin/ci/typescript-fetch-petstore-2.json b/bin/ci/typescript-fetch-petstore-2.json deleted file mode 100644 index bc6e5f807cb1..000000000000 --- a/bin/ci/typescript-fetch-petstore-2.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "generatorName": "typescript-fetch", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/typescript-fetch/builds/with-interfaces", - "additionalProperties": { - "withInterfaces": true - } -} \ No newline at end of file diff --git a/bin/ci/typescript-fetch-petstore-3.json b/bin/ci/typescript-fetch-petstore-3.json deleted file mode 100644 index 0de17df51b82..000000000000 --- a/bin/ci/typescript-fetch-petstore-3.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "generatorName": "typescript-fetch", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/typescript-fetch/builds/default" -} \ No newline at end of file diff --git a/bin/ci/typescript-fetch-petstore-4.json b/bin/ci/typescript-fetch-petstore-4.json deleted file mode 100644 index 1f434a030682..000000000000 --- a/bin/ci/typescript-fetch-petstore-4.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "!include": "bin/typescript-fetch-petstore-multiple-parameters.json", - "generatorName": "typescript-fetch", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/typescript-fetch/builds/multiple-parameters" -} \ No newline at end of file diff --git a/bin/ci/typescript-fetch-petstore-5.json b/bin/ci/typescript-fetch-petstore-5.json deleted file mode 100644 index 2905e73da849..000000000000 --- a/bin/ci/typescript-fetch-petstore-5.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "!include": "bin/typescript-fetch-petstore-prefix-parameter-interfaces.json", - "generatorName": "typescript-fetch", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces" -} \ No newline at end of file diff --git a/bin/ci/typescript-fetch-petstore.json b/bin/ci/typescript-fetch-petstore.json deleted file mode 100644 index 1f5fcf5f4b33..000000000000 --- a/bin/ci/typescript-fetch-petstore.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "!include": "bin/typescript-fetch-petstore-target-es6.json", - "generatorName": "typescript-fetch", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/typescript-fetch/builds/es6-target" -} \ No newline at end of file diff --git a/bin/ci/typescript-inversify-petstore.json b/bin/ci/typescript-inversify-petstore.json deleted file mode 100644 index 8a15c316d30a..000000000000 --- a/bin/ci/typescript-inversify-petstore.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "generatorName": "typescript-inversify", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/typescript-inversify" -} \ No newline at end of file diff --git a/bin/ci/typescript-jquery-petstore-1.json b/bin/ci/typescript-jquery-petstore-1.json deleted file mode 100644 index 6c0fac1642ad..000000000000 --- a/bin/ci/typescript-jquery-petstore-1.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "!include": "bin/typescript-jquery-petstore-npm.json", - "generatorName": "typescript-jquery", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/typescript-jquery/npm" -} \ No newline at end of file diff --git a/bin/ci/typescript-jquery-petstore.json b/bin/ci/typescript-jquery-petstore.json deleted file mode 100644 index ea83a6088dfb..000000000000 --- a/bin/ci/typescript-jquery-petstore.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "generatorName": "typescript-jquery", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/typescript-jquery/default" -} \ No newline at end of file diff --git a/bin/ci/typescript-node-petstore-1.json b/bin/ci/typescript-node-petstore-1.json deleted file mode 100644 index 2610ca3ee17d..000000000000 --- a/bin/ci/typescript-node-petstore-1.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "generatorName": "typescript-node", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/typescript-node/default" -} \ No newline at end of file diff --git a/bin/ci/typescript-node-petstore.json b/bin/ci/typescript-node-petstore.json deleted file mode 100644 index 99911c472be1..000000000000 --- a/bin/ci/typescript-node-petstore.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "!include": "bin/typescript-node-petstore-npm.json", - "generatorName": "typescript-node", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/typescript-node/npm" -} \ No newline at end of file diff --git a/bin/ci/typescript-rxjs-petstore-1.json b/bin/ci/typescript-rxjs-petstore-1.json deleted file mode 100644 index 1686f9f00cd6..000000000000 --- a/bin/ci/typescript-rxjs-petstore-1.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "!include": "bin/typescript-rxjs-petstore-with-npm-version.json", - "generatorName": "typescript-rxjs", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/typescript-rxjs/builds/with-npm-version" -} \ No newline at end of file diff --git a/bin/ci/typescript-rxjs-petstore-2.json b/bin/ci/typescript-rxjs-petstore-2.json deleted file mode 100644 index 00e8f66a4943..000000000000 --- a/bin/ci/typescript-rxjs-petstore-2.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "generatorName": "typescript-rxjs", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/typescript-rxjs/builds/with-interfaces", - "additionalProperties": { - "withInterfaces": true - } -} \ No newline at end of file diff --git a/bin/ci/typescript-rxjs-petstore-3.json b/bin/ci/typescript-rxjs-petstore-3.json deleted file mode 100644 index 7ee3fc8b247a..000000000000 --- a/bin/ci/typescript-rxjs-petstore-3.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "generatorName": "typescript-rxjs", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/typescript-rxjs/builds/default" -} \ No newline at end of file diff --git a/bin/ci/typescript-rxjs-petstore.json b/bin/ci/typescript-rxjs-petstore.json deleted file mode 100644 index e5d9f0ec87b0..000000000000 --- a/bin/ci/typescript-rxjs-petstore.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "!include": "bin/typescript-rxjs-petstore-target-es6.json", - "generatorName": "typescript-rxjs", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/typescript-rxjs/builds/es6-target" -} \ No newline at end of file diff --git a/bin/clojure-petstore.sh b/bin/clojure-petstore.sh deleted file mode 100755 index 299882e5ae45..000000000000 --- a/bin/clojure-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.json -g clojure -o samples/client/petstore/clojure $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/configs/apex.yaml b/bin/configs/apex.yaml new file mode 100644 index 000000000000..23ec0ef743ea --- /dev/null +++ b/bin/configs/apex.yaml @@ -0,0 +1,6 @@ +systemProperties: + skipFormModel: "true" +generatorName: apex +outputDir: samples/client/petstore/apex +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/apex diff --git a/bin/configs/cpp-qt5-qhttpengine-server.yaml b/bin/configs/cpp-qt5-qhttpengine-server.yaml new file mode 100644 index 000000000000..8ead0fe398de --- /dev/null +++ b/bin/configs/cpp-qt5-qhttpengine-server.yaml @@ -0,0 +1,4 @@ +generatorName: cpp-qt5-qhttpengine-server +outputDir: samples/server/petstore/cpp-qt5-qhttpengine-server +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server diff --git a/bin/configs/cpp-restsdk-client.yaml b/bin/configs/cpp-restsdk-client.yaml new file mode 100644 index 000000000000..87bce881bbd4 --- /dev/null +++ b/bin/configs/cpp-restsdk-client.yaml @@ -0,0 +1,4 @@ +generatorName: cpp-restsdk +outputDir: samples/client/petstore/cpp-restsdk/client +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/cpp-rest-sdk-client diff --git a/bin/configs/csharp-OpenAPIClient.yaml b/bin/configs/csharp-OpenAPIClient.yaml new file mode 100644 index 000000000000..64800f8f78c5 --- /dev/null +++ b/bin/configs/csharp-OpenAPIClient.yaml @@ -0,0 +1,5 @@ +generatorName: csharp +outputDir: samples/client/petstore/csharp/OpenAPIClient +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +additionalProperties: + packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' diff --git a/bin/configs/csharp-netcore-OpenAPIClient.yaml b/bin/configs/csharp-netcore-OpenAPIClient.yaml new file mode 100644 index 000000000000..0f2daf28a283 --- /dev/null +++ b/bin/configs/csharp-netcore-OpenAPIClient.yaml @@ -0,0 +1,7 @@ +generatorName: csharp-netcore +outputDir: samples/client/petstore/csharp-netcore/OpenAPIClient +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/csharp-netcore +additionalProperties: + packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' + useCompareNetObjects: "true" diff --git a/bin/configs/csharp-netcore-OpenAPIClientCore.yaml b/bin/configs/csharp-netcore-OpenAPIClientCore.yaml new file mode 100644 index 000000000000..1d710bbf20c9 --- /dev/null +++ b/bin/configs/csharp-netcore-OpenAPIClientCore.yaml @@ -0,0 +1,8 @@ +generatorName: csharp-netcore +outputDir: samples/client/petstore/csharp-netcore/OpenAPIClientCore +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/csharp-netcore +additionalProperties: + packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' + targetFramework: netcoreapp2.0 + useCompareNetObjects: "true" diff --git a/bin/configs/dart-jaguar-openapi-flutter.yaml b/bin/configs/dart-jaguar-openapi-flutter.yaml new file mode 100644 index 000000000000..caa3df92d32c --- /dev/null +++ b/bin/configs/dart-jaguar-openapi-flutter.yaml @@ -0,0 +1,7 @@ +generatorName: dart-jaguar +outputDir: samples/client/petstore/dart-jaguar/flutter_petstore/openapi +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/dart-jaguar +additionalProperties: + pubName: openapi + hideGenerationTimestamp: "true" diff --git a/bin/configs/dart-jaguar-openapi-flutter_proto.yaml b/bin/configs/dart-jaguar-openapi-flutter_proto.yaml new file mode 100644 index 000000000000..6b94b64109d3 --- /dev/null +++ b/bin/configs/dart-jaguar-openapi-flutter_proto.yaml @@ -0,0 +1,8 @@ +generatorName: dart-jaguar +outputDir: samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-proto.yaml +templateDir: modules/openapi-generator/src/main/resources/dart-jaguar +additionalProperties: + serialization: proto + pubName: openapi + hideGenerationTimestamp: "true" diff --git a/bin/configs/dart-jaguar-openapi.yaml b/bin/configs/dart-jaguar-openapi.yaml new file mode 100644 index 000000000000..effa1bf3761f --- /dev/null +++ b/bin/configs/dart-jaguar-openapi.yaml @@ -0,0 +1,7 @@ +generatorName: dart-jaguar +outputDir: samples/client/petstore/dart-jaguar/openapi +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/dart-jaguar +additionalProperties: + hideGenerationTimestamp: "true" + pubName: openapi diff --git a/bin/configs/dart-jaguar-openapi_proto.yaml b/bin/configs/dart-jaguar-openapi_proto.yaml new file mode 100644 index 000000000000..1229c190d29a --- /dev/null +++ b/bin/configs/dart-jaguar-openapi_proto.yaml @@ -0,0 +1,8 @@ +generatorName: dart-jaguar +outputDir: samples/client/petstore/dart-jaguar/openapi_proto +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-proto.yaml +templateDir: modules/openapi-generator/src/main/resources/dart-jaguar +additionalProperties: + serialization: proto + pubName: openapi + hideGenerationTimestamp: "true" diff --git a/bin/configs/dart-openapi-browser-client.yaml b/bin/configs/dart-openapi-browser-client.yaml new file mode 100644 index 000000000000..4d3084d6c885 --- /dev/null +++ b/bin/configs/dart-openapi-browser-client.yaml @@ -0,0 +1,8 @@ +generatorName: dart +outputDir: samples/client/petstore/dart/openapi-browser-client +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/dart +additionalProperties: + supportDart2: "false" + hideGenerationTimestamp: "true" + browserClient: "true" diff --git a/bin/configs/dart-openapi-flutter.yaml b/bin/configs/dart-openapi-flutter.yaml new file mode 100644 index 000000000000..fe130413bb90 --- /dev/null +++ b/bin/configs/dart-openapi-flutter.yaml @@ -0,0 +1,8 @@ +generatorName: dart +outputDir: samples/client/petstore/dart/flutter_petstore/openapi +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/dart +additionalProperties: + supportDart2: "false" + hideGenerationTimestamp: "true" + browserClient: "false" diff --git a/bin/configs/dart-openapi.yaml b/bin/configs/dart-openapi.yaml new file mode 100644 index 000000000000..67ee5ca688d2 --- /dev/null +++ b/bin/configs/dart-openapi.yaml @@ -0,0 +1,8 @@ +generatorName: dart +outputDir: samples/client/petstore/dart/openapi +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/dart +additionalProperties: + supportDart2: "false" + hideGenerationTimestamp: "true" + browserClient: "false" diff --git a/bin/configs/dart-petstore_client_lib.yaml b/bin/configs/dart-petstore_client_lib.yaml new file mode 100644 index 000000000000..861a829ac4f4 --- /dev/null +++ b/bin/configs/dart-petstore_client_lib.yaml @@ -0,0 +1,6 @@ +generatorName: dart +outputDir: samples/client/petstore/dart2/petstore_client_lib +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/dart2 +additionalProperties: + hideGenerationTimestamp: "true" diff --git a/bin/configs/elixir.yaml b/bin/configs/elixir.yaml new file mode 100644 index 000000000000..6507adae5fce --- /dev/null +++ b/bin/configs/elixir.yaml @@ -0,0 +1,6 @@ +generatorName: elixir +outputDir: samples/client/petstore/elixir +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/elixir +additionalProperties: + invokerPackage: OpenapiPetstore diff --git a/bin/configs/elm.yaml b/bin/configs/elm.yaml new file mode 100644 index 000000000000..b826d487ddde --- /dev/null +++ b/bin/configs/elm.yaml @@ -0,0 +1,4 @@ +generatorName: elm +outputDir: samples/openapi3/client/elm +inputSpec: modules/openapi-generator/src/test/resources/3_0/elm.yaml +templateDir: modules/openapi-generator/src/main/resources/elm diff --git a/bin/configs/go-experimental-go-petstore-oas2.yaml b/bin/configs/go-experimental-go-petstore-oas2.yaml new file mode 100644 index 000000000000..64c6bfbebc3b --- /dev/null +++ b/bin/configs/go-experimental-go-petstore-oas2.yaml @@ -0,0 +1,6 @@ +generatorName: go-experimental +outputDir: samples/client/petstore/go-experimental/go-petstore +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/go-experimental +additionalProperties: + packageName: petstore diff --git a/bin/configs/go-experimental-go-petstore.yaml b/bin/configs/go-experimental-go-petstore.yaml new file mode 100644 index 000000000000..53748e4009dc --- /dev/null +++ b/bin/configs/go-experimental-go-petstore.yaml @@ -0,0 +1,7 @@ +generatorName: go-experimental +outputDir: samples/openapi3/client/petstore/go-experimental/go-petstore +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +templateDir: modules/openapi-generator/src/main/resources/go-experimental +additionalProperties: + enumClassPrefix: "true" + packageName: petstore diff --git a/bin/configs/go-gin-server-go-gin-api-server.yaml b/bin/configs/go-gin-server-go-gin-api-server.yaml new file mode 100644 index 000000000000..7d9932bd14f2 --- /dev/null +++ b/bin/configs/go-gin-server-go-gin-api-server.yaml @@ -0,0 +1,7 @@ +generatorName: go-gin-server +outputDir: samples/server/petstore/go-gin-api-server +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/go-gin-server +additionalProperties: + hideGenerationTimestamp: "true" + packageName: petstoreserver diff --git a/bin/configs/go-petstore-oas2.yaml b/bin/configs/go-petstore-oas2.yaml new file mode 100644 index 000000000000..848899598a69 --- /dev/null +++ b/bin/configs/go-petstore-oas2.yaml @@ -0,0 +1,6 @@ +generatorName: go +outputDir: samples/client/petstore/go/go-petstore +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/go +additionalProperties: + packageName: petstore diff --git a/bin/configs/go-petstore-withXml.yaml b/bin/configs/go-petstore-withXml.yaml new file mode 100644 index 000000000000..f80df1e76814 --- /dev/null +++ b/bin/configs/go-petstore-withXml.yaml @@ -0,0 +1,8 @@ +generatorName: go +outputDir: samples/client/petstore/go/go-petstore-withXml +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/go +additionalProperties: + packageName: petstore + withXml: "true" + withGoCodegenComment: "true" diff --git a/bin/configs/go-petstore.yaml b/bin/configs/go-petstore.yaml new file mode 100644 index 000000000000..aefc71b9011f --- /dev/null +++ b/bin/configs/go-petstore.yaml @@ -0,0 +1,7 @@ +generatorName: go +outputDir: samples/openapi3/client/petstore/go/go-petstore +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/go +additionalProperties: + enumClassPrefix: "true" + packageName: petstore diff --git a/bin/configs/go-server-go-api-server.yaml b/bin/configs/go-server-go-api-server.yaml new file mode 100644 index 000000000000..6446d212a353 --- /dev/null +++ b/bin/configs/go-server-go-api-server.yaml @@ -0,0 +1,7 @@ +generatorName: go-server +outputDir: samples/server/petstore/go-api-server +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/go-server +additionalProperties: + hideGenerationTimestamp: "true" + packageName: petstoreserver diff --git a/bin/configs/groovy.yaml b/bin/configs/groovy.yaml new file mode 100644 index 000000000000..df745d168e1b --- /dev/null +++ b/bin/configs/groovy.yaml @@ -0,0 +1,6 @@ +generatorName: groovy +outputDir: samples/client/petstore/groovy +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/Groovy +additionalProperties: + hideGenerationTimestamp: "true" diff --git a/bin/configs/haskell-http-client.yaml b/bin/configs/haskell-http-client.yaml new file mode 100644 index 000000000000..577ad437a92b --- /dev/null +++ b/bin/configs/haskell-http-client.yaml @@ -0,0 +1,4 @@ +generatorName: haskell-http-client +outputDir: samples/client/petstore/haskell-http-client +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/haskell-http-client diff --git a/bin/configs/java-feign10x.yaml b/bin/configs/java-feign10x.yaml new file mode 100644 index 000000000000..4d741daac248 --- /dev/null +++ b/bin/configs/java-feign10x.yaml @@ -0,0 +1,9 @@ +generatorName: java +outputDir: samples/client/petstore/java/feign10x +library: feign +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/Java +additionalProperties: + booleanGetterPrefix: is + artifactId: petstore-feign-10x + hideGenerationTimestamp: "true" diff --git a/bin/configs/java-google-api-client.yaml b/bin/configs/java-google-api-client.yaml new file mode 100644 index 000000000000..7fed4f4fd388 --- /dev/null +++ b/bin/configs/java-google-api-client.yaml @@ -0,0 +1,8 @@ +generatorName: java +outputDir: samples/client/petstore/java/google-api-client +library: google-api-client +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/Java +additionalProperties: + artifactId: petstore-google-api-client + hideGenerationTimestamp: "true" diff --git a/bin/configs/java-jersey1.yaml b/bin/configs/java-jersey1.yaml new file mode 100644 index 000000000000..26cf1f0e5c1f --- /dev/null +++ b/bin/configs/java-jersey1.yaml @@ -0,0 +1,8 @@ +generatorName: java +outputDir: samples/client/petstore/java/jersey1 +library: jersey1 +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/Java +additionalProperties: + hideGenerationTimestamp: "true" + artifactId: petstore-java-client-jersey1 diff --git a/bin/configs/java-jersey2-8-oas2.yaml b/bin/configs/java-jersey2-8-oas2.yaml new file mode 100644 index 000000000000..0e360085a9e9 --- /dev/null +++ b/bin/configs/java-jersey2-8-oas2.yaml @@ -0,0 +1,9 @@ +generatorName: java +outputDir: samples/client/petstore/java/jersey2-java8 +library: jersey2 +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +additionalProperties: + artifactId: petstore-jersey2-java8 + hideGenerationTimestamp: "true" + serverPort: "8082" + dateLibrary: java8 diff --git a/bin/configs/java-jersey2-8.yaml b/bin/configs/java-jersey2-8.yaml new file mode 100644 index 000000000000..ec636e75cb50 --- /dev/null +++ b/bin/configs/java-jersey2-8.yaml @@ -0,0 +1,9 @@ +generatorName: java +outputDir: samples/openapi3/client/petstore/java/jersey2-java8 +library: jersey2 +inputSpec: modules/openapi-generator/src/test/resources/3_0/python-experimental/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +additionalProperties: + artifactId: petstore-openapi3-jersey2-java8 + hideGenerationTimestamp: "true" + serverPort: "8082" + dateLibrary: java8 diff --git a/bin/configs/java-microprofile-rest-client.yaml b/bin/configs/java-microprofile-rest-client.yaml new file mode 100644 index 000000000000..07c1fe806b76 --- /dev/null +++ b/bin/configs/java-microprofile-rest-client.yaml @@ -0,0 +1,6 @@ +generatorName: java +outputDir: samples/client/petstore/java/microprofile-rest-client +library: microprofile +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +additionalProperties: + artifactId: microprofile-rest-client diff --git a/bin/configs/java-msf4j.yaml b/bin/configs/java-msf4j.yaml new file mode 100644 index 000000000000..71c5d117d834 --- /dev/null +++ b/bin/configs/java-msf4j.yaml @@ -0,0 +1,7 @@ +generatorName: java-msf4j +outputDir: samples/server/petstore/java-msf4j +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/java-msf4j-server +additionalProperties: + hideGenerationTimestamp: "true" + artifactId: java-msf4j-server diff --git a/bin/configs/java-native.yaml b/bin/configs/java-native.yaml new file mode 100644 index 000000000000..142597652508 --- /dev/null +++ b/bin/configs/java-native.yaml @@ -0,0 +1,8 @@ +generatorName: java +outputDir: samples/client/petstore/java/native +library: native +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/Java +additionalProperties: + artifactId: petstore-native + hideGenerationTimestamp: "true" diff --git a/bin/configs/java-okhttp-gson-parcelableModel.yaml b/bin/configs/java-okhttp-gson-parcelableModel.yaml new file mode 100644 index 000000000000..c9cbb2008b1d --- /dev/null +++ b/bin/configs/java-okhttp-gson-parcelableModel.yaml @@ -0,0 +1,9 @@ +generatorName: java +outputDir: samples/client/petstore/java/okhttp-gson-parcelableModel +library: okhttp-gson +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/Java +additionalProperties: + parcelableModel: "true" + artifactId: petstore-okhttp-gson-parcelableModel + hideGenerationTimestamp: "true" diff --git a/bin/configs/java-okhttp-gson.yaml b/bin/configs/java-okhttp-gson.yaml new file mode 100644 index 000000000000..c71c509aa28e --- /dev/null +++ b/bin/configs/java-okhttp-gson.yaml @@ -0,0 +1,8 @@ +generatorName: java +outputDir: samples/client/petstore/java/okhttp-gson +library: okhttp-gson +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/Java +additionalProperties: + artifactId: petstore-okhttp-gson + hideGenerationTimestamp: "true" diff --git a/bin/configs/java-play-framework-api-package-override.yaml b/bin/configs/java-play-framework-api-package-override.yaml new file mode 100644 index 000000000000..93b1d8f17885 --- /dev/null +++ b/bin/configs/java-play-framework-api-package-override.yaml @@ -0,0 +1,7 @@ +generatorName: java-play-framework +outputDir: samples/server/petstore/java-play-framework-api-package-override +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaPlayFramework +additionalProperties: + hideGenerationTimestamp: "true" + apiPackage: com.puppies.store.apis diff --git a/bin/configs/java-play-framework-async.yaml b/bin/configs/java-play-framework-async.yaml new file mode 100644 index 000000000000..0cf9d1bca2e5 --- /dev/null +++ b/bin/configs/java-play-framework-async.yaml @@ -0,0 +1,7 @@ +generatorName: java-play-framework +outputDir: samples/server/petstore/java-play-framework-async +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaPlayFramework +additionalProperties: + supportAsync: true + hideGenerationTimestamp: "true" diff --git a/bin/configs/java-play-framework-controller-only.yaml b/bin/configs/java-play-framework-controller-only.yaml new file mode 100644 index 000000000000..8c4ceb8afa6e --- /dev/null +++ b/bin/configs/java-play-framework-controller-only.yaml @@ -0,0 +1,7 @@ +generatorName: java-play-framework +outputDir: samples/server/petstore/java-play-framework-controller-only +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaPlayFramework +additionalProperties: + controllerOnly: "true" + hideGenerationTimestamp: "true" diff --git a/bin/configs/java-play-framework-fake-endpoints.yaml b/bin/configs/java-play-framework-fake-endpoints.yaml new file mode 100644 index 000000000000..7ab4bb95563e --- /dev/null +++ b/bin/configs/java-play-framework-fake-endpoints.yaml @@ -0,0 +1,6 @@ +generatorName: java-play-framework +outputDir: samples/server/petstore/java-play-framework-fake-endpoints +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaPlayFramework +additionalProperties: + hideGenerationTimestamp: "true" diff --git a/bin/configs/java-play-framework-no-bean-validation.yaml b/bin/configs/java-play-framework-no-bean-validation.yaml new file mode 100644 index 000000000000..22614f20d8d4 --- /dev/null +++ b/bin/configs/java-play-framework-no-bean-validation.yaml @@ -0,0 +1,7 @@ +generatorName: java-play-framework +outputDir: samples/server/petstore/java-play-framework-no-bean-validation +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaPlayFramework +additionalProperties: + hideGenerationTimestamp: "true" + useBeanValidation: "false" diff --git a/bin/configs/java-play-framework-no-exception-handling.yaml b/bin/configs/java-play-framework-no-exception-handling.yaml new file mode 100644 index 000000000000..f231fbb9607c --- /dev/null +++ b/bin/configs/java-play-framework-no-exception-handling.yaml @@ -0,0 +1,7 @@ +generatorName: java-play-framework +outputDir: samples/server/petstore/java-play-framework-no-exception-handling +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaPlayFramework +additionalProperties: + handleExceptions: "false" + hideGenerationTimestamp: "true" diff --git a/bin/configs/java-play-framework-no-interface.yaml b/bin/configs/java-play-framework-no-interface.yaml new file mode 100644 index 000000000000..51633c13dc5a --- /dev/null +++ b/bin/configs/java-play-framework-no-interface.yaml @@ -0,0 +1,7 @@ +generatorName: java-play-framework +outputDir: samples/server/petstore/java-play-framework-no-interface +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaPlayFramework +additionalProperties: + hideGenerationTimestamp: "true" + useInterfaces: "false" diff --git a/bin/configs/java-play-framework-no-swagger-ui.yaml b/bin/configs/java-play-framework-no-swagger-ui.yaml new file mode 100644 index 000000000000..b2cb39224b69 --- /dev/null +++ b/bin/configs/java-play-framework-no-swagger-ui.yaml @@ -0,0 +1,7 @@ +generatorName: java-play-framework +outputDir: samples/server/petstore/java-play-framework-no-swagger-ui +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaPlayFramework +additionalProperties: + hideGenerationTimestamp: "true" + useSwaggerUI: "false" diff --git a/bin/configs/java-play-framework-no-wrap-calls.yaml b/bin/configs/java-play-framework-no-wrap-calls.yaml new file mode 100644 index 000000000000..d8ab5013bde0 --- /dev/null +++ b/bin/configs/java-play-framework-no-wrap-calls.yaml @@ -0,0 +1,7 @@ +generatorName: java-play-framework +outputDir: samples/server/petstore/java-play-framework-no-wrap-calls +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaPlayFramework +additionalProperties: + hideGenerationTimestamp: "true" + wrapCalls: "false" diff --git a/bin/configs/java-play-framework.yaml b/bin/configs/java-play-framework.yaml new file mode 100644 index 000000000000..ee9b27052734 --- /dev/null +++ b/bin/configs/java-play-framework.yaml @@ -0,0 +1,6 @@ +generatorName: java-play-framework +outputDir: samples/server/petstore/java-play-framework +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaPlayFramework +additionalProperties: + hideGenerationTimestamp: "true" diff --git a/bin/configs/java-rest-assured-jackson.yaml b/bin/configs/java-rest-assured-jackson.yaml new file mode 100644 index 000000000000..db2014be022c --- /dev/null +++ b/bin/configs/java-rest-assured-jackson.yaml @@ -0,0 +1,14 @@ +generatorName: java +outputDir: ./samples/client/petstore/java/rest-assured-jackson +library: rest-assured +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/Java +additionalProperties: + serializationLibrary: jackson + dateLibrary: java8 + performBeanValidation: "true" + java8: "true" + useBeanValidation: "true" + booleanGetterPrefix: is + artifactId: petstore-rest-assured-jackson + hideGenerationTimestamp: "true" diff --git a/bin/configs/java-rest-assured.yaml b/bin/configs/java-rest-assured.yaml new file mode 100644 index 000000000000..39426761ef20 --- /dev/null +++ b/bin/configs/java-rest-assured.yaml @@ -0,0 +1,11 @@ +generatorName: java +outputDir: samples/client/petstore/java/rest-assured +library: rest-assured +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/Java +additionalProperties: + performBeanValidation: "true" + useBeanValidation: "true" + booleanGetterPrefix: is + artifactId: petstore-rest-assured + hideGenerationTimestamp: "true" diff --git a/bin/configs/java-resteasy.yaml b/bin/configs/java-resteasy.yaml new file mode 100644 index 000000000000..26776e8f08dc --- /dev/null +++ b/bin/configs/java-resteasy.yaml @@ -0,0 +1,7 @@ +generatorName: java +outputDir: samples/client/petstore/java/resteasy +library: resteasy +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +additionalProperties: + artifactId: petstore-resteasy + hideGenerationTimestamp: "true" diff --git a/bin/configs/java-resttemplate-withXml.yaml b/bin/configs/java-resttemplate-withXml.yaml new file mode 100644 index 000000000000..0307a5832649 --- /dev/null +++ b/bin/configs/java-resttemplate-withXml.yaml @@ -0,0 +1,8 @@ +generatorName: java +outputDir: samples/client/petstore/java/resttemplate-withXml +library: resttemplate +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +additionalProperties: + withXml: "true" + artifactId: petstore-resttemplate-withxml + hideGenerationTimestamp: "true" diff --git a/bin/configs/java-resttemplate.yaml b/bin/configs/java-resttemplate.yaml new file mode 100644 index 000000000000..4bbfa2f688c4 --- /dev/null +++ b/bin/configs/java-resttemplate.yaml @@ -0,0 +1,7 @@ +generatorName: java +outputDir: samples/client/petstore/java/resttemplate +library: resttemplate +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +additionalProperties: + artifactId: petstore-resttemplate + hideGenerationTimestamp: "true" diff --git a/bin/configs/java-retrofit2-play24.yaml b/bin/configs/java-retrofit2-play24.yaml new file mode 100644 index 000000000000..aa1bfb5b75bc --- /dev/null +++ b/bin/configs/java-retrofit2-play24.yaml @@ -0,0 +1,12 @@ +generatorName: java +outputDir: samples/client/petstore/java/retrofit2-play24 +library: retrofit2 +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +additionalProperties: + usePlayWS: "true" + enableBuilderSupport: "true" + useBeanValidation: "true" + playVersion: play24 + artifactId: petstore-java-client-retrofit2-play24 + hideGenerationTimestamp: "true" + dateLibrary: java8 diff --git a/bin/configs/java-retrofit2-play25.yaml b/bin/configs/java-retrofit2-play25.yaml new file mode 100644 index 000000000000..49cfe3d0c741 --- /dev/null +++ b/bin/configs/java-retrofit2-play25.yaml @@ -0,0 +1,11 @@ +generatorName: java +outputDir: samples/client/petstore/java/retrofit2-play25 +library: retrofit2 +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +additionalProperties: + usePlayWS: "true" + enableBuilderSupport: "true" + useBeanValidation: "true" + playVersion: play25 + artifactId: petstore-java-client-retrofit2-play25 + hideGenerationTimestamp: "true" diff --git a/bin/configs/java-retrofit2-play26.yaml b/bin/configs/java-retrofit2-play26.yaml new file mode 100644 index 000000000000..5fe367fb79f7 --- /dev/null +++ b/bin/configs/java-retrofit2-play26.yaml @@ -0,0 +1,11 @@ +generatorName: java +outputDir: samples/client/petstore/java/retrofit2-play26 +library: retrofit2 +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +additionalProperties: + usePlayWS: "true" + enableBuilderSupport: "true" + useBeanValidation: "true" + playVersion: play26 + artifactId: petstore-java-client-retrofit2-play26 + hideGenerationTimestamp: "true" diff --git a/bin/configs/java-retrofit2.yaml b/bin/configs/java-retrofit2.yaml new file mode 100644 index 000000000000..2879e3e4493e --- /dev/null +++ b/bin/configs/java-retrofit2.yaml @@ -0,0 +1,8 @@ +generatorName: java +outputDir: samples/client/petstore/java/retrofit2 +library: retrofit2 +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/Java +additionalProperties: + artifactId: petstore-retrofit2 + hideGenerationTimestamp: "true" diff --git a/bin/configs/java-retrofit2rx.yaml b/bin/configs/java-retrofit2rx.yaml new file mode 100644 index 000000000000..2f84144f78f7 --- /dev/null +++ b/bin/configs/java-retrofit2rx.yaml @@ -0,0 +1,9 @@ +generatorName: java +outputDir: samples/client/petstore/java/retrofit2rx +library: retrofit2 +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/Java +additionalProperties: + useRxJava: "true" + artifactId: petstore-retrofit2-rx + hideGenerationTimestamp: "true" diff --git a/bin/configs/java-retrofit2rx2.yaml b/bin/configs/java-retrofit2rx2.yaml new file mode 100644 index 000000000000..dfb55acb481d --- /dev/null +++ b/bin/configs/java-retrofit2rx2.yaml @@ -0,0 +1,9 @@ +generatorName: java +outputDir: samples/client/petstore/java/retrofit2rx2 +library: retrofit2 +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/Java +additionalProperties: + useRxJava2: "true" + artifactId: petstore-retrofit2-rx2 + hideGenerationTimestamp: "true" diff --git a/bin/configs/java-vertx.yaml b/bin/configs/java-vertx.yaml new file mode 100644 index 000000000000..cf019b5da88c --- /dev/null +++ b/bin/configs/java-vertx.yaml @@ -0,0 +1,9 @@ +generatorName: java +outputDir: samples/client/petstore/java/vertx +library: vertx +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/Java +additionalProperties: + artifactId: petstore-vertx + hideGenerationTimestamp: "true" + dateLibrary: java8 diff --git a/bin/configs/java-webclient.yaml b/bin/configs/java-webclient.yaml new file mode 100644 index 000000000000..dafc9835f239 --- /dev/null +++ b/bin/configs/java-webclient.yaml @@ -0,0 +1,7 @@ +generatorName: java +outputDir: samples/client/petstore/java/webclient +library: webclient +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +additionalProperties: + artifactId: petstore-webclient + hideGenerationTimestamp: "true" diff --git a/bin/configs/javascript-es6.yaml b/bin/configs/javascript-es6.yaml new file mode 100644 index 000000000000..08a49e7935b0 --- /dev/null +++ b/bin/configs/javascript-es6.yaml @@ -0,0 +1,6 @@ +generatorName: javascript +outputDir: samples/client/petstore/javascript-es6 +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/Javascript/es6 +additionalProperties: + appName: PetstoreClient diff --git a/bin/configs/javascript-promise-es6.yaml b/bin/configs/javascript-promise-es6.yaml new file mode 100644 index 000000000000..c21b9c1376f3 --- /dev/null +++ b/bin/configs/javascript-promise-es6.yaml @@ -0,0 +1,7 @@ +generatorName: javascript +outputDir: samples/client/petstore/javascript-promise-es6 +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/Javascript/es6 +additionalProperties: + usePromises: "true" + appName: PetstoreClient diff --git a/bin/configs/jaxrs-cxf-annotated-base-path.yaml b/bin/configs/jaxrs-cxf-annotated-base-path.yaml new file mode 100644 index 000000000000..ddff8105f24c --- /dev/null +++ b/bin/configs/jaxrs-cxf-annotated-base-path.yaml @@ -0,0 +1,9 @@ +generatorName: jaxrs-cxf +outputDir: samples/server/petstore/jaxrs-cxf-annotated-base-path +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS/cxf +additionalProperties: + artifactId: cxf-annotated-basepath + hideGenerationTimestamp: "true" + serverPort: "8082" + useAnnotatedBasePath: "true" diff --git a/bin/configs/jaxrs-cxf-cdi.yaml b/bin/configs/jaxrs-cxf-cdi.yaml new file mode 100644 index 000000000000..59b8fc8c3363 --- /dev/null +++ b/bin/configs/jaxrs-cxf-cdi.yaml @@ -0,0 +1,6 @@ +generatorName: jaxrs-cxf-cdi +outputDir: samples/server/petstore/jaxrs-cxf-cdi +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi +additionalProperties: + hideGenerationTimestamp: "true" diff --git a/bin/configs/jaxrs-cxf-non-spring-app.yaml b/bin/configs/jaxrs-cxf-non-spring-app.yaml new file mode 100644 index 000000000000..b1f09c10810f --- /dev/null +++ b/bin/configs/jaxrs-cxf-non-spring-app.yaml @@ -0,0 +1,9 @@ +generatorName: jaxrs-cxf +outputDir: samples/server/petstore/jaxrs-cxf-non-spring-app +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS/cxf +additionalProperties: + artifactId: cxf-server-non-spring + hideGenerationTimestamp: "true" + generateNonSpringApplication: "true" + serverPort: "8082" diff --git a/bin/configs/jaxrs-cxf.yaml b/bin/configs/jaxrs-cxf.yaml new file mode 100644 index 000000000000..81988d2576d0 --- /dev/null +++ b/bin/configs/jaxrs-cxf.yaml @@ -0,0 +1,7 @@ +generatorName: jaxrs-cxf +outputDir: samples/server/petstore/jaxrs-cxf +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS/cxf +additionalProperties: + hideGenerationTimestamp: "true" + serverPort: "8082" diff --git a/bin/configs/jaxrs-jersey-jaxrs-datelib-j8.yaml b/bin/configs/jaxrs-jersey-jaxrs-datelib-j8.yaml new file mode 100644 index 000000000000..902a8abae0b6 --- /dev/null +++ b/bin/configs/jaxrs-jersey-jaxrs-datelib-j8.yaml @@ -0,0 +1,12 @@ +generatorName: jaxrs-jersey +outputDir: samples/server/petstore/jaxrs-datelib-j8 +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS +additionalProperties: + serializableModel: true + withXml: true + java8: true + useBeanValidation: true + hideGenerationTimestamp: "true" + serverPort: "8082" + dateLibrary: java8 diff --git a/bin/configs/jaxrs-jersey-jersey1-useTags.yaml b/bin/configs/jaxrs-jersey-jersey1-useTags.yaml new file mode 100644 index 000000000000..98c76c0e4511 --- /dev/null +++ b/bin/configs/jaxrs-jersey-jersey1-useTags.yaml @@ -0,0 +1,10 @@ +generatorName: jaxrs-jersey +outputDir: samples/server/petstore/jaxrs/jersey1-useTags +library: jersey1 +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS +additionalProperties: + artifactId: jaxrs-jersey1-useTags + hideGenerationTimestamp: "true" + serverPort: "8082" + useTags: "true" diff --git a/bin/configs/jaxrs-jersey-jersey1.yaml b/bin/configs/jaxrs-jersey-jersey1.yaml new file mode 100644 index 000000000000..8df27c59be78 --- /dev/null +++ b/bin/configs/jaxrs-jersey-jersey1.yaml @@ -0,0 +1,9 @@ +generatorName: jaxrs-jersey +outputDir: samples/server/petstore/jaxrs/jersey1 +library: jersey1 +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS +additionalProperties: + artifactId: jaxrs-jersey1-server + hideGenerationTimestamp: "true" + serverPort: "8082" diff --git a/bin/configs/jaxrs-jersey-jersey2-useTags.yaml b/bin/configs/jaxrs-jersey-jersey2-useTags.yaml new file mode 100644 index 000000000000..8a2d89b02f24 --- /dev/null +++ b/bin/configs/jaxrs-jersey-jersey2-useTags.yaml @@ -0,0 +1,9 @@ +generatorName: jaxrs-jersey +outputDir: samples/server/petstore/jaxrs/jersey2-useTags +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS +additionalProperties: + artifactId: jaxrs-jersey2-useTags + hideGenerationTimestamp: "true" + serverPort: "8082" + useTags: "true" diff --git a/bin/configs/jaxrs-jersey-jersey2.yaml b/bin/configs/jaxrs-jersey-jersey2.yaml new file mode 100644 index 000000000000..8345db9f3976 --- /dev/null +++ b/bin/configs/jaxrs-jersey-jersey2.yaml @@ -0,0 +1,8 @@ +generatorName: jaxrs-jersey +outputDir: samples/server/petstore/jaxrs/jersey2 +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS +additionalProperties: + artifactId: jaxrs-jersey-petstore-server + hideGenerationTimestamp: "true" + serverPort: "8082" diff --git a/bin/configs/jaxrs-jersey.yaml b/bin/configs/jaxrs-jersey.yaml new file mode 100644 index 000000000000..81328a6de1b1 --- /dev/null +++ b/bin/configs/jaxrs-jersey.yaml @@ -0,0 +1,8 @@ +generatorName: jaxrs-jersey +outputDir: samples/server/petstore/jaxrs-jersey +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS +additionalProperties: + artifactId: openapiv3-jaxrs-jersey-petstore-server + hideGenerationTimestamp: "true" + serverPort: "8080" diff --git a/bin/configs/jaxrs-resteasy-default.yaml b/bin/configs/jaxrs-resteasy-default.yaml new file mode 100644 index 000000000000..3fd9e38fb2b7 --- /dev/null +++ b/bin/configs/jaxrs-resteasy-default.yaml @@ -0,0 +1,6 @@ +generatorName: jaxrs-resteasy +outputDir: samples/server/petstore/jaxrs-resteasy/default +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy +additionalProperties: + hideGenerationTimestamp: "true" diff --git a/bin/configs/jaxrs-resteasy-eap-eap-java8.yaml b/bin/configs/jaxrs-resteasy-eap-eap-java8.yaml new file mode 100644 index 000000000000..3315b6e1a022 --- /dev/null +++ b/bin/configs/jaxrs-resteasy-eap-eap-java8.yaml @@ -0,0 +1,8 @@ +generatorName: jaxrs-resteasy-eap +outputDir: samples/server/petstore/jaxrs-resteasy/eap-java8 +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap +additionalProperties: + artifactId: jaxrs-resteasy-eap-java8-server + hideGenerationTimestamp: "true" + dateLibrary: java8 diff --git a/bin/configs/jaxrs-resteasy-eap-eap-joda.yaml b/bin/configs/jaxrs-resteasy-eap-eap-joda.yaml new file mode 100644 index 000000000000..a985b866cd31 --- /dev/null +++ b/bin/configs/jaxrs-resteasy-eap-eap-joda.yaml @@ -0,0 +1,8 @@ +generatorName: jaxrs-resteasy-eap +outputDir: samples/server/petstore/jaxrs-resteasy/eap-joda +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap +additionalProperties: + artifactId: jaxrs-resteasy-eap-joda-server + hideGenerationTimestamp: "true" + dateLibrary: joda diff --git a/bin/configs/jaxrs-resteasy-eap-eap.yaml b/bin/configs/jaxrs-resteasy-eap-eap.yaml new file mode 100644 index 000000000000..5f776839cabd --- /dev/null +++ b/bin/configs/jaxrs-resteasy-eap-eap.yaml @@ -0,0 +1,6 @@ +generatorName: jaxrs-resteasy-eap +outputDir: samples/server/petstore/jaxrs-resteasy/eap +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap +additionalProperties: + hideGenerationTimestamp: "true" diff --git a/bin/configs/jaxrs-resteasy-joda.yaml b/bin/configs/jaxrs-resteasy-joda.yaml new file mode 100644 index 000000000000..13fb6b8b671b --- /dev/null +++ b/bin/configs/jaxrs-resteasy-joda.yaml @@ -0,0 +1,8 @@ +generatorName: jaxrs-resteasy +outputDir: samples/server/petstore/jaxrs-resteasy/joda +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy +additionalProperties: + artifactId: jaxrs-resteasy-joda-server + hideGenerationTimestamp: "true" + dateLibrary: joda diff --git a/bin/configs/jaxrs-spec-interface.yaml b/bin/configs/jaxrs-spec-interface.yaml new file mode 100644 index 000000000000..2c0b68c410b8 --- /dev/null +++ b/bin/configs/jaxrs-spec-interface.yaml @@ -0,0 +1,8 @@ +generatorName: jaxrs-spec +outputDir: samples/server/petstore/jaxrs-spec-interface +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +additionalProperties: + artifactId: jaxrs-spec-interface-petstore-server + interfaceOnly: "true" + serializableModel: "true" + hideGenerationTimestamp: "true" diff --git a/bin/configs/jaxrs-spec.yaml b/bin/configs/jaxrs-spec.yaml new file mode 100644 index 000000000000..df44fac3717e --- /dev/null +++ b/bin/configs/jaxrs-spec.yaml @@ -0,0 +1,7 @@ +generatorName: jaxrs-spec +outputDir: samples/server/petstore/jaxrs-spec +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +additionalProperties: + artifactId: jaxrs-spec-petstore-server + serializableModel: "true" + hideGenerationTimestamp: "true" diff --git a/bin/configs/kotlin-gson.yaml b/bin/configs/kotlin-gson.yaml new file mode 100644 index 000000000000..e4e55689509d --- /dev/null +++ b/bin/configs/kotlin-gson.yaml @@ -0,0 +1,7 @@ +generatorName: kotlin +outputDir: samples/client/petstore/kotlin-gson +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/kotlin-client +additionalProperties: + serializationLibrary: gson + artifactId: kotlin-petstore-gson diff --git a/bin/configs/kotlin-jackson.yaml b/bin/configs/kotlin-jackson.yaml new file mode 100644 index 000000000000..2d37a29f38ad --- /dev/null +++ b/bin/configs/kotlin-jackson.yaml @@ -0,0 +1,8 @@ +generatorName: kotlin +outputDir: samples/client/petstore/kotlin-jackson +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/kotlin-client +additionalProperties: + serializationLibrary: jackson + artifactId: kotlin-petstore-jackson + enumPropertyNaming: UPPERCASE diff --git a/bin/configs/kotlin-json-request-string.yaml b/bin/configs/kotlin-json-request-string.yaml new file mode 100644 index 000000000000..8f1dade28c90 --- /dev/null +++ b/bin/configs/kotlin-json-request-string.yaml @@ -0,0 +1,7 @@ +generatorName: kotlin +outputDir: samples/client/petstore/kotlin-json-request-string +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-date-field.yaml +templateDir: modules/openapi-generator/src/main/resources/kotlin-client +additionalProperties: + requestDateConverter: toString + artifactId: kotlin-petstore-json-request-string diff --git a/bin/configs/kotlin-jvm-okhttp3-okhttp3.yaml b/bin/configs/kotlin-jvm-okhttp3-okhttp3.yaml new file mode 100644 index 000000000000..f8be34a2f0ac --- /dev/null +++ b/bin/configs/kotlin-jvm-okhttp3-okhttp3.yaml @@ -0,0 +1,7 @@ +generatorName: kotlin +outputDir: samples/client/petstore/kotlin-okhttp3 +library: jvm-okhttp3 +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/kotlin-client +additionalProperties: + artifactId: kotlin-petstore-okhttp3 diff --git a/bin/configs/kotlin-jvm-okhttp4-coroutines.yaml b/bin/configs/kotlin-jvm-okhttp4-coroutines.yaml new file mode 100644 index 000000000000..0718c164d565 --- /dev/null +++ b/bin/configs/kotlin-jvm-okhttp4-coroutines.yaml @@ -0,0 +1,11 @@ +generatorName: kotlin +outputDir: samples/client/petstore/kotlin-jvm-okhttp4-coroutines +library: jvm-okhttp4 +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/kotlin-client +additionalProperties: + serializationLibrary: gson + useCoroutines: "true" + artifactId: kotlin-petstore-okhttp4-coroutines-client + serializableModel: "true" + dateLibrary: java8 diff --git a/bin/configs/kotlin-jvm-retrofit2-retrofit2.yaml b/bin/configs/kotlin-jvm-retrofit2-retrofit2.yaml new file mode 100644 index 000000000000..0729bf8ecd82 --- /dev/null +++ b/bin/configs/kotlin-jvm-retrofit2-retrofit2.yaml @@ -0,0 +1,7 @@ +generatorName: kotlin +outputDir: samples/client/petstore/kotlin-retrofit2 +library: jvm-retrofit2 +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/kotlin-client +additionalProperties: + artifactId: kotlin-petstore-retrofit2 diff --git a/bin/configs/kotlin-moshi-codegen.yaml b/bin/configs/kotlin-moshi-codegen.yaml new file mode 100644 index 000000000000..00536bbf1cf4 --- /dev/null +++ b/bin/configs/kotlin-moshi-codegen.yaml @@ -0,0 +1,8 @@ +generatorName: kotlin +outputDir: samples/client/petstore/kotlin-moshi-codegen +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/kotlin-client +additionalProperties: + serializationLibrary: moshi + artifactId: kotlin-petstore-moshi-codegen + moshiCodeGen: "true" diff --git a/bin/configs/kotlin-multiplatform.yaml b/bin/configs/kotlin-multiplatform.yaml new file mode 100644 index 000000000000..ba50f38f6780 --- /dev/null +++ b/bin/configs/kotlin-multiplatform.yaml @@ -0,0 +1,7 @@ +generatorName: kotlin +outputDir: samples/client/petstore/kotlin-multiplatform +library: multiplatform +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/kotlin-client +additionalProperties: + artifactId: kotlin-client-petstore-multiplatform diff --git a/bin/configs/kotlin-nonpublic.yaml b/bin/configs/kotlin-nonpublic.yaml new file mode 100644 index 000000000000..fbc64ceb00d1 --- /dev/null +++ b/bin/configs/kotlin-nonpublic.yaml @@ -0,0 +1,7 @@ +generatorName: kotlin +outputDir: samples/client/petstore/kotlin-nonpublic +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/kotlin-client +additionalProperties: + nonPublicApi: "true" + artifactId: kotlin-petstore-nonpublic diff --git a/bin/configs/kotlin-nullable.yaml b/bin/configs/kotlin-nullable.yaml new file mode 100644 index 000000000000..27fe5c6b0d89 --- /dev/null +++ b/bin/configs/kotlin-nullable.yaml @@ -0,0 +1,8 @@ +generatorName: kotlin +outputDir: samples/client/petstore/kotlin-nullable +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/kotlin-client +additionalProperties: + artifactId: kotlin-petstore-nullable + serializableModel: "true" + nullableReturnType: "true" diff --git a/bin/configs/kotlin-server-ktor.yaml b/bin/configs/kotlin-server-ktor.yaml new file mode 100644 index 000000000000..ad5bce1047e1 --- /dev/null +++ b/bin/configs/kotlin-server-ktor.yaml @@ -0,0 +1,8 @@ +generatorName: kotlin-server +outputDir: samples/server/petstore/kotlin-server/ktor +library: ktor +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/kotlin-server +additionalProperties: + hideGenerationTimestamp: "true" + serializableModel: "true" diff --git a/bin/configs/kotlin-spring-boot-reactive.yaml b/bin/configs/kotlin-spring-boot-reactive.yaml new file mode 100644 index 000000000000..4730069192b1 --- /dev/null +++ b/bin/configs/kotlin-spring-boot-reactive.yaml @@ -0,0 +1,10 @@ +generatorName: kotlin-spring +outputDir: samples/server/petstore/kotlin-springboot-reactive +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/kotlin-spring +additionalProperties: + serviceImplementation: "true" + library: spring-boot + reactive: "true" + swaggerAnnotations: "true" + beanValidations: "true" diff --git a/bin/configs/kotlin-spring-boot.yaml b/bin/configs/kotlin-spring-boot.yaml new file mode 100644 index 000000000000..df44a4dfb566 --- /dev/null +++ b/bin/configs/kotlin-spring-boot.yaml @@ -0,0 +1,10 @@ +generatorName: kotlin-spring +outputDir: samples/server/petstore/kotlin-springboot +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/kotlin-spring +additionalProperties: + serviceImplementation: "true" + library: spring-boot + serializableModel: "true" + swaggerAnnotations: "true" + beanValidations: "true" diff --git a/bin/configs/kotlin-string.yaml b/bin/configs/kotlin-string.yaml new file mode 100644 index 000000000000..e6cd63e4b408 --- /dev/null +++ b/bin/configs/kotlin-string.yaml @@ -0,0 +1,10 @@ +generatorName: kotlin +outputDir: samples/client/petstore/kotlin-string +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/kotlin-client +additionalProperties: + artifactId: kotlin-petstore-string + serializableModel: "true" + sortModelPropertiesByRequiredFlag: "false" + sortParamsByRequiredFlag: "false" + dateLibrary: string diff --git a/bin/configs/kotlin-threetenbp.yaml b/bin/configs/kotlin-threetenbp.yaml new file mode 100644 index 000000000000..02c900e8e037 --- /dev/null +++ b/bin/configs/kotlin-threetenbp.yaml @@ -0,0 +1,7 @@ +generatorName: kotlin +outputDir: samples/client/petstore/kotlin-threetenbp +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/kotlin-client +additionalProperties: + artifactId: kotlin-petstore-threetenbp + dateLibrary: threetenbp diff --git a/bin/configs/kotlin.yaml b/bin/configs/kotlin.yaml new file mode 100644 index 000000000000..136fff6480de --- /dev/null +++ b/bin/configs/kotlin.yaml @@ -0,0 +1,8 @@ +generatorName: kotlin +outputDir: samples/client/petstore/kotlin +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/kotlin-client +additionalProperties: + artifactId: kotlin-petstore-client + serializableModel: "true" + dateLibrary: java8 diff --git a/bin/configs/lua.yaml b/bin/configs/lua.yaml new file mode 100644 index 000000000000..280cf32e7418 --- /dev/null +++ b/bin/configs/lua.yaml @@ -0,0 +1,6 @@ +generatorName: lua +outputDir: samples/client/petstore/lua +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/lua +additionalProperties: + packageName: petstore diff --git a/bin/configs/mysql-schema-mysql.yaml b/bin/configs/mysql-schema-mysql.yaml new file mode 100644 index 000000000000..4a4811ae106e --- /dev/null +++ b/bin/configs/mysql-schema-mysql.yaml @@ -0,0 +1,4 @@ +generatorName: mysql-schema +outputDir: samples/schema/petstore/mysql +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/mysql-schema diff --git a/bin/configs/nim.yaml b/bin/configs/nim.yaml new file mode 100644 index 000000000000..136a92764c3c --- /dev/null +++ b/bin/configs/nim.yaml @@ -0,0 +1,6 @@ +generatorName: nim +outputDir: samples/client/petstore/nim +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/nim-client +additionalProperties: + packageName: petstore diff --git a/bin/configs/other/ada.yaml b/bin/configs/other/ada.yaml new file mode 100644 index 000000000000..c67b9b7d3f0c --- /dev/null +++ b/bin/configs/other/ada.yaml @@ -0,0 +1,7 @@ +generatorName: ada +outputDir: samples/client/petstore/ada +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/Ada +additionalProperties: + modelPackage: Samples.Petstore + projectName: Petstore diff --git a/bin/configs/other/android-httpclient.yaml b/bin/configs/other/android-httpclient.yaml new file mode 100644 index 000000000000..1d5e23e2272d --- /dev/null +++ b/bin/configs/other/android-httpclient.yaml @@ -0,0 +1,6 @@ +generatorName: android +outputDir: samples/client/petstore/android/httpclient +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/android +additionalProperties: + library: httpclient diff --git a/bin/configs/other/android-volley.yaml b/bin/configs/other/android-volley.yaml new file mode 100644 index 000000000000..63a3c42a46fb --- /dev/null +++ b/bin/configs/other/android-volley.yaml @@ -0,0 +1,6 @@ +generatorName: android +outputDir: samples/client/petstore/android/volley +library: volley +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +additionalProperties: + artifactId: petstore-android-volley diff --git a/bin/configs/other/apache2.yaml b/bin/configs/other/apache2.yaml new file mode 100644 index 000000000000..a5b28c44e510 --- /dev/null +++ b/bin/configs/other/apache2.yaml @@ -0,0 +1,4 @@ +generatorName: apache2 +outputDir: samples/config/petstore/apache2 +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/apache2 diff --git a/bin/configs/other/asciidoc.yaml b/bin/configs/other/asciidoc.yaml new file mode 100644 index 000000000000..4d93790d87b1 --- /dev/null +++ b/bin/configs/other/asciidoc.yaml @@ -0,0 +1,7 @@ +generatorName: asciidoc +outputDir: samples/documentation/asciidoc +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/asciidoc-documentation +additionalProperties: + specDir: modules/openapi-generator/src/main/resources/asciidoc-documentation + snippetDir: "." diff --git a/bin/configs/other/aspnetcore-3.0.yaml b/bin/configs/other/aspnetcore-3.0.yaml new file mode 100644 index 000000000000..762013c1696f --- /dev/null +++ b/bin/configs/other/aspnetcore-3.0.yaml @@ -0,0 +1,7 @@ +generatorName: aspnetcore +outputDir: samples/server/petstore/aspnetcore-3.0 +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/aspnetcore/3.0 +additionalProperties: + packageGuid: '{3C799344-F285-4669-8FD5-7ED9B795D5C5}' + aspnetCoreVersion: "3.0" diff --git a/bin/configs/other/aspnetcore-3.1.yaml b/bin/configs/other/aspnetcore-3.1.yaml new file mode 100644 index 000000000000..0986677882a8 --- /dev/null +++ b/bin/configs/other/aspnetcore-3.1.yaml @@ -0,0 +1,7 @@ +generatorName: aspnetcore +outputDir: samples/server/petstore/aspnetcore-3.1 +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/aspnetcore/3.0 +additionalProperties: + packageGuid: '{3C799344-F285-4669-8FD5-7ED9B795D5C5}' + aspnetCoreVersion: "3.1" diff --git a/bin/configs/other/aspnetcore.yaml b/bin/configs/other/aspnetcore.yaml new file mode 100644 index 000000000000..71f2659e7b6b --- /dev/null +++ b/bin/configs/other/aspnetcore.yaml @@ -0,0 +1,6 @@ +generatorName: aspnetcore +outputDir: samples/server/petstore/aspnetcore +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/aspnetcore/2.1 +additionalProperties: + packageGuid: '{3C799344-F285-4669-8FD5-7ED9B795D5C5}' diff --git a/bin/configs/other/avro-schema.yaml b/bin/configs/other/avro-schema.yaml new file mode 100644 index 000000000000..bf44846dc07a --- /dev/null +++ b/bin/configs/other/avro-schema.yaml @@ -0,0 +1,4 @@ +generatorName: avro-schema +outputDir: samples/openapi3/schema/petstore/avro-schema +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/avro-schema diff --git a/bin/configs/other/bash.yaml b/bin/configs/other/bash.yaml new file mode 100644 index 000000000000..4ad33693827e --- /dev/null +++ b/bin/configs/other/bash.yaml @@ -0,0 +1,14 @@ +generatorName: bash +outputDir: samples/client/petstore/bash +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/bash +additionalProperties: + generateZshCompletion: true + hostEnvironmentVariable: PETSTORE_HOST + curlOptions: -sS --tlsv1.2 + apiKeyAuthEnvironmentVariable: PETSTORE_API_KEY + processMarkdown: true + basicAuthEnvironmentVariable: PETSTORE_BASIC_AUTH + scriptName: petstore-cli + generateBashCompletion: true + hideGenerationTimestamp: "true" diff --git a/bin/configs/other/c.yaml b/bin/configs/other/c.yaml new file mode 100644 index 000000000000..f622e7919a66 --- /dev/null +++ b/bin/configs/other/c.yaml @@ -0,0 +1,4 @@ +generatorName: c +outputDir: samples/client/petstore/c +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/C-libcurl diff --git a/bin/configs/other/clojure.yaml b/bin/configs/other/clojure.yaml new file mode 100644 index 000000000000..a34be0c30370 --- /dev/null +++ b/bin/configs/other/clojure.yaml @@ -0,0 +1,3 @@ +generatorName: clojure +outputDir: samples/client/petstore/clojure +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.json diff --git a/bin/configs/other/cpp-pistache-server-cpp-pistache.yaml b/bin/configs/other/cpp-pistache-server-cpp-pistache.yaml new file mode 100644 index 000000000000..4a0326357ef9 --- /dev/null +++ b/bin/configs/other/cpp-pistache-server-cpp-pistache.yaml @@ -0,0 +1,7 @@ +generatorName: cpp-pistache-server +outputDir: samples/server/petstore/cpp-pistache +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/cpp-pistache-server +additionalProperties: + useStructModel: "false" + addExternalLibs: "true" diff --git a/bin/configs/other/cpp-qt5-client.yaml b/bin/configs/other/cpp-qt5-client.yaml new file mode 100644 index 000000000000..dc36141b436b --- /dev/null +++ b/bin/configs/other/cpp-qt5-client.yaml @@ -0,0 +1,7 @@ +generatorName: cpp-qt5-client +outputDir: samples/client/petstore/cpp-qt5 +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/cpp-qt5-client +additionalProperties: + cppNamespace: test_namespace + modelNamePrefix: PFX diff --git a/bin/configs/other/cpp-restbed-server-cpp-restbed.yaml b/bin/configs/other/cpp-restbed-server-cpp-restbed.yaml new file mode 100644 index 000000000000..3f07a71ff073 --- /dev/null +++ b/bin/configs/other/cpp-restbed-server-cpp-restbed.yaml @@ -0,0 +1,3 @@ +generatorName: cpp-restbed-server +outputDir: samples/server/petstore/cpp-restbed +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml diff --git a/bin/configs/other/cpp-tizen.yaml b/bin/configs/other/cpp-tizen.yaml new file mode 100644 index 000000000000..5efd42127c18 --- /dev/null +++ b/bin/configs/other/cpp-tizen.yaml @@ -0,0 +1,4 @@ +generatorName: cpp-tizen +outputDir: samples/client/petstore/cpp-tizen +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/cpp-tizen-client diff --git a/bin/configs/other/cpp-ue4.yaml b/bin/configs/other/cpp-ue4.yaml new file mode 100644 index 000000000000..98df851e2d26 --- /dev/null +++ b/bin/configs/other/cpp-ue4.yaml @@ -0,0 +1,4 @@ +generatorName: cpp-ue4 +outputDir: samples/client/petstore/cpp-ue4 +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/cpp-ue4 diff --git a/bin/configs/other/csharp-OpenAPIClientNet35.yaml b/bin/configs/other/csharp-OpenAPIClientNet35.yaml new file mode 100644 index 000000000000..3851feda1034 --- /dev/null +++ b/bin/configs/other/csharp-OpenAPIClientNet35.yaml @@ -0,0 +1,6 @@ +generatorName: csharp +outputDir: samples/client/petstore/csharp/OpenAPIClientNet35 +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +additionalProperties: + targetFramework: v3.5 + packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' diff --git a/bin/configs/other/csharp-OpenAPIClientNet40.yaml b/bin/configs/other/csharp-OpenAPIClientNet40.yaml new file mode 100644 index 000000000000..57f5cd152450 --- /dev/null +++ b/bin/configs/other/csharp-OpenAPIClientNet40.yaml @@ -0,0 +1,6 @@ +generatorName: csharp +outputDir: samples/client/petstore/csharp/OpenAPIClientNet40 +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +additionalProperties: + targetFramework: v4.0 + packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' diff --git a/bin/configs/other/csharp-OpenAPIClientNetCoreProject.yaml b/bin/configs/other/csharp-OpenAPIClientNetCoreProject.yaml new file mode 100644 index 000000000000..8c41863eb0ed --- /dev/null +++ b/bin/configs/other/csharp-OpenAPIClientNetCoreProject.yaml @@ -0,0 +1,7 @@ +generatorName: csharp +outputDir: samples/client/petstore/csharp/OpenAPIClientNetCoreProject +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +additionalProperties: + targetFramework: netstandard1.3 + packageGuid: '{67035b31-f8e5-41a4-9673-954035084f7d}' + netCoreProjectFile: "true" diff --git a/bin/configs/other/csharp-OpenAPIClientNetStandard.yaml b/bin/configs/other/csharp-OpenAPIClientNetStandard.yaml new file mode 100644 index 000000000000..d2398251e289 --- /dev/null +++ b/bin/configs/other/csharp-OpenAPIClientNetStandard.yaml @@ -0,0 +1,6 @@ +generatorName: csharp +outputDir: samples/client/petstore/csharp/OpenAPIClientNetStandard +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +additionalProperties: + targetFramework: netstandard1.3 + packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' diff --git a/bin/configs/other/csharp-OpenAPIClientWithPropertyChanged.yaml b/bin/configs/other/csharp-OpenAPIClientWithPropertyChanged.yaml new file mode 100644 index 000000000000..1ff167e0536f --- /dev/null +++ b/bin/configs/other/csharp-OpenAPIClientWithPropertyChanged.yaml @@ -0,0 +1,7 @@ +generatorName: csharp +outputDir: samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +additionalProperties: + packageGuid: '{5CD900DE-8266-412F-A758-28E1F9C623D5}' + generatePropertyChanged: "true" + optionalEmitDefaultValues: "true" diff --git a/bin/configs/other/csharp-dotnet2-OpenAPIClient.yaml b/bin/configs/other/csharp-dotnet2-OpenAPIClient.yaml new file mode 100644 index 000000000000..76c07c772d6c --- /dev/null +++ b/bin/configs/other/csharp-dotnet2-OpenAPIClient.yaml @@ -0,0 +1,6 @@ +generatorName: csharp-dotnet2 +outputDir: samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/csharp-dotnet2 +additionalProperties: + hideGenerationTimestamp: "true" diff --git a/bin/configs/other/csharp-nancyfx-nancyfx-async.yaml b/bin/configs/other/csharp-nancyfx-nancyfx-async.yaml new file mode 100644 index 000000000000..ae5e4671753e --- /dev/null +++ b/bin/configs/other/csharp-nancyfx-nancyfx-async.yaml @@ -0,0 +1,7 @@ +generatorName: csharp-nancyfx +outputDir: samples/server/petstore/nancyfx-async +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/csharp-nancyfx +additionalProperties: + asyncServer: "true" + packageGuid: '{768B8DC6-54EE-4D40-9B20-7857E1D742A4}' diff --git a/bin/configs/other/csharp-nancyfx-nancyfx.yaml b/bin/configs/other/csharp-nancyfx-nancyfx.yaml new file mode 100644 index 000000000000..5fd6cdffafe3 --- /dev/null +++ b/bin/configs/other/csharp-nancyfx-nancyfx.yaml @@ -0,0 +1,7 @@ +generatorName: csharp-nancyfx +outputDir: samples/server/petstore/nancyfx +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/csharp-nancyfx +additionalProperties: + asyncServer: "false" + packageGuid: '{768B8DC6-54EE-4D40-9B20-7857E1D742A4}' diff --git a/bin/configs/other/cwiki.yaml b/bin/configs/other/cwiki.yaml new file mode 100644 index 000000000000..bc17eb304fec --- /dev/null +++ b/bin/configs/other/cwiki.yaml @@ -0,0 +1,4 @@ +generatorName: cwiki +outputDir: samples/documentation/cwiki +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/confluenceWikiDocs diff --git a/bin/configs/other/dart-dio.yaml b/bin/configs/other/dart-dio.yaml new file mode 100644 index 000000000000..7013cbd4faea --- /dev/null +++ b/bin/configs/other/dart-dio.yaml @@ -0,0 +1,6 @@ +generatorName: dart-dio +outputDir: samples/client/petstore/dart-dio +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/dart-dio +additionalProperties: + hideGenerationTimestamp: "true" diff --git a/bin/configs/other/dynamic-html.yaml b/bin/configs/other/dynamic-html.yaml new file mode 100644 index 000000000000..70904c511e1b --- /dev/null +++ b/bin/configs/other/dynamic-html.yaml @@ -0,0 +1,3 @@ +generatorName: dynamic-html +outputDir: samples/documentation/dynamic-html +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml diff --git a/bin/configs/other/eiffel.yaml b/bin/configs/other/eiffel.yaml new file mode 100644 index 000000000000..07a626622422 --- /dev/null +++ b/bin/configs/other/eiffel.yaml @@ -0,0 +1,3 @@ +generatorName: eiffel +outputDir: samples/client/petstore/eiffel +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml diff --git a/bin/configs/other/erlang-client.yaml b/bin/configs/other/erlang-client.yaml new file mode 100644 index 000000000000..27f1bdefe89a --- /dev/null +++ b/bin/configs/other/erlang-client.yaml @@ -0,0 +1,6 @@ +generatorName: erlang-client +outputDir: samples/client/petstore/erlang-client +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/erlang-client +additionalProperties: + packageName: petstore diff --git a/bin/configs/other/erlang-proper.yaml b/bin/configs/other/erlang-proper.yaml new file mode 100644 index 000000000000..efde38060cdf --- /dev/null +++ b/bin/configs/other/erlang-proper.yaml @@ -0,0 +1,6 @@ +generatorName: erlang-proper +outputDir: samples/client/petstore/erlang-proper +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/erlang-proper +additionalProperties: + packageName: petstore diff --git a/bin/configs/other/erlang-server.yaml b/bin/configs/other/erlang-server.yaml new file mode 100644 index 000000000000..043ec4ffa73e --- /dev/null +++ b/bin/configs/other/erlang-server.yaml @@ -0,0 +1,4 @@ +generatorName: erlang-server +outputDir: samples/server/petstore/erlang-server +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/erlang-server diff --git a/bin/configs/other/flash.yaml b/bin/configs/other/flash.yaml new file mode 100644 index 000000000000..167b8ee89f36 --- /dev/null +++ b/bin/configs/other/flash.yaml @@ -0,0 +1,7 @@ +generatorName: flash +outputDir: samples/client/petstore/flash +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/flash +additionalProperties: + invokerPackage: org.openapitools + packageName: org.openapitools diff --git a/bin/configs/other/fsharp-functions.yaml b/bin/configs/other/fsharp-functions.yaml new file mode 100644 index 000000000000..d88cc1652845 --- /dev/null +++ b/bin/configs/other/fsharp-functions.yaml @@ -0,0 +1,3 @@ +generatorName: fsharp-functions +outputDir: samples/server/petstore/fsharp-functions +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml diff --git a/bin/configs/other/fsharp-giraffe-server-fsharp-giraffe.yaml b/bin/configs/other/fsharp-giraffe-server-fsharp-giraffe.yaml new file mode 100644 index 000000000000..888826033046 --- /dev/null +++ b/bin/configs/other/fsharp-giraffe-server-fsharp-giraffe.yaml @@ -0,0 +1,4 @@ +generatorName: fsharp-giraffe-server +outputDir: samples/server/petstore/fsharp-giraffe +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/fsharp-giraffe-server diff --git a/bin/configs/other/graphql-nodejs-express-server.yaml b/bin/configs/other/graphql-nodejs-express-server.yaml new file mode 100644 index 000000000000..a26f6ad4448c --- /dev/null +++ b/bin/configs/other/graphql-nodejs-express-server.yaml @@ -0,0 +1,6 @@ +generatorName: graphql-nodejs-express-server +outputDir: samples/server/petstore/graphql-nodejs-express-server +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/graphql-nodejs-express-server +additionalProperties: + packageName: petstore diff --git a/bin/configs/other/graphql-schema.yaml b/bin/configs/other/graphql-schema.yaml new file mode 100644 index 000000000000..2b019d74f637 --- /dev/null +++ b/bin/configs/other/graphql-schema.yaml @@ -0,0 +1,6 @@ +generatorName: graphql-schema +outputDir: samples/config/petstore/graphql-schema +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/graphql-schema +additionalProperties: + packageName: petstore diff --git a/bin/configs/other/haskell-servant.yaml b/bin/configs/other/haskell-servant.yaml new file mode 100644 index 000000000000..1419e5490979 --- /dev/null +++ b/bin/configs/other/haskell-servant.yaml @@ -0,0 +1,4 @@ +generatorName: haskell +outputDir: samples/server/petstore/haskell-servant +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/haskell-servant diff --git a/bin/configs/other/html.md.yaml b/bin/configs/other/html.md.yaml new file mode 100644 index 000000000000..31bb5790c9d4 --- /dev/null +++ b/bin/configs/other/html.md.yaml @@ -0,0 +1,3 @@ +generatorName: html +outputDir: samples/documentation/html.md +inputSpec: modules/openapi-generator/src/test/resources/2_0/markdown.yaml diff --git a/bin/configs/other/html.yaml b/bin/configs/other/html.yaml new file mode 100644 index 000000000000..ea24dcbd4b92 --- /dev/null +++ b/bin/configs/other/html.yaml @@ -0,0 +1,4 @@ +generatorName: html +outputDir: samples/documentation/html +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/htmlDocs diff --git a/bin/configs/other/html2.yaml b/bin/configs/other/html2.yaml new file mode 100644 index 000000000000..09022fd5fbc7 --- /dev/null +++ b/bin/configs/other/html2.yaml @@ -0,0 +1,6 @@ +generatorName: html2 +outputDir: samples/documentation/html2 +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/htmlDocs2 +additionalProperties: + hideGenerationTimestamp: "true" diff --git a/bin/configs/other/java-inflector.yaml b/bin/configs/other/java-inflector.yaml new file mode 100644 index 000000000000..d7a88695aca7 --- /dev/null +++ b/bin/configs/other/java-inflector.yaml @@ -0,0 +1,6 @@ +generatorName: java-inflector +outputDir: samples/server/petstore/java-inflector +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaInflector +additionalProperties: + hideGenerationTimestamp: "true" diff --git a/bin/configs/other/java-native-async.yaml b/bin/configs/other/java-native-async.yaml new file mode 100644 index 000000000000..eb95d524a291 --- /dev/null +++ b/bin/configs/other/java-native-async.yaml @@ -0,0 +1,9 @@ +generatorName: java +outputDir: samples/client/petstore/java/native-async +library: native +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/Java +additionalProperties: + artifactId: petstore-native + hideGenerationTimestamp: "true" + asyncNative: "true" diff --git a/bin/configs/other/java-pkmst.yaml b/bin/configs/other/java-pkmst.yaml new file mode 100644 index 000000000000..4d428c3679c5 --- /dev/null +++ b/bin/configs/other/java-pkmst.yaml @@ -0,0 +1,6 @@ +generatorName: java-pkmst +outputDir: samples/server/petstore/java-pkmst +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/java-pkmst +additionalProperties: + hideGenerationTimestamp: "true" diff --git a/bin/configs/other/java-undertow-server-java-undertow.yaml b/bin/configs/other/java-undertow-server-java-undertow.yaml new file mode 100644 index 000000000000..2cbb1160f171 --- /dev/null +++ b/bin/configs/other/java-undertow-server-java-undertow.yaml @@ -0,0 +1,6 @@ +generatorName: java-undertow-server +outputDir: samples/server/petstore/java-undertow +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/java-undertow-server +additionalProperties: + hideGenerationTimestamp: "true" diff --git a/bin/configs/other/java-vertx-async.yaml b/bin/configs/other/java-vertx-async.yaml new file mode 100644 index 000000000000..e9eee5e8f64c --- /dev/null +++ b/bin/configs/other/java-vertx-async.yaml @@ -0,0 +1,6 @@ +generatorName: java-vertx +outputDir: samples/server/petstore/java-vertx/async +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +additionalProperties: + hideGenerationTimestamp: "true" + vertxSwaggerRouterVersion: 1.4.0 diff --git a/bin/configs/other/java-vertx-rx.yaml b/bin/configs/other/java-vertx-rx.yaml new file mode 100644 index 000000000000..af064e6cbaff --- /dev/null +++ b/bin/configs/other/java-vertx-rx.yaml @@ -0,0 +1,8 @@ +generatorName: java-vertx +outputDir: samples/server/petstore/java-vertx/rx +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +additionalProperties: + artifactId: java-vertx-rx-server + hideGenerationTimestamp: "true" + vertxSwaggerRouterVersion: 1.4.0 + rxInterface: "true" diff --git a/bin/configs/other/java-vertx-web-rx.yaml b/bin/configs/other/java-vertx-web-rx.yaml new file mode 100644 index 000000000000..609aade555ff --- /dev/null +++ b/bin/configs/other/java-vertx-web-rx.yaml @@ -0,0 +1,7 @@ +generatorName: java-vertx-web +outputDir: samples/server/petstore/java-vertx-web/rx +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaVertXWebServer +additionalProperties: + hideGenerationTimestamp: "true" + artifactId: java-vertx-web-rx-server diff --git a/bin/configs/other/javascript-apollo.yaml b/bin/configs/other/javascript-apollo.yaml new file mode 100644 index 000000000000..c462a622208d --- /dev/null +++ b/bin/configs/other/javascript-apollo.yaml @@ -0,0 +1,6 @@ +generatorName: javascript-apollo +outputDir: samples/client/petstore/javascript-apollo +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/Javascript-Apollo +additionalProperties: + appName: PetstoreClient diff --git a/bin/configs/other/javascript-closure-angular.yaml b/bin/configs/other/javascript-closure-angular.yaml new file mode 100644 index 000000000000..391b76b3e0b4 --- /dev/null +++ b/bin/configs/other/javascript-closure-angular.yaml @@ -0,0 +1,3 @@ +generatorName: javascript-closure-angular +outputDir: samples/client/petstore/javascript-closure-angular +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml diff --git a/bin/configs/other/javascript-flowtyped.yaml b/bin/configs/other/javascript-flowtyped.yaml new file mode 100644 index 000000000000..514f7fe1dfe0 --- /dev/null +++ b/bin/configs/other/javascript-flowtyped.yaml @@ -0,0 +1,6 @@ +generatorName: javascript-flowtyped +outputDir: samples/client/petstore/javascript-flowtyped +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/Javascript-Flowtyped +additionalProperties: + appName: PetstoreClient diff --git a/bin/configs/other/jaxrs-cxf-client.yaml b/bin/configs/other/jaxrs-cxf-client.yaml new file mode 100644 index 000000000000..26faac332b84 --- /dev/null +++ b/bin/configs/other/jaxrs-cxf-client.yaml @@ -0,0 +1,6 @@ +generatorName: jaxrs-cxf-client +outputDir: samples/client/petstore/jaxrs-cxf-client +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS/cxf +additionalProperties: + artifactId: jaxrs-cxf-petstore-client diff --git a/bin/configs/other/jaxrs-cxf-extended-jaxrs-cxf-test-data.yaml b/bin/configs/other/jaxrs-cxf-extended-jaxrs-cxf-test-data.yaml new file mode 100644 index 000000000000..c66a09deeeb3 --- /dev/null +++ b/bin/configs/other/jaxrs-cxf-extended-jaxrs-cxf-test-data.yaml @@ -0,0 +1,14 @@ +generatorName: jaxrs-cxf-extended +outputDir: samples/server/petstore/jaxrs-cxf-test-data +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext +generateAliasAsModel: true +additionalProperties: + java8: "true" + generateOperationBody: "true" + useAnnotatedBasePath: "true" + generateSpringBootApplication: "true" + artifactId: cxf-test-data + generateSpringApplication: "true" + hideGenerationTimestamp: "true" + loadTestDataFromFile: "true" diff --git a/bin/configs/other/jaxrs-spec-interface-response.yaml b/bin/configs/other/jaxrs-spec-interface-response.yaml new file mode 100644 index 000000000000..c3227e7e82e3 --- /dev/null +++ b/bin/configs/other/jaxrs-spec-interface-response.yaml @@ -0,0 +1,9 @@ +generatorName: jaxrs-spec +outputDir: samples/server/petstore/jaxrs-spec-interface-response +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +additionalProperties: + artifactId: jaxrs-spec-interface-response-petstore-server + interfaceOnly: "true" + serializableModel: "true" + hideGenerationTimestamp: "true" + returnResponse: "true" diff --git a/bin/configs/other/jmeter.yaml b/bin/configs/other/jmeter.yaml new file mode 100644 index 000000000000..fb9e359ffb56 --- /dev/null +++ b/bin/configs/other/jmeter.yaml @@ -0,0 +1,3 @@ +generatorName: jmeter +outputDir: samples/client/petstore/jmeter +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml diff --git a/bin/configs/other/k6.yaml b/bin/configs/other/k6.yaml new file mode 100644 index 000000000000..f1a6c1d5b23c --- /dev/null +++ b/bin/configs/other/k6.yaml @@ -0,0 +1,3 @@ +generatorName: k6 +outputDir: samples/client/petstore/k6 +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml diff --git a/bin/configs/other/kotlin-spring-boot-modelMutable.yaml b/bin/configs/other/kotlin-spring-boot-modelMutable.yaml new file mode 100644 index 000000000000..ca3623d059eb --- /dev/null +++ b/bin/configs/other/kotlin-spring-boot-modelMutable.yaml @@ -0,0 +1,11 @@ +generatorName: kotlin-spring +outputDir: samples/server/petstore/kotlin-springboot-modelMutable +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/kotlin-spring +additionalProperties: + library: spring-boot + serializableModel: "true" + swaggerAnnotations: "true" + serviceImplementation: "true" + beanValidations: "true" + modelMutable: "true" diff --git a/bin/configs/other/kotlin-uppercase-enum.yaml b/bin/configs/other/kotlin-uppercase-enum.yaml new file mode 100644 index 000000000000..b3501dd8af9d --- /dev/null +++ b/bin/configs/other/kotlin-uppercase-enum.yaml @@ -0,0 +1,7 @@ +generatorName: kotlin +outputDir: samples/client/petstore/kotlin-uppercase-enum +inputSpec: modules/openapi-generator/src/test/resources/3_0/issue-4062.yaml +templateDir: modules/openapi-generator/src/main/resources/kotlin-client +additionalProperties: + artifactId: kotlin-uppercase-enum + enumPropertyNaming: UPPERCASE diff --git a/bin/configs/other/kotlin-vertx-vertx.yaml b/bin/configs/other/kotlin-vertx-vertx.yaml new file mode 100644 index 000000000000..83660b6c78f0 --- /dev/null +++ b/bin/configs/other/kotlin-vertx-vertx.yaml @@ -0,0 +1,5 @@ +generatorName: kotlin-vertx +outputDir: samples/server/petstore/kotlin/vertx +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +additionalProperties: + modelMutable: "false" diff --git a/bin/configs/other/markdown.yaml b/bin/configs/other/markdown.yaml new file mode 100644 index 000000000000..9b490267160d --- /dev/null +++ b/bin/configs/other/markdown.yaml @@ -0,0 +1,4 @@ +generatorName: markdown +outputDir: samples/documentation/markdown +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/markdown-documentation diff --git a/bin/configs/other/nodejs-express-server.yaml b/bin/configs/other/nodejs-express-server.yaml new file mode 100644 index 000000000000..96c577ffacbe --- /dev/null +++ b/bin/configs/other/nodejs-express-server.yaml @@ -0,0 +1,4 @@ +generatorName: nodejs-express-server +outputDir: samples/server/petstore/nodejs-express-server +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/nodejs-express-server diff --git a/bin/configs/other/objc-core-data.yaml b/bin/configs/other/objc-core-data.yaml new file mode 100644 index 000000000000..08560dd34dbb --- /dev/null +++ b/bin/configs/other/objc-core-data.yaml @@ -0,0 +1,8 @@ +generatorName: objc +outputDir: samples/client/petstore/objc/core-data +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.json +templateDir: modules/openapi-generator/src/main/resources/objc +additionalProperties: + classPrefix: SWG + podName: SwaggerClient + coreData: "true" diff --git a/bin/configs/other/objc-default.yaml b/bin/configs/other/objc-default.yaml new file mode 100644 index 000000000000..c2a1e34fd835 --- /dev/null +++ b/bin/configs/other/objc-default.yaml @@ -0,0 +1,7 @@ +generatorName: objc +outputDir: samples/client/petstore/objc/default +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.json +templateDir: modules/openapi-generator/src/main/resources/objc +additionalProperties: + classPrefix: SWG + podName: SwaggerClient diff --git a/bin/configs/other/ocaml.yaml b/bin/configs/other/ocaml.yaml new file mode 100644 index 000000000000..1933d84fb7d7 --- /dev/null +++ b/bin/configs/other/ocaml.yaml @@ -0,0 +1,6 @@ +generatorName: ocaml +outputDir: samples/client/petstore/ocaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/ocaml +additionalProperties: + packageName: petstore_client diff --git a/bin/configs/other/openapi3/android-httpclient.yaml b/bin/configs/other/openapi3/android-httpclient.yaml new file mode 100644 index 000000000000..32e253e0b8df --- /dev/null +++ b/bin/configs/other/openapi3/android-httpclient.yaml @@ -0,0 +1,6 @@ +generatorName: android +outputDir: samples/client/petstore/android/httpclient +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/android +additionalProperties: + library: httpclient diff --git a/bin/configs/other/openapi3/android-volley.yaml b/bin/configs/other/openapi3/android-volley.yaml new file mode 100644 index 000000000000..4903967ef33a --- /dev/null +++ b/bin/configs/other/openapi3/android-volley.yaml @@ -0,0 +1,6 @@ +generatorName: android +outputDir: samples/client/petstore/android/volley +library: volley +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +additionalProperties: + artifactId: petstore-android-volley diff --git a/bin/configs/other/openapi3/avro-schema.yaml b/bin/configs/other/openapi3/avro-schema.yaml new file mode 100644 index 000000000000..bf44846dc07a --- /dev/null +++ b/bin/configs/other/openapi3/avro-schema.yaml @@ -0,0 +1,4 @@ +generatorName: avro-schema +outputDir: samples/openapi3/schema/petstore/avro-schema +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/avro-schema diff --git a/bin/configs/other/openapi3/bash.yaml b/bin/configs/other/openapi3/bash.yaml new file mode 100644 index 000000000000..04de158b3fcb --- /dev/null +++ b/bin/configs/other/openapi3/bash.yaml @@ -0,0 +1,14 @@ +generatorName: bash +outputDir: samples/client/petstore/bash +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/bash +additionalProperties: + generateZshCompletion: true + hostEnvironmentVariable: PETSTORE_HOST + curlOptions: -sS --tlsv1.2 + apiKeyAuthEnvironmentVariable: PETSTORE_API_KEY + processMarkdown: true + basicAuthEnvironmentVariable: PETSTORE_BASIC_AUTH + scriptName: petstore-cli + generateBashCompletion: true + hideGenerationTimestamp: "true" diff --git a/bin/configs/other/openapi3/clojure.yaml b/bin/configs/other/openapi3/clojure.yaml new file mode 100644 index 000000000000..718503526fc4 --- /dev/null +++ b/bin/configs/other/openapi3/clojure.yaml @@ -0,0 +1,3 @@ +generatorName: clojure +outputDir: samples/client/petstore/clojure +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.json diff --git a/bin/configs/other/openapi3/cpp-pistache-server-cpp-pistache.yaml b/bin/configs/other/openapi3/cpp-pistache-server-cpp-pistache.yaml new file mode 100644 index 000000000000..4faabff095db --- /dev/null +++ b/bin/configs/other/openapi3/cpp-pistache-server-cpp-pistache.yaml @@ -0,0 +1,4 @@ +generatorName: cpp-pistache-server +outputDir: samples/server/petstore/cpp-pistache +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/cpp-pistache-server diff --git a/bin/configs/other/openapi3/cpp-qt5-client-cpp-qt5.yaml b/bin/configs/other/openapi3/cpp-qt5-client-cpp-qt5.yaml new file mode 100644 index 000000000000..904d99a75102 --- /dev/null +++ b/bin/configs/other/openapi3/cpp-qt5-client-cpp-qt5.yaml @@ -0,0 +1,4 @@ +generatorName: cpp-qt5-client +outputDir: samples/client/petstore/cpp-qt5 +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/cpp-qt5-client diff --git a/bin/configs/other/openapi3/cpp-qt5-qhttpengine-server.yaml b/bin/configs/other/openapi3/cpp-qt5-qhttpengine-server.yaml new file mode 100644 index 000000000000..285c0d9d5ddd --- /dev/null +++ b/bin/configs/other/openapi3/cpp-qt5-qhttpengine-server.yaml @@ -0,0 +1,4 @@ +generatorName: cpp-qt5-qhttpengine-server +outputDir: samples/client/petstore/cpp-qt5-qhttpengine-server +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server diff --git a/bin/configs/other/openapi3/cpp-restbed-server-cpp-restbed.yaml b/bin/configs/other/openapi3/cpp-restbed-server-cpp-restbed.yaml new file mode 100644 index 000000000000..8e653b8a6402 --- /dev/null +++ b/bin/configs/other/openapi3/cpp-restbed-server-cpp-restbed.yaml @@ -0,0 +1,3 @@ +generatorName: cpp-restbed-server +outputDir: samples/server/petstore/cpp-restbed +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml diff --git a/bin/configs/other/openapi3/cpp-tizen.yaml b/bin/configs/other/openapi3/cpp-tizen.yaml new file mode 100644 index 000000000000..4f8d0e2a8c53 --- /dev/null +++ b/bin/configs/other/openapi3/cpp-tizen.yaml @@ -0,0 +1,4 @@ +generatorName: cpp-tizen +outputDir: samples/client/petstore/cpp-tizen +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/cpp-tizen-client diff --git a/bin/configs/other/openapi3/csharp-OpenAPIClient.yaml b/bin/configs/other/openapi3/csharp-OpenAPIClient.yaml new file mode 100644 index 000000000000..84c5cc5af418 --- /dev/null +++ b/bin/configs/other/openapi3/csharp-OpenAPIClient.yaml @@ -0,0 +1,5 @@ +generatorName: csharp +outputDir: samples/openapi3/client/petstore/csharp/OpenAPIClient +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +additionalProperties: + packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' diff --git a/bin/configs/other/openapi3/csharp-OpenAPIClientNetStandard.yaml b/bin/configs/other/openapi3/csharp-OpenAPIClientNetStandard.yaml new file mode 100644 index 000000000000..64635629d27f --- /dev/null +++ b/bin/configs/other/openapi3/csharp-OpenAPIClientNetStandard.yaml @@ -0,0 +1,6 @@ +generatorName: csharp +outputDir: samples/client/petstore/csharp/OpenAPIClientNetStandard +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +additionalProperties: + targetFramework: netstandard1.3 + packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' diff --git a/bin/configs/other/openapi3/csharp-OpenAPIClientWithPropertyChanged.yaml b/bin/configs/other/openapi3/csharp-OpenAPIClientWithPropertyChanged.yaml new file mode 100644 index 000000000000..22b05d0dbbea --- /dev/null +++ b/bin/configs/other/openapi3/csharp-OpenAPIClientWithPropertyChanged.yaml @@ -0,0 +1,7 @@ +generatorName: csharp +outputDir: samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +additionalProperties: + packageGuid: '{5CD900DE-8266-412F-A758-28E1F9C623D5}' + generatePropertyChanged: "true" + optionalEmitDefaultValues: "true" diff --git a/bin/configs/other/openapi3/csharp-dotnet2-OpenAPIClient.yaml b/bin/configs/other/openapi3/csharp-dotnet2-OpenAPIClient.yaml new file mode 100644 index 000000000000..fa474d2f56ff --- /dev/null +++ b/bin/configs/other/openapi3/csharp-dotnet2-OpenAPIClient.yaml @@ -0,0 +1,5 @@ +generatorName: csharp-dotnet2 +outputDir: samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +additionalProperties: + hideGenerationTimestamp: "true" diff --git a/bin/configs/other/openapi3/elixir.yaml b/bin/configs/other/openapi3/elixir.yaml new file mode 100644 index 000000000000..79dd519cb1b6 --- /dev/null +++ b/bin/configs/other/openapi3/elixir.yaml @@ -0,0 +1,4 @@ +generatorName: elixir +outputDir: samples/client/petstore/elixir +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/elixir diff --git a/bin/configs/other/openapi3/flash.yaml b/bin/configs/other/openapi3/flash.yaml new file mode 100644 index 000000000000..52ed771332dc --- /dev/null +++ b/bin/configs/other/openapi3/flash.yaml @@ -0,0 +1,7 @@ +generatorName: flash +outputDir: samples/client/petstore/flash +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/flash +additionalProperties: + invokerPackage: org.openapitools + packageName: org.openapitools diff --git a/bin/configs/other/openapi3/go-gin-server-go-gin-api-server.yaml b/bin/configs/other/openapi3/go-gin-server-go-gin-api-server.yaml new file mode 100644 index 000000000000..81932e5d67ad --- /dev/null +++ b/bin/configs/other/openapi3/go-gin-server-go-gin-api-server.yaml @@ -0,0 +1,7 @@ +generatorName: go-gin-server +outputDir: samples/openapi3/server/petstore/go-gin-api-server +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/go-gin-server +additionalProperties: + hideGenerationTimestamp: "true" + packageName: petstoreserver diff --git a/bin/configs/other/openapi3/go-petstore.yaml b/bin/configs/other/openapi3/go-petstore.yaml new file mode 100644 index 000000000000..aefc71b9011f --- /dev/null +++ b/bin/configs/other/openapi3/go-petstore.yaml @@ -0,0 +1,7 @@ +generatorName: go +outputDir: samples/openapi3/client/petstore/go/go-petstore +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/go +additionalProperties: + enumClassPrefix: "true" + packageName: petstore diff --git a/bin/configs/other/openapi3/go-server-go-api-server.yaml b/bin/configs/other/openapi3/go-server-go-api-server.yaml new file mode 100644 index 000000000000..c5c85b26daa7 --- /dev/null +++ b/bin/configs/other/openapi3/go-server-go-api-server.yaml @@ -0,0 +1,7 @@ +generatorName: go-server +outputDir: samples/openapi3/server/petstore/go-api-server +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/go-server +additionalProperties: + hideGenerationTimestamp: "true" + packageName: petstoreserver diff --git a/bin/configs/other/openapi3/graphql-nodejs-express-server.yaml b/bin/configs/other/openapi3/graphql-nodejs-express-server.yaml new file mode 100644 index 000000000000..52f9f68d2391 --- /dev/null +++ b/bin/configs/other/openapi3/graphql-nodejs-express-server.yaml @@ -0,0 +1,6 @@ +generatorName: graphql-nodejs-express-server +outputDir: samples/server/petstore/graphql-nodejs-express-server +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/graphql-nodejs-express-server +additionalProperties: + packageName: petstore diff --git a/bin/configs/other/openapi3/haskell-http-client.yaml b/bin/configs/other/openapi3/haskell-http-client.yaml new file mode 100644 index 000000000000..7e16cbc5731f --- /dev/null +++ b/bin/configs/other/openapi3/haskell-http-client.yaml @@ -0,0 +1,4 @@ +generatorName: haskell-http-client +outputDir: samples/client/petstore/haskell-http-client +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/haskell-http-client diff --git a/bin/configs/other/openapi3/haskell-servant.yaml b/bin/configs/other/openapi3/haskell-servant.yaml new file mode 100644 index 000000000000..579db01c7f22 --- /dev/null +++ b/bin/configs/other/openapi3/haskell-servant.yaml @@ -0,0 +1,4 @@ +generatorName: haskell +outputDir: samples/server/petstore/haskell-servant +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/haskell-servant diff --git a/bin/configs/other/openapi3/javascript-closure-angular.yaml b/bin/configs/other/openapi3/javascript-closure-angular.yaml new file mode 100644 index 000000000000..5654e7ba5cde --- /dev/null +++ b/bin/configs/other/openapi3/javascript-closure-angular.yaml @@ -0,0 +1,3 @@ +generatorName: javascript-closure-angular +outputDir: samples/client/petstore/javascript-closure-angular +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml diff --git a/bin/configs/other/openapi3/jaxrs-cxf-client.yaml b/bin/configs/other/openapi3/jaxrs-cxf-client.yaml new file mode 100644 index 000000000000..08cb8cd0a603 --- /dev/null +++ b/bin/configs/other/openapi3/jaxrs-cxf-client.yaml @@ -0,0 +1,6 @@ +generatorName: jaxrs-cxf-client +outputDir: samples/client/petstore/jaxrs-cxf-client +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS/cxf +additionalProperties: + artifactId: jaxrs-cxf-petstore-client diff --git a/bin/configs/other/openapi3/kotlin-jvm-retrofit2-coroutines.yaml b/bin/configs/other/openapi3/kotlin-jvm-retrofit2-coroutines.yaml new file mode 100644 index 000000000000..b401e2737237 --- /dev/null +++ b/bin/configs/other/openapi3/kotlin-jvm-retrofit2-coroutines.yaml @@ -0,0 +1,11 @@ +generatorName: kotlin +outputDir: samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines +library: jvm-retrofit2 +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/kotlin-client +additionalProperties: + serializationLibrary: gson + useCoroutines: "true" + artifactId: kotlin-petstore-coroutines-client + serializableModel: "true" + dateLibrary: java8 diff --git a/bin/configs/other/openapi3/kotlin-jvm-retrofit2-rx.yaml b/bin/configs/other/openapi3/kotlin-jvm-retrofit2-rx.yaml new file mode 100644 index 000000000000..882aa38c7c53 --- /dev/null +++ b/bin/configs/other/openapi3/kotlin-jvm-retrofit2-rx.yaml @@ -0,0 +1,11 @@ +generatorName: kotlin +outputDir: samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx +library: jvm-retrofit2 +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/kotlin-client +additionalProperties: + serializationLibrary: gson + useRxJava: "true" + artifactId: kotlin-petstore-rx-client + serializableModel: "true" + dateLibrary: java8 diff --git a/bin/configs/other/openapi3/kotlin-jvm-retrofit2-rx2.yaml b/bin/configs/other/openapi3/kotlin-jvm-retrofit2-rx2.yaml new file mode 100644 index 000000000000..2332ff3be1f0 --- /dev/null +++ b/bin/configs/other/openapi3/kotlin-jvm-retrofit2-rx2.yaml @@ -0,0 +1,11 @@ +generatorName: kotlin +outputDir: samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2 +library: jvm-retrofit2 +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/kotlin-client +additionalProperties: + serializationLibrary: gson + useRxJava2: "true" + artifactId: kotlin-petstore-rx2-client + serializableModel: "true" + dateLibrary: java8 diff --git a/bin/configs/other/openapi3/kotlin-multiplatform.yaml b/bin/configs/other/openapi3/kotlin-multiplatform.yaml new file mode 100644 index 000000000000..befdb3e3dd69 --- /dev/null +++ b/bin/configs/other/openapi3/kotlin-multiplatform.yaml @@ -0,0 +1,7 @@ +generatorName: kotlin +outputDir: samples/openapi3/client/petstore/kotlin-multiplatform +library: multiplatform +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/kotlin-client +additionalProperties: + artifactId: kotlin-client-petstore-multiplatform diff --git a/bin/configs/other/openapi3/kotlin-spring-boot-reactive.yaml b/bin/configs/other/openapi3/kotlin-spring-boot-reactive.yaml new file mode 100644 index 000000000000..d0a726c99837 --- /dev/null +++ b/bin/configs/other/openapi3/kotlin-spring-boot-reactive.yaml @@ -0,0 +1,10 @@ +generatorName: kotlin-spring +outputDir: samples/openapi3/server/petstore/kotlin-springboot-reactive +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/kotlin-spring +additionalProperties: + serviceImplementation: "true" + library: spring-boot + reactive: "true" + swaggerAnnotations: "true" + beanValidations: "true" diff --git a/bin/configs/other/openapi3/kotlin-spring-boot.yaml b/bin/configs/other/openapi3/kotlin-spring-boot.yaml new file mode 100644 index 000000000000..a61d999a530f --- /dev/null +++ b/bin/configs/other/openapi3/kotlin-spring-boot.yaml @@ -0,0 +1,10 @@ +generatorName: kotlin-spring +outputDir: samples/openapi3/server/petstore/kotlin-springboot +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/kotlin-spring +additionalProperties: + serviceImplementation: "true" + library: spring-boot + serializableModel: "true" + swaggerAnnotations: "true" + beanValidations: "true" diff --git a/bin/configs/other/openapi3/kotlin.yaml b/bin/configs/other/openapi3/kotlin.yaml new file mode 100644 index 000000000000..526a8ef865ad --- /dev/null +++ b/bin/configs/other/openapi3/kotlin.yaml @@ -0,0 +1,8 @@ +generatorName: kotlin +outputDir: samples/openapi3/client/petstore/kotlin +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/kotlin-client +additionalProperties: + artifactId: kotlin-petstore-client + serializableModel: "true" + dateLibrary: java8 diff --git a/bin/configs/other/openapi3/objc-core-data.yaml b/bin/configs/other/openapi3/objc-core-data.yaml new file mode 100644 index 000000000000..7d3e047bc2d4 --- /dev/null +++ b/bin/configs/other/openapi3/objc-core-data.yaml @@ -0,0 +1,7 @@ +generatorName: objc +outputDir: samples/client/petstore/objc/core-data +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.json +templateDir: modules/openapi-generator/src/main/resources/objc +additionalProperties: + coreData: "true" + appName: PetstoreClient diff --git a/bin/configs/other/openapi3/objc-default.yaml b/bin/configs/other/openapi3/objc-default.yaml new file mode 100644 index 000000000000..fbdef1a0a22a --- /dev/null +++ b/bin/configs/other/openapi3/objc-default.yaml @@ -0,0 +1,6 @@ +generatorName: objc +outputDir: samples/client/petstore/objc/default +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.json +templateDir: modules/openapi-generator/src/main/resources/objc +additionalProperties: + appName: PetstoreClient diff --git a/bin/configs/other/openapi3/php-laravel.yaml b/bin/configs/other/openapi3/php-laravel.yaml new file mode 100644 index 000000000000..3a405cc67368 --- /dev/null +++ b/bin/configs/other/openapi3/php-laravel.yaml @@ -0,0 +1,4 @@ +generatorName: php-laravel +outputDir: samples/server/petstore/php-laravel +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/php-laravel diff --git a/bin/configs/other/openapi3/php-slim-deprecated-php-slim.yaml b/bin/configs/other/openapi3/php-slim-deprecated-php-slim.yaml new file mode 100644 index 000000000000..09147cbb6713 --- /dev/null +++ b/bin/configs/other/openapi3/php-slim-deprecated-php-slim.yaml @@ -0,0 +1,4 @@ +generatorName: php-slim-deprecated +outputDir: samples/server/petstore/php-slim +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/php-slim-server diff --git a/bin/configs/other/openapi3/php-slim4.yaml b/bin/configs/other/openapi3/php-slim4.yaml new file mode 100644 index 000000000000..a15c313a7720 --- /dev/null +++ b/bin/configs/other/openapi3/php-slim4.yaml @@ -0,0 +1,4 @@ +generatorName: php-slim4 +outputDir: samples/server/petstore/php-slim4 +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/php-slim4-server diff --git a/bin/configs/other/openapi3/php-symfony-SymfonyBundle-php.yaml b/bin/configs/other/openapi3/php-symfony-SymfonyBundle-php.yaml new file mode 100644 index 000000000000..ffb7015b6505 --- /dev/null +++ b/bin/configs/other/openapi3/php-symfony-SymfonyBundle-php.yaml @@ -0,0 +1,4 @@ +generatorName: php-symfony +outputDir: samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/php-symfony diff --git a/bin/configs/other/openapi3/python-flask-python2.yaml b/bin/configs/other/openapi3/python-flask-python2.yaml new file mode 100644 index 000000000000..407389d9121c --- /dev/null +++ b/bin/configs/other/openapi3/python-flask-python2.yaml @@ -0,0 +1,6 @@ +generatorName: python-flask +outputDir: samples/openapi3/server/petstore/python-flask-python2 +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-object-as-parameter.yaml +templateDir: modules/openapi-generator/src/main/resources/python-flask +additionalProperties: + supportPython2: true diff --git a/bin/configs/other/openapi3/python-flask.yaml b/bin/configs/other/openapi3/python-flask.yaml new file mode 100644 index 000000000000..aaca56bc6eec --- /dev/null +++ b/bin/configs/other/openapi3/python-flask.yaml @@ -0,0 +1,4 @@ +generatorName: python-flask +outputDir: samples/openapi3/server/petstore/python-flask +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-object-as-parameter.yaml +templateDir: modules/openapi-generator/src/main/resources/python-flask diff --git a/bin/configs/other/openapi3/r-R.yaml b/bin/configs/other/openapi3/r-R.yaml new file mode 100644 index 000000000000..61be8bc8f117 --- /dev/null +++ b/bin/configs/other/openapi3/r-R.yaml @@ -0,0 +1,6 @@ +generatorName: r +outputDir: samples/client/petstore/R +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/r +additionalProperties: + packageName: petstore diff --git a/bin/configs/other/openapi3/rust.yaml b/bin/configs/other/openapi3/rust.yaml new file mode 100644 index 000000000000..bb987820088a --- /dev/null +++ b/bin/configs/other/openapi3/rust.yaml @@ -0,0 +1,6 @@ +generatorName: rust +outputDir: samples/client/petstore/rust +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/rust +additionalProperties: + packageName: petstore_client diff --git a/bin/configs/other/openapi3/scala-finch.yaml b/bin/configs/other/openapi3/scala-finch.yaml new file mode 100644 index 000000000000..3a9e69e674f4 --- /dev/null +++ b/bin/configs/other/openapi3/scala-finch.yaml @@ -0,0 +1,4 @@ +generatorName: scala-finch +outputDir: samples/server/petstore/scala-finch +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/scala-finch diff --git a/bin/configs/other/openapi3/typescript-angular-default.yaml b/bin/configs/other/openapi3/typescript-angular-default.yaml new file mode 100644 index 000000000000..b9c8bb045b9b --- /dev/null +++ b/bin/configs/other/openapi3/typescript-angular-default.yaml @@ -0,0 +1,5 @@ +generatorName: typescript-angular +outputDir: samples/client/petstore/typescript-angular-v2/default +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +additionalProperties: + ngVersion: "2" diff --git a/bin/configs/other/openapi3/typescript-angular-npm.yaml b/bin/configs/other/openapi3/typescript-angular-npm.yaml new file mode 100644 index 000000000000..537555aab7ea --- /dev/null +++ b/bin/configs/other/openapi3/typescript-angular-npm.yaml @@ -0,0 +1,9 @@ +generatorName: typescript-angular +outputDir: samples/client/petstore/typescript-angular-v4.3/npm +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +additionalProperties: + npmVersion: 0.0.1 + ngVersion: "4.3" + npmName: '@openapitools/angular2-typescript-petstore' + npmRepository: https://skimdb.npmjs.com/registry + snapshot: false diff --git a/bin/configs/other/openapi3/typescript-angular-with-interfaces.yaml b/bin/configs/other/openapi3/typescript-angular-with-interfaces.yaml new file mode 100644 index 000000000000..a0f7e7de6558 --- /dev/null +++ b/bin/configs/other/openapi3/typescript-angular-with-interfaces.yaml @@ -0,0 +1,6 @@ +generatorName: typescript-angular +outputDir: samples/client/petstore/typescript-angular-v2/with-interfaces +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +additionalProperties: + withInterfaces: "true" + ngVersion: "2" diff --git a/bin/configs/other/openapi3/typescript-angularjs.yaml b/bin/configs/other/openapi3/typescript-angularjs.yaml new file mode 100644 index 000000000000..c379fa2ac6fc --- /dev/null +++ b/bin/configs/other/openapi3/typescript-angularjs.yaml @@ -0,0 +1,3 @@ +generatorName: typescript-angularjs +outputDir: samples/client/petstore/typescript-angularjs +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml diff --git a/bin/configs/other/openapi3/typescript-aurelia-default.yaml b/bin/configs/other/openapi3/typescript-aurelia-default.yaml new file mode 100644 index 000000000000..9a8fd34ad166 --- /dev/null +++ b/bin/configs/other/openapi3/typescript-aurelia-default.yaml @@ -0,0 +1,3 @@ +generatorName: typescript-aurelia +outputDir: samples/client/petstore/typescript-aurelia/default +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml diff --git a/bin/configs/other/openapi3/typescript-fetch-default.yaml b/bin/configs/other/openapi3/typescript-fetch-default.yaml new file mode 100644 index 000000000000..d7d60dee382b --- /dev/null +++ b/bin/configs/other/openapi3/typescript-fetch-default.yaml @@ -0,0 +1,3 @@ +generatorName: typescript-fetch +outputDir: samples/client/petstore/typescript-fetch/builds/default +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml diff --git a/bin/configs/other/openapi3/typescript-fetch-es6-target.yaml b/bin/configs/other/openapi3/typescript-fetch-es6-target.yaml new file mode 100644 index 000000000000..b62b1c17ffa0 --- /dev/null +++ b/bin/configs/other/openapi3/typescript-fetch-es6-target.yaml @@ -0,0 +1,9 @@ +generatorName: typescript-fetch +outputDir: samples/client/petstore/typescript-fetch/builds/es6-target +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +additionalProperties: + npmVersion: 1.0.0 + supportsES6: true + npmName: '@openapitools/typescript-fetch-petstore' + npmRepository: https://skimdb.npmjs.com/registry + snapshot: false diff --git a/bin/configs/other/openapi3/typescript-fetch-with-interfaces.yaml b/bin/configs/other/openapi3/typescript-fetch-with-interfaces.yaml new file mode 100644 index 000000000000..9db3697aba31 --- /dev/null +++ b/bin/configs/other/openapi3/typescript-fetch-with-interfaces.yaml @@ -0,0 +1,5 @@ +generatorName: typescript-fetch +outputDir: samples/client/petstore/typescript-fetch/builds/with-interfaces +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +additionalProperties: + withInterfaces: "true" diff --git a/bin/configs/other/openapi3/typescript-fetch-with-npm-version.yaml b/bin/configs/other/openapi3/typescript-fetch-with-npm-version.yaml new file mode 100644 index 000000000000..337538857da3 --- /dev/null +++ b/bin/configs/other/openapi3/typescript-fetch-with-npm-version.yaml @@ -0,0 +1,8 @@ +generatorName: typescript-fetch +outputDir: samples/client/petstore/typescript-fetch/builds/with-npm-version +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +additionalProperties: + npmVersion: 1.0.0 + npmName: '@openapitools/typescript-fetch-petstore' + npmRepository: https://skimdb.npmjs.com/registry + snapshot: false diff --git a/bin/configs/other/openapi3/typescript-inversify.yaml b/bin/configs/other/openapi3/typescript-inversify.yaml new file mode 100644 index 000000000000..a7b55a504566 --- /dev/null +++ b/bin/configs/other/openapi3/typescript-inversify.yaml @@ -0,0 +1,3 @@ +generatorName: typescript-inversify +outputDir: samples/client/petstore/typescript-inversify +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml diff --git a/bin/configs/other/openapi3/typescript-jquery-default.yaml b/bin/configs/other/openapi3/typescript-jquery-default.yaml new file mode 100644 index 000000000000..54c50bae2aa7 --- /dev/null +++ b/bin/configs/other/openapi3/typescript-jquery-default.yaml @@ -0,0 +1,3 @@ +generatorName: typescript-jquery +outputDir: samples/client/petstore/typescript-jquery/default +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml diff --git a/bin/configs/other/openapi3/typescript-jquery-npm.yaml b/bin/configs/other/openapi3/typescript-jquery-npm.yaml new file mode 100644 index 000000000000..fe44d227ec0f --- /dev/null +++ b/bin/configs/other/openapi3/typescript-jquery-npm.yaml @@ -0,0 +1,8 @@ +generatorName: typescript-jquery +outputDir: samples/client/petstore/typescript-jquery/npm +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +additionalProperties: + npmVersion: 0.0.1 + npmName: '@openapitools/jquery-typescript-petstore' + npmRepository: https://skimdb.npmjs.com/registry + snapshot: false diff --git a/bin/configs/other/openapi3/typescript-node-default.yaml b/bin/configs/other/openapi3/typescript-node-default.yaml new file mode 100644 index 000000000000..5b43b294fad0 --- /dev/null +++ b/bin/configs/other/openapi3/typescript-node-default.yaml @@ -0,0 +1,3 @@ +generatorName: typescript-node +outputDir: samples/client/petstore/typescript-node/default +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml diff --git a/bin/configs/other/openapi3/typescript-node-npm.yaml b/bin/configs/other/openapi3/typescript-node-npm.yaml new file mode 100644 index 000000000000..15fdb553618e --- /dev/null +++ b/bin/configs/other/openapi3/typescript-node-npm.yaml @@ -0,0 +1,8 @@ +generatorName: typescript-node +outputDir: samples/client/petstore/typescript-node/npm +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +additionalProperties: + npmVersion: 0.0.1 + npmName: '@openapitools/angular2-typescript-petstore' + npmRepository: https://skimdb.npmjs.com/registry + snapshot: false diff --git a/bin/configs/other/php-laravel.yaml b/bin/configs/other/php-laravel.yaml new file mode 100644 index 000000000000..1bc76c95f43c --- /dev/null +++ b/bin/configs/other/php-laravel.yaml @@ -0,0 +1,4 @@ +generatorName: php-laravel +outputDir: samples/server/petstore/php-laravel +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/php-laravel diff --git a/bin/configs/other/php-slim4.yaml b/bin/configs/other/php-slim4.yaml new file mode 100644 index 000000000000..86e4124ad87f --- /dev/null +++ b/bin/configs/other/php-slim4.yaml @@ -0,0 +1,4 @@ +generatorName: php-slim4 +outputDir: samples/server/petstore/php-slim4 +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/php-slim4-server diff --git a/bin/configs/other/plantuml.yaml b/bin/configs/other/plantuml.yaml new file mode 100644 index 000000000000..397fad4f643a --- /dev/null +++ b/bin/configs/other/plantuml.yaml @@ -0,0 +1,4 @@ +generatorName: plantuml +outputDir: samples/documentation/petstore/plantuml +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/plantuml diff --git a/bin/configs/other/powershell.yaml b/bin/configs/other/powershell.yaml new file mode 100644 index 000000000000..2ef633c994f4 --- /dev/null +++ b/bin/configs/other/powershell.yaml @@ -0,0 +1,11 @@ +generatorName: powershell +outputDir: samples/client/petstore/powershell +inputSpec: modules/openapi-generator/src/test/resources/3_0/powershell/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/powershell +additionalProperties: + packageGuid: a27b908d-2a20-467f-bc32-af6f3a654ac5 + commonVerbs: Delete=Remove:Patch=Update + packageVersion: 0.1.2 + packageName: PSPetstore + powershellGalleryUrl: https://www.powershellgallery.com/packages/PSPetstore + apiNamePrefix: PS diff --git a/bin/configs/other/protobuf-schema.yaml b/bin/configs/other/protobuf-schema.yaml new file mode 100644 index 000000000000..2b368f5d5005 --- /dev/null +++ b/bin/configs/other/protobuf-schema.yaml @@ -0,0 +1,6 @@ +generatorName: protobuf-schema +outputDir: samples/config/petstore/protobuf-schema +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/protobuf-schema +additionalProperties: + packageName: petstore diff --git a/bin/configs/other/ruby-on-rails.yaml b/bin/configs/other/ruby-on-rails.yaml new file mode 100644 index 000000000000..931c44baa00a --- /dev/null +++ b/bin/configs/other/ruby-on-rails.yaml @@ -0,0 +1,4 @@ +generatorName: ruby-on-rails +outputDir: samples/server/petstore/ruby-on-rails +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/ruby-on-rails-server diff --git a/bin/configs/other/ruby-sinatra.yaml b/bin/configs/other/ruby-sinatra.yaml new file mode 100644 index 000000000000..f612a023c306 --- /dev/null +++ b/bin/configs/other/ruby-sinatra.yaml @@ -0,0 +1,4 @@ +generatorName: ruby-sinatra +outputDir: samples/server/petstore/ruby-sinatra +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/ruby-sinatra-server diff --git a/bin/configs/other/rust-hyper-fileResponseTest.yaml b/bin/configs/other/rust-hyper-fileResponseTest.yaml new file mode 100644 index 000000000000..fc26c786be86 --- /dev/null +++ b/bin/configs/other/rust-hyper-fileResponseTest.yaml @@ -0,0 +1,9 @@ +generatorName: rust +outputDir: samples/client/petstore/rust/hyper/fileResponseTest +library: hyper +inputSpec: modules/openapi-generator/src/test/resources/2_0/fileResponseTest.json +templateDir: modules/openapi-generator/src/main/resources/rust +generateAliasAsModel: true +additionalProperties: + supportAsync: "false" + packageName: fileResponseTest-hyper diff --git a/bin/configs/other/rust-hyper-petstore.yaml b/bin/configs/other/rust-hyper-petstore.yaml new file mode 100644 index 000000000000..979b2f1fba94 --- /dev/null +++ b/bin/configs/other/rust-hyper-petstore.yaml @@ -0,0 +1,8 @@ +generatorName: rust +outputDir: samples/client/petstore/rust/hyper/petstore +library: hyper +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/rust +additionalProperties: + supportAsync: "false" + packageName: petstore-hyper diff --git a/bin/configs/other/rust-hyper-test.yaml b/bin/configs/other/rust-hyper-test.yaml new file mode 100644 index 000000000000..371d69150dd0 --- /dev/null +++ b/bin/configs/other/rust-hyper-test.yaml @@ -0,0 +1,8 @@ +generatorName: rust +outputDir: samples/client/petstore/rust/hyper/rust-test +library: hyper +inputSpec: modules/openapi-generator/src/test/resources/3_0/rust/rust-test.yaml +templateDir: modules/openapi-generator/src/main/resources/rust +additionalProperties: + supportAsync: "false" + packageName: rust-test-hyper diff --git a/bin/configs/other/rust-reqwest-fileResponseTest.yaml b/bin/configs/other/rust-reqwest-fileResponseTest.yaml new file mode 100644 index 000000000000..15aadb72170b --- /dev/null +++ b/bin/configs/other/rust-reqwest-fileResponseTest.yaml @@ -0,0 +1,8 @@ +generatorName: rust +outputDir: samples/client/petstore/rust/reqwest/fileResponseTest +library: reqwest +inputSpec: modules/openapi-generator/src/test/resources/2_0/fileResponseTest.json +templateDir: modules/openapi-generator/src/main/resources/rust +additionalProperties: + supportAsync: "false" + packageName: fileResponseTest-reqwest diff --git a/bin/configs/other/rust-reqwest-petstore-async.yaml b/bin/configs/other/rust-reqwest-petstore-async.yaml new file mode 100644 index 000000000000..0fb53b47d284 --- /dev/null +++ b/bin/configs/other/rust-reqwest-petstore-async.yaml @@ -0,0 +1,8 @@ +generatorName: rust +outputDir: samples/client/petstore/rust/reqwest/petstore-async +library: reqwest +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/rust +additionalProperties: + supportAsync: "true" + packageName: petstore-reqwest-async diff --git a/bin/configs/other/rust-reqwest-petstore.yaml b/bin/configs/other/rust-reqwest-petstore.yaml new file mode 100644 index 000000000000..1bc1d4c8667f --- /dev/null +++ b/bin/configs/other/rust-reqwest-petstore.yaml @@ -0,0 +1,8 @@ +generatorName: rust +outputDir: samples/client/petstore/rust/reqwest/petstore +library: reqwest +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/rust +additionalProperties: + supportAsync: "false" + packageName: petstore-reqwest diff --git a/bin/configs/other/rust-reqwest-test.yaml b/bin/configs/other/rust-reqwest-test.yaml new file mode 100644 index 000000000000..74dbb40a8129 --- /dev/null +++ b/bin/configs/other/rust-reqwest-test.yaml @@ -0,0 +1,8 @@ +generatorName: rust +outputDir: samples/client/petstore/rust/reqwest/rust-test +library: reqwest +inputSpec: modules/openapi-generator/src/test/resources/3_0/rust/rust-test.yaml +templateDir: modules/openapi-generator/src/main/resources/rust +additionalProperties: + supportAsync: "false" + packageName: rust-test-reqwest diff --git a/bin/configs/other/scala-akka-http-server.yaml b/bin/configs/other/scala-akka-http-server.yaml new file mode 100644 index 000000000000..f4c82c9b3406 --- /dev/null +++ b/bin/configs/other/scala-akka-http-server.yaml @@ -0,0 +1,3 @@ +generatorName: scala-akka-http-server +outputDir: samples/server/petstore/scala-akka-http-server +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml diff --git a/bin/configs/other/scala-finch.yaml b/bin/configs/other/scala-finch.yaml new file mode 100644 index 000000000000..4ec9a16b9f50 --- /dev/null +++ b/bin/configs/other/scala-finch.yaml @@ -0,0 +1,6 @@ +systemProperties: + skipFormModel: "true" +generatorName: scala-finch +outputDir: samples/server/petstore/scala-finch +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/scala-finch diff --git a/bin/configs/other/scala-gatling.yaml b/bin/configs/other/scala-gatling.yaml new file mode 100644 index 000000000000..19858a71e1c0 --- /dev/null +++ b/bin/configs/other/scala-gatling.yaml @@ -0,0 +1,4 @@ +generatorName: scala-gatling +outputDir: samples/client/petstore/scala-gatling +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/scala-gatling diff --git a/bin/configs/other/scala-httpclient-deprecated-scala-httpclient.yaml b/bin/configs/other/scala-httpclient-deprecated-scala-httpclient.yaml new file mode 100644 index 000000000000..45bfe59e5e15 --- /dev/null +++ b/bin/configs/other/scala-httpclient-deprecated-scala-httpclient.yaml @@ -0,0 +1,4 @@ +generatorName: scala-httpclient-deprecated +outputDir: samples/client/petstore/scala-httpclient +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/scala-httpclient diff --git a/bin/configs/other/scala-lagom-server.yaml b/bin/configs/other/scala-lagom-server.yaml new file mode 100644 index 000000000000..8aabf4b0fd08 --- /dev/null +++ b/bin/configs/other/scala-lagom-server.yaml @@ -0,0 +1,6 @@ +systemProperties: + skipFormModel: "true" +generatorName: scala-lagom-server +outputDir: samples/server/petstore/scala-lagom-server +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/scala-lagom-server diff --git a/bin/configs/other/scala-play-server.yaml b/bin/configs/other/scala-play-server.yaml new file mode 100644 index 000000000000..8d8d7ba70f6e --- /dev/null +++ b/bin/configs/other/scala-play-server.yaml @@ -0,0 +1,6 @@ +generatorName: scala-play-server +outputDir: samples/server/petstore/scala-play-server +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/scala-play-server +additionalProperties: + hideGenerationTimestamp: "true" diff --git a/bin/configs/other/scalatra.yaml b/bin/configs/other/scalatra.yaml new file mode 100644 index 000000000000..6445e10cd849 --- /dev/null +++ b/bin/configs/other/scalatra.yaml @@ -0,0 +1,4 @@ +generatorName: scalatra +outputDir: samples/server/petstore/scalatra +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/scalatra diff --git a/bin/configs/other/scalaz.yaml b/bin/configs/other/scalaz.yaml new file mode 100644 index 000000000000..3cb4834d03b8 --- /dev/null +++ b/bin/configs/other/scalaz.yaml @@ -0,0 +1,6 @@ +systemProperties: + skipFormModel: "true" +generatorName: scalaz +outputDir: samples/client/petstore/scalaz +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/scalaz diff --git a/bin/configs/other/swift5-alamofireLibrary.yaml b/bin/configs/other/swift5-alamofireLibrary.yaml new file mode 100644 index 000000000000..4c248326d53d --- /dev/null +++ b/bin/configs/other/swift5-alamofireLibrary.yaml @@ -0,0 +1,11 @@ +generatorName: swift5 +outputDir: samples/client/petstore/swift5/alamofireLibrary +library: alamofire +inputSpec: modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/swift5 +generateAliasAsModel: true +additionalProperties: + podAuthors: "" + podSummary: PetstoreClient + projectName: PetstoreClient + podHomepage: https://github.com/openapitools/openapi-generator diff --git a/bin/configs/other/swift5-combineLibrary.yaml b/bin/configs/other/swift5-combineLibrary.yaml new file mode 100644 index 000000000000..9456638acf93 --- /dev/null +++ b/bin/configs/other/swift5-combineLibrary.yaml @@ -0,0 +1,11 @@ +generatorName: swift5 +outputDir: samples/client/petstore/swift5/combineLibrary +inputSpec: modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/swift5 +generateAliasAsModel: true +additionalProperties: + responseAs: Combine + podAuthors: "" + podSummary: PetstoreClient + projectName: PetstoreClient + podHomepage: https://github.com/openapitools/openapi-generator diff --git a/bin/configs/other/swift5-default.yaml b/bin/configs/other/swift5-default.yaml new file mode 100644 index 000000000000..ede36e7331cf --- /dev/null +++ b/bin/configs/other/swift5-default.yaml @@ -0,0 +1,10 @@ +generatorName: swift5 +outputDir: samples/client/petstore/swift5/default +inputSpec: modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/swift5 +generateAliasAsModel: true +additionalProperties: + podAuthors: "" + podSummary: PetstoreClient + projectName: PetstoreClient + podHomepage: https://github.com/openapitools/openapi-generator diff --git a/bin/configs/other/swift5-deprecated.yaml b/bin/configs/other/swift5-deprecated.yaml new file mode 100644 index 000000000000..0b0206731342 --- /dev/null +++ b/bin/configs/other/swift5-deprecated.yaml @@ -0,0 +1,10 @@ +generatorName: swift5 +outputDir: samples/client/petstore/swift5/deprecated +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-depreacted-fields.yaml +templateDir: modules/openapi-generator/src/main/resources/swift5 +generateAliasAsModel: true +additionalProperties: + podAuthors: "" + podSummary: PetstoreClient + projectName: PetstoreClient + podHomepage: https://github.com/openapitools/openapi-generator diff --git a/bin/configs/other/swift5-nonPublicApi.yaml b/bin/configs/other/swift5-nonPublicApi.yaml new file mode 100644 index 000000000000..1aec2c3bb165 --- /dev/null +++ b/bin/configs/other/swift5-nonPublicApi.yaml @@ -0,0 +1,12 @@ +generatorName: swift5 +outputDir: samples/client/petstore/swift5/nonPublicApi +inputSpec: modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/swift5 +generateAliasAsModel: true +additionalProperties: + podAuthors: "" + podSummary: PetstoreClient + sortParamsByRequiredFlag: false + nonPublicApi: true + projectName: PetstoreClient + podHomepage: https://github.com/openapitools/openapi-generator diff --git a/bin/configs/other/swift5-objcCompatible.yaml b/bin/configs/other/swift5-objcCompatible.yaml new file mode 100644 index 000000000000..deb33907cc48 --- /dev/null +++ b/bin/configs/other/swift5-objcCompatible.yaml @@ -0,0 +1,11 @@ +generatorName: swift5 +outputDir: samples/client/petstore/swift5/objcCompatible +inputSpec: modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/swift5 +generateAliasAsModel: true +additionalProperties: + podAuthors: "" + podSummary: PetstoreClient + objcCompatible: true + projectName: PetstoreClient + podHomepage: https://github.com/openapitools/openapi-generator diff --git a/bin/configs/other/swift5-promisekitLibrary.yaml b/bin/configs/other/swift5-promisekitLibrary.yaml new file mode 100644 index 000000000000..5cdeb02ad29d --- /dev/null +++ b/bin/configs/other/swift5-promisekitLibrary.yaml @@ -0,0 +1,11 @@ +generatorName: swift5 +outputDir: samples/client/petstore/swift5/promisekitLibrary +inputSpec: modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/swift5 +generateAliasAsModel: true +additionalProperties: + responseAs: PromiseKit + podAuthors: "" + podSummary: PetstoreClient + projectName: PetstoreClient + podHomepage: https://github.com/openapitools/openapi-generator diff --git a/bin/configs/other/swift5-readonlyProperties.yaml b/bin/configs/other/swift5-readonlyProperties.yaml new file mode 100644 index 000000000000..0bb8b9d6f570 --- /dev/null +++ b/bin/configs/other/swift5-readonlyProperties.yaml @@ -0,0 +1,11 @@ +generatorName: swift5 +outputDir: samples/client/petstore/swift5/readonlyProperties +inputSpec: modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/swift5 +generateAliasAsModel: true +additionalProperties: + podAuthors: "" + podSummary: PetstoreClient + readonlyProperties: true + projectName: PetstoreClient + podHomepage: https://github.com/openapitools/openapi-generator diff --git a/bin/configs/other/swift5-resultLibrary.yaml b/bin/configs/other/swift5-resultLibrary.yaml new file mode 100644 index 000000000000..0f0e4373e2c5 --- /dev/null +++ b/bin/configs/other/swift5-resultLibrary.yaml @@ -0,0 +1,11 @@ +generatorName: swift5 +outputDir: samples/client/petstore/swift5/resultLibrary +inputSpec: modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/swift5 +generateAliasAsModel: true +additionalProperties: + responseAs: Result + podAuthors: "" + podSummary: PetstoreClient + projectName: PetstoreClient + podHomepage: https://github.com/openapitools/openapi-generator diff --git a/bin/configs/other/swift5-rxswiftLibrary.yaml b/bin/configs/other/swift5-rxswiftLibrary.yaml new file mode 100644 index 000000000000..f564ac3340cf --- /dev/null +++ b/bin/configs/other/swift5-rxswiftLibrary.yaml @@ -0,0 +1,11 @@ +generatorName: swift5 +outputDir: samples/client/petstore/swift5/rxswiftLibrary +inputSpec: modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/swift5 +generateAliasAsModel: true +additionalProperties: + responseAs: RxSwift + podAuthors: "" + podSummary: PetstoreClient + projectName: PetstoreClient + podHomepage: https://github.com/openapitools/openapi-generator diff --git a/bin/configs/other/swift5-urlsessionLibrary.yaml b/bin/configs/other/swift5-urlsessionLibrary.yaml new file mode 100644 index 000000000000..2fe5ecca0c7b --- /dev/null +++ b/bin/configs/other/swift5-urlsessionLibrary.yaml @@ -0,0 +1,11 @@ +generatorName: swift5 +outputDir: samples/client/petstore/swift5/urlsessionLibrary +library: urlsession +inputSpec: modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/swift5 +generateAliasAsModel: true +additionalProperties: + podAuthors: "" + podSummary: PetstoreClient + projectName: PetstoreClient + podHomepage: https://github.com/openapitools/openapi-generator diff --git a/bin/configs/other/typescript-redux-query-default.yaml b/bin/configs/other/typescript-redux-query-default.yaml new file mode 100644 index 000000000000..2cfab47ae961 --- /dev/null +++ b/bin/configs/other/typescript-redux-query-default.yaml @@ -0,0 +1,4 @@ +generatorName: typescript-redux-query +outputDir: samples/client/petstore/typescript-redux-query/builds/default +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/typescript-redux-query diff --git a/bin/configs/perl-deep_module_test.yaml b/bin/configs/perl-deep_module_test.yaml new file mode 100644 index 000000000000..7934a205a08b --- /dev/null +++ b/bin/configs/perl-deep_module_test.yaml @@ -0,0 +1,6 @@ +generatorName: perl +outputDir: samples/client/petstore/perl/deep_module_test +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +additionalProperties: + moduleName: Something::Deep + hideGenerationTimestamp: "true" diff --git a/bin/configs/perl.yaml b/bin/configs/perl.yaml new file mode 100644 index 000000000000..17575b85be0f --- /dev/null +++ b/bin/configs/perl.yaml @@ -0,0 +1,6 @@ +generatorName: perl +outputDir: samples/client/petstore/perl +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/perl +additionalProperties: + hideGenerationTimestamp: "true" diff --git a/bin/configs/php-OpenAPIClient-oas2.yaml b/bin/configs/php-OpenAPIClient-oas2.yaml new file mode 100644 index 000000000000..d8cf9859d8f5 --- /dev/null +++ b/bin/configs/php-OpenAPIClient-oas2.yaml @@ -0,0 +1,4 @@ +generatorName: php +outputDir: samples/client/petstore/php/OpenAPIClient-php +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/php diff --git a/bin/configs/php-OpenAPIClient.yaml b/bin/configs/php-OpenAPIClient.yaml new file mode 100644 index 000000000000..a930b52a0c90 --- /dev/null +++ b/bin/configs/php-OpenAPIClient.yaml @@ -0,0 +1,4 @@ +generatorName: php +outputDir: samples/openapi3/client/petstore/php/OpenAPIClient-php +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/php diff --git a/bin/configs/php-lumen.yaml b/bin/configs/php-lumen.yaml new file mode 100644 index 000000000000..b8c82bc52d04 --- /dev/null +++ b/bin/configs/php-lumen.yaml @@ -0,0 +1,4 @@ +generatorName: php-lumen +outputDir: samples/server/petstore/php-lumen +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/php-lumen diff --git a/bin/configs/php-silex-deprecated-OpenAPIServer.yaml b/bin/configs/php-silex-deprecated-OpenAPIServer.yaml new file mode 100644 index 000000000000..58e4b4fa1112 --- /dev/null +++ b/bin/configs/php-silex-deprecated-OpenAPIServer.yaml @@ -0,0 +1,4 @@ +generatorName: php-silex-deprecated +outputDir: samples/server/petstore/php-silex/OpenAPIServer +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/php-silex diff --git a/bin/configs/php-slim-deprecated-php-slim.yaml b/bin/configs/php-slim-deprecated-php-slim.yaml new file mode 100644 index 000000000000..62342a190f88 --- /dev/null +++ b/bin/configs/php-slim-deprecated-php-slim.yaml @@ -0,0 +1,4 @@ +generatorName: php-slim-deprecated +outputDir: samples/server/petstore/php-slim +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/php-slim-server diff --git a/bin/configs/php-symfony-SymfonyBundle-php.yaml b/bin/configs/php-symfony-SymfonyBundle-php.yaml new file mode 100644 index 000000000000..c77a71f14b7d --- /dev/null +++ b/bin/configs/php-symfony-SymfonyBundle-php.yaml @@ -0,0 +1,4 @@ +generatorName: php-symfony +outputDir: samples/server/petstore/php-symfony/SymfonyBundle-php +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/php-symfony diff --git a/bin/configs/php-ze-ph.yaml b/bin/configs/php-ze-ph.yaml new file mode 100644 index 000000000000..b3416dc196be --- /dev/null +++ b/bin/configs/php-ze-ph.yaml @@ -0,0 +1,4 @@ +generatorName: php-ze-ph +outputDir: samples/server/petstore/php-ze-ph +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/php-ze-ph diff --git a/bin/configs/python-aiohttp-srclayout.yaml b/bin/configs/python-aiohttp-srclayout.yaml new file mode 100644 index 000000000000..d376bbf63b8f --- /dev/null +++ b/bin/configs/python-aiohttp-srclayout.yaml @@ -0,0 +1,6 @@ +generatorName: python-aiohttp +outputDir: samples/server/petstore/python-aiohttp-srclayout +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/python-aiohttp +additionalProperties: + pythonSrcRoot: src diff --git a/bin/configs/python-aiohttp.yaml b/bin/configs/python-aiohttp.yaml new file mode 100644 index 000000000000..2a10c592ae38 --- /dev/null +++ b/bin/configs/python-aiohttp.yaml @@ -0,0 +1,4 @@ +generatorName: python-aiohttp +outputDir: samples/server/petstore/python-aiohttp +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/python-aiohttp diff --git a/bin/configs/python-asyncio.yaml b/bin/configs/python-asyncio.yaml new file mode 100644 index 000000000000..0a6adf4a2cbe --- /dev/null +++ b/bin/configs/python-asyncio.yaml @@ -0,0 +1,7 @@ +generatorName: python +outputDir: samples/client/petstore/python-asyncio +library: asyncio +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/python +additionalProperties: + packageName: petstore_api diff --git a/bin/configs/python-blueplanet.yaml b/bin/configs/python-blueplanet.yaml new file mode 100644 index 000000000000..eb38af7fefd9 --- /dev/null +++ b/bin/configs/python-blueplanet.yaml @@ -0,0 +1,4 @@ +generatorName: python-blueplanet +outputDir: samples/server/petstore/python-blueplanet +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/python-blueplanet diff --git a/bin/configs/python-experimental-oas2.yaml b/bin/configs/python-experimental-oas2.yaml new file mode 100644 index 000000000000..7328930e5970 --- /dev/null +++ b/bin/configs/python-experimental-oas2.yaml @@ -0,0 +1,7 @@ +generatorName: python-experimental +outputDir: samples/client/petstore/python-experimental +inputSpec: modules/openapi-generator/src/test/resources/2_0/python-client-experimental/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/python +additionalProperties: + disallowAdditionalPropertiesIfNotPresent: "true" + packageName: petstore_api diff --git a/bin/configs/python-experimental.yaml b/bin/configs/python-experimental.yaml new file mode 100644 index 000000000000..58aeadafa2c2 --- /dev/null +++ b/bin/configs/python-experimental.yaml @@ -0,0 +1,6 @@ +generatorName: python-experimental +outputDir: samples/openapi3/client/petstore/python-experimental +inputSpec: modules/openapi-generator/src/test/resources/3_0/python-experimental/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +templateDir: modules/openapi-generator/src/main/resources/python +additionalProperties: + packageName: petstore_api diff --git a/bin/configs/python-flask-python2.yaml b/bin/configs/python-flask-python2.yaml new file mode 100644 index 000000000000..156caf9c466a --- /dev/null +++ b/bin/configs/python-flask-python2.yaml @@ -0,0 +1,6 @@ +generatorName: python-flask +outputDir: samples/server/petstore/python-flask-python2 +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/python-flask +additionalProperties: + supportPython2: true diff --git a/bin/configs/python-flask.yaml b/bin/configs/python-flask.yaml new file mode 100644 index 000000000000..c8bc1d08f5d4 --- /dev/null +++ b/bin/configs/python-flask.yaml @@ -0,0 +1,4 @@ +generatorName: python-flask +outputDir: samples/server/petstore/python-flask +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/python-flask diff --git a/bin/configs/python-oas2.yaml b/bin/configs/python-oas2.yaml new file mode 100644 index 000000000000..68647095f4ee --- /dev/null +++ b/bin/configs/python-oas2.yaml @@ -0,0 +1,6 @@ +generatorName: python +outputDir: samples/client/petstore/python +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/python +additionalProperties: + packageName: petstore_api diff --git a/bin/configs/python-tornado.yaml b/bin/configs/python-tornado.yaml new file mode 100644 index 000000000000..6cee87a07f75 --- /dev/null +++ b/bin/configs/python-tornado.yaml @@ -0,0 +1,7 @@ +generatorName: python +outputDir: samples/client/petstore/python-tornado +library: tornado +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/python +additionalProperties: + packageName: petstore_api diff --git a/bin/configs/python.yaml b/bin/configs/python.yaml new file mode 100644 index 000000000000..14da7014cfcd --- /dev/null +++ b/bin/configs/python.yaml @@ -0,0 +1,6 @@ +generatorName: python +outputDir: samples/openapi3/client/petstore/python +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/python +additionalProperties: + packageName: petstore_api diff --git a/bin/configs/r-R.yaml b/bin/configs/r-R.yaml new file mode 100644 index 000000000000..1de2699e1d95 --- /dev/null +++ b/bin/configs/r-R.yaml @@ -0,0 +1,6 @@ +generatorName: r +outputDir: samples/client/petstore/R +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/r +additionalProperties: + packageName: petstore diff --git a/bin/configs/ruby-faraday.yaml b/bin/configs/ruby-faraday.yaml new file mode 100644 index 000000000000..b289ae977f48 --- /dev/null +++ b/bin/configs/ruby-faraday.yaml @@ -0,0 +1,10 @@ +generatorName: ruby +outputDir: samples/client/petstore/ruby-faraday +library: faraday +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/ruby-client +additionalProperties: + gemVersion: 1.0.0 + moduleName: Petstore + gemName: petstore + skipFormModel: "true" diff --git a/bin/configs/ruby.yaml b/bin/configs/ruby.yaml new file mode 100644 index 000000000000..1a7e2c24363b --- /dev/null +++ b/bin/configs/ruby.yaml @@ -0,0 +1,11 @@ +generatorName: ruby +outputDir: samples/client/petstore/ruby +library: typhoeus +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/ruby-client +additionalProperties: + gemVersion: 1.0.0 + moduleName: Petstore + gemName: petstore + skipFormModel: "true" +strictSpecBehavior: false diff --git a/bin/configs/rust-server-multipart-v3.yaml b/bin/configs/rust-server-multipart-v3.yaml new file mode 100644 index 000000000000..ca84dfb04e67 --- /dev/null +++ b/bin/configs/rust-server-multipart-v3.yaml @@ -0,0 +1,8 @@ +generatorName: rust-server +outputDir: samples/server/petstore/rust-server/output/multipart-v3 +inputSpec: modules/openapi-generator/src/test/resources/3_0/rust-server/multipart-v3.yaml +templateDir: modules/openapi-generator/src/main/resources/rust-server +generateAliasAsModel: true +additionalProperties: + hideGenerationTimestamp: "true" + packageName: multipart-v3 diff --git a/bin/configs/rust-server-no-example-v3.yaml b/bin/configs/rust-server-no-example-v3.yaml new file mode 100644 index 000000000000..5694c8373e51 --- /dev/null +++ b/bin/configs/rust-server-no-example-v3.yaml @@ -0,0 +1,8 @@ +generatorName: rust-server +outputDir: samples/server/petstore/rust-server/output/no-example-v3 +inputSpec: modules/openapi-generator/src/test/resources/3_0/rust-server/no-example-v3.yaml +templateDir: modules/openapi-generator/src/main/resources/rust-server +generateAliasAsModel: true +additionalProperties: + hideGenerationTimestamp: "true" + packageName: no-example-v3 diff --git a/bin/configs/rust-server-openapi-v3.yaml b/bin/configs/rust-server-openapi-v3.yaml new file mode 100644 index 000000000000..6ed1c294662a --- /dev/null +++ b/bin/configs/rust-server-openapi-v3.yaml @@ -0,0 +1,8 @@ +generatorName: rust-server +outputDir: samples/server/petstore/rust-server/output/openapi-v3 +inputSpec: modules/openapi-generator/src/test/resources/3_0/rust-server/openapi-v3.yaml +templateDir: modules/openapi-generator/src/main/resources/rust-server +generateAliasAsModel: true +additionalProperties: + hideGenerationTimestamp: "true" + packageName: openapi-v3 diff --git a/bin/configs/rust-server-ops-v3.yaml b/bin/configs/rust-server-ops-v3.yaml new file mode 100644 index 000000000000..5d8f47cea46e --- /dev/null +++ b/bin/configs/rust-server-ops-v3.yaml @@ -0,0 +1,8 @@ +generatorName: rust-server +outputDir: samples/server/petstore/rust-server/output/ops-v3 +inputSpec: modules/openapi-generator/src/test/resources/3_0/rust-server/ops-v3.yaml +templateDir: modules/openapi-generator/src/main/resources/rust-server +generateAliasAsModel: true +additionalProperties: + hideGenerationTimestamp: "true" + packageName: ops-v3 diff --git a/bin/configs/rust-server-petstore-with-fake-endpoints-models-for-testing.yaml b/bin/configs/rust-server-petstore-with-fake-endpoints-models-for-testing.yaml new file mode 100644 index 000000000000..c0f47a60634f --- /dev/null +++ b/bin/configs/rust-server-petstore-with-fake-endpoints-models-for-testing.yaml @@ -0,0 +1,8 @@ +generatorName: rust-server +outputDir: samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing +inputSpec: modules/openapi-generator/src/test/resources/2_0/rust-server/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/rust-server +generateAliasAsModel: true +additionalProperties: + hideGenerationTimestamp: "true" + packageName: petstore-with-fake-endpoints-models-for-testing diff --git a/bin/configs/rust-server-test.yaml b/bin/configs/rust-server-test.yaml new file mode 100644 index 000000000000..522a66ad2278 --- /dev/null +++ b/bin/configs/rust-server-test.yaml @@ -0,0 +1,8 @@ +generatorName: rust-server +outputDir: samples/server/petstore/rust-server/output/rust-server-test +inputSpec: modules/openapi-generator/src/test/resources/2_0/rust-server/rust-server-test.yaml +templateDir: modules/openapi-generator/src/main/resources/rust-server +generateAliasAsModel: true +additionalProperties: + hideGenerationTimestamp: "true" + packageName: rust-server-test diff --git a/bin/configs/scala-akka.yaml b/bin/configs/scala-akka.yaml new file mode 100644 index 000000000000..0a22803ca9e1 --- /dev/null +++ b/bin/configs/scala-akka.yaml @@ -0,0 +1,6 @@ +generatorName: scala-akka +outputDir: samples/client/petstore/scala-akka +inputSpec: modules/openapi-generator/src/test/resources/3_0/scala-akka/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/scala-akka-client +additionalProperties: + artifactId: scala-akka-petstore-client diff --git a/bin/configs/scala-sttp.yaml b/bin/configs/scala-sttp.yaml new file mode 100644 index 000000000000..01e211c9a79e --- /dev/null +++ b/bin/configs/scala-sttp.yaml @@ -0,0 +1,6 @@ +generatorName: scala-sttp +outputDir: samples/client/petstore/scala-sttp +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/scala-sttp +additionalProperties: + artifactId: scala-sttp-petstore diff --git a/bin/configs/spring-boot-beanvalidation.yaml b/bin/configs/spring-boot-beanvalidation.yaml new file mode 100644 index 000000000000..6b39c85dc941 --- /dev/null +++ b/bin/configs/spring-boot-beanvalidation.yaml @@ -0,0 +1,10 @@ +generatorName: spring +outputDir: samples/server/petstore/springboot-beanvalidation +library: spring-boot +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaSpring +additionalProperties: + java8: "false" + useBeanValidation: true + artifactId: spring-boot-beanvalidation + hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-boot-delegate-j8.yaml b/bin/configs/spring-boot-delegate-j8.yaml new file mode 100644 index 000000000000..a90e8b3ce1d4 --- /dev/null +++ b/bin/configs/spring-boot-delegate-j8.yaml @@ -0,0 +1,8 @@ +generatorName: spring +outputDir: samples/server/petstore/springboot-delegate-j8 +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaSpring +additionalProperties: + artifactId: springboot-delegate-j8 + hideGenerationTimestamp: "true" + delegatePattern: "true" diff --git a/bin/configs/spring-boot-delegate.yaml b/bin/configs/spring-boot-delegate.yaml new file mode 100644 index 000000000000..26b65d17ba74 --- /dev/null +++ b/bin/configs/spring-boot-delegate.yaml @@ -0,0 +1,9 @@ +generatorName: spring +outputDir: samples/server/petstore/springboot-delegate +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaSpring +additionalProperties: + artifactId: springboot-delegate + hideGenerationTimestamp: "true" + java8: "false" + delegatePattern: "true" diff --git a/bin/configs/spring-boot-implicitHeaders.yaml b/bin/configs/spring-boot-implicitHeaders.yaml new file mode 100644 index 000000000000..cb84abe664da --- /dev/null +++ b/bin/configs/spring-boot-implicitHeaders.yaml @@ -0,0 +1,8 @@ +generatorName: spring +outputDir: samples/server/petstore/springboot-implicitHeaders +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaSpring +additionalProperties: + artifactId: springboot-implicitHeaders + hideGenerationTimestamp: "true" + implicitHeaders: true diff --git a/bin/configs/spring-boot-reactive.yaml b/bin/configs/spring-boot-reactive.yaml new file mode 100644 index 000000000000..3d0c92edbeea --- /dev/null +++ b/bin/configs/spring-boot-reactive.yaml @@ -0,0 +1,9 @@ +generatorName: spring +outputDir: samples/server/petstore/springboot-reactive +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaSpring +additionalProperties: + artifactId: springboot-reactive + reactive: "true" + hideGenerationTimestamp: "true" + delegatePattern: "true" diff --git a/bin/configs/spring-boot-useoptional.yaml b/bin/configs/spring-boot-useoptional.yaml new file mode 100644 index 000000000000..93a7924dcba5 --- /dev/null +++ b/bin/configs/spring-boot-useoptional.yaml @@ -0,0 +1,8 @@ +generatorName: spring +outputDir: samples/server/petstore/springboot-useoptional +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaSpring +additionalProperties: + useOptional: true + artifactId: spring-boot-useoptional + hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-boot-virtualan.yaml b/bin/configs/spring-boot-virtualan.yaml new file mode 100644 index 000000000000..3d580d05c8a2 --- /dev/null +++ b/bin/configs/spring-boot-virtualan.yaml @@ -0,0 +1,11 @@ +generatorName: spring +outputDir: samples/server/petstore/springboot-virtualan +library: spring-boot +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaSpring +additionalProperties: + apiPackage: org.openapitools.virtualan.api + modelPackage: org.openapitools.virtualan.model + virtualService: true + artifactId: springboot-virtualan + hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-boot.yaml b/bin/configs/spring-boot.yaml new file mode 100644 index 000000000000..f752bc817e4f --- /dev/null +++ b/bin/configs/spring-boot.yaml @@ -0,0 +1,8 @@ +generatorName: spring +outputDir: samples/server/petstore/springboot +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaSpring +additionalProperties: + artifactId: springboot + snapshotVersion: "true" + hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-cloud-async.yaml b/bin/configs/spring-cloud-async.yaml new file mode 100644 index 000000000000..3275e4ac03e6 --- /dev/null +++ b/bin/configs/spring-cloud-async.yaml @@ -0,0 +1,10 @@ +generatorName: spring +outputDir: samples/client/petstore/spring-cloud-async +library: spring-cloud +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud +additionalProperties: + async: "true" + java8: "true" + artifactId: petstore-spring-cloud + hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-cloud.yaml b/bin/configs/spring-cloud.yaml new file mode 100644 index 000000000000..387c9e82a910 --- /dev/null +++ b/bin/configs/spring-cloud.yaml @@ -0,0 +1,9 @@ +generatorName: spring +outputDir: samples/client/petstore/spring-cloud +library: spring-cloud +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud +additionalProperties: + artifactId: petstore-spring-cloud + responseWrapper: HystrixCommand + hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-mvc-j8-async.yaml b/bin/configs/spring-mvc-j8-async.yaml new file mode 100644 index 000000000000..cd03b0e427dc --- /dev/null +++ b/bin/configs/spring-mvc-j8-async.yaml @@ -0,0 +1,11 @@ +generatorName: spring +outputDir: samples/server/petstore/spring-mvc-j8-async +library: spring-mvc +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaSpring +additionalProperties: + async: "true" + java8: true + artifactId: spring-mvc-server-j8-async + hideGenerationTimestamp: "true" + serverPort: "8002" diff --git a/bin/configs/spring-mvc-j8-localdatetime.yaml b/bin/configs/spring-mvc-j8-localdatetime.yaml new file mode 100644 index 000000000000..f8d6126c9f3c --- /dev/null +++ b/bin/configs/spring-mvc-j8-localdatetime.yaml @@ -0,0 +1,11 @@ +generatorName: spring +outputDir: samples/server/petstore/spring-mvc-j8-localdatetime +library: spring-mvc +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaSpring +additionalProperties: + booleanGetterPrefix: get + artifactId: spring-mvc-j8-localdatetime + hideGenerationTimestamp: "true" + serverPort: "8002" + dateLibrary: java8-localdatetime diff --git a/bin/configs/spring-mvc.yaml b/bin/configs/spring-mvc.yaml new file mode 100644 index 000000000000..11b49a4ecbdb --- /dev/null +++ b/bin/configs/spring-mvc.yaml @@ -0,0 +1,11 @@ +generatorName: spring +outputDir: samples/server/petstore/spring-mvc +library: spring-mvc +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaSpring +additionalProperties: + java8: "false" + booleanGetterPrefix: get + artifactId: spring-mvc-server + hideGenerationTimestamp: "true" + serverPort: "8002" diff --git a/bin/configs/spring-stubs.yaml b/bin/configs/spring-stubs.yaml new file mode 100644 index 000000000000..335fdcb4a7a3 --- /dev/null +++ b/bin/configs/spring-stubs.yaml @@ -0,0 +1,8 @@ +generatorName: spring +outputDir: samples/client/petstore/spring-stubs +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +additionalProperties: + artifactId: spring-stubs + interfaceOnly: "true" + singleContentTypes: "true" + hideGenerationTimestamp: "true" diff --git a/bin/configs/typescript-angular-default-v6.yaml b/bin/configs/typescript-angular-default-v6.yaml new file mode 100644 index 000000000000..664aa59a3c71 --- /dev/null +++ b/bin/configs/typescript-angular-default-v6.yaml @@ -0,0 +1,6 @@ +generatorName: typescript-angular +outputDir: samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +additionalProperties: + ngVersion: 6.0.0 + providedInRoot: "false" diff --git a/bin/configs/typescript-angular-single-request-parameter-v8.yaml b/bin/configs/typescript-angular-single-request-parameter-v8.yaml new file mode 100644 index 000000000000..c9978cc4aee0 --- /dev/null +++ b/bin/configs/typescript-angular-single-request-parameter-v8.yaml @@ -0,0 +1,10 @@ +generatorName: typescript-angular +outputDir: samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +additionalProperties: + npmVersion: 1.0.0 + ngVersion: 8.0.0 + npmName: '@openapitools/typescript-angular-petstore' + npmRepository: https://skimdb.npmjs.com/registry + useSingleRequestParameter: "true" + snapshot: false diff --git a/bin/configs/typescript-angular-v6-provided-in-root-with-npm.yaml b/bin/configs/typescript-angular-v6-provided-in-root-with-npm.yaml new file mode 100644 index 000000000000..8bb13b8eac70 --- /dev/null +++ b/bin/configs/typescript-angular-v6-provided-in-root-with-npm.yaml @@ -0,0 +1,9 @@ +generatorName: typescript-angular +outputDir: samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +additionalProperties: + ngVersion: 6.0.0 + npmVersion: 1.0.0 + npmName: '@openapitools/angular2-typescript-petstore' + npmRepository: https://skimdb.npmjs.com/registry + snapshot: false diff --git a/bin/configs/typescript-angular-v6-provided-in-root.yaml b/bin/configs/typescript-angular-v6-provided-in-root.yaml new file mode 100644 index 000000000000..366800546729 --- /dev/null +++ b/bin/configs/typescript-angular-v6-provided-in-root.yaml @@ -0,0 +1,5 @@ +generatorName: typescript-angular +outputDir: samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +additionalProperties: + ngVersion: 6.0.0 diff --git a/bin/configs/typescript-angular-v7-not-provided-in-root-with-npm.yaml b/bin/configs/typescript-angular-v7-not-provided-in-root-with-npm.yaml new file mode 100644 index 000000000000..ac73ad65f91b --- /dev/null +++ b/bin/configs/typescript-angular-v7-not-provided-in-root-with-npm.yaml @@ -0,0 +1,11 @@ +generatorName: typescript-angular +outputDir: samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +additionalProperties: + ngVersion: 7.0.0 + npmVersion: 1.0.0 + providedInRoot: "false" + stringEnums: "true" + npmName: '@openapitools/typescript-angular-petstore' + npmRepository: https://skimdb.npmjs.com/registry + snapshot: false \ No newline at end of file diff --git a/bin/configs/typescript-angular-v7-not-provided-in-root.yaml b/bin/configs/typescript-angular-v7-not-provided-in-root.yaml new file mode 100644 index 000000000000..83d16bcefb1d --- /dev/null +++ b/bin/configs/typescript-angular-v7-not-provided-in-root.yaml @@ -0,0 +1,6 @@ +generatorName: typescript-angular +outputDir: samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +additionalProperties: + ngVersion: 7.0.0 + providedInRoot: "false" \ No newline at end of file diff --git a/bin/configs/typescript-angular-v7-provided-in-root-with-npm.yaml b/bin/configs/typescript-angular-v7-provided-in-root-with-npm.yaml new file mode 100644 index 000000000000..6ae7f19ad42e --- /dev/null +++ b/bin/configs/typescript-angular-v7-provided-in-root-with-npm.yaml @@ -0,0 +1,9 @@ +generatorName: typescript-angular +outputDir: samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +additionalProperties: + ngVersion: 7.0.0 + npmVersion: 1.0.0 + npmName: '@openapitools/typescript-angular-petstore' + npmRepository: https://skimdb.npmjs.com/registry + snapshot: false diff --git a/bin/configs/typescript-angular-v7-provided-in-root.yaml b/bin/configs/typescript-angular-v7-provided-in-root.yaml new file mode 100644 index 000000000000..5a22f83d84a2 --- /dev/null +++ b/bin/configs/typescript-angular-v7-provided-in-root.yaml @@ -0,0 +1,5 @@ +generatorName: typescript-angular +outputDir: samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +additionalProperties: + ngVersion: 7.0.0 diff --git a/bin/configs/typescript-angular-with-npm-v6.yaml b/bin/configs/typescript-angular-with-npm-v6.yaml new file mode 100644 index 000000000000..c8bcfc48892f --- /dev/null +++ b/bin/configs/typescript-angular-with-npm-v6.yaml @@ -0,0 +1,10 @@ +generatorName: typescript-angular +outputDir: samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +additionalProperties: + npmVersion: 1.0.0 + ngVersion: 6.0.0 + providedInRoot: "false" + npmName: '@openapitools/typescript-angular-petstore' + npmRepository: https://skimdb.npmjs.com/registry + snapshot: false diff --git a/bin/configs/typescript-angular-with-npm-v8.yaml b/bin/configs/typescript-angular-with-npm-v8.yaml new file mode 100644 index 000000000000..48849517fcc4 --- /dev/null +++ b/bin/configs/typescript-angular-with-npm-v8.yaml @@ -0,0 +1,9 @@ +generatorName: typescript-angular +outputDir: samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +additionalProperties: + npmVersion: 1.0.0 + ngVersion: 8.0.0 + npmName: '@openapitools/typescript-angular-petstore' + npmRepository: https://skimdb.npmjs.com/registry + snapshot: false diff --git a/bin/configs/typescript-angular-with-prefixed-module-name-v8.yaml b/bin/configs/typescript-angular-with-prefixed-module-name-v8.yaml new file mode 100644 index 000000000000..b7cf4fd45e81 --- /dev/null +++ b/bin/configs/typescript-angular-with-prefixed-module-name-v8.yaml @@ -0,0 +1,10 @@ +generatorName: typescript-angular +outputDir: samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +additionalProperties: + npmVersion: 1.0.0 + ngVersion: 8.0.0 + npmName: '@openapitools/typescript-angular-petstore' + npmRepository: https://skimdb.npmjs.com/registry + snapshot: false + apiModulePrefix: PetStore diff --git a/bin/configs/typescript-angularjs.yaml b/bin/configs/typescript-angularjs.yaml new file mode 100644 index 000000000000..afaf8f53e862 --- /dev/null +++ b/bin/configs/typescript-angularjs.yaml @@ -0,0 +1,3 @@ +generatorName: typescript-angularjs +outputDir: samples/client/petstore/typescript-angularjs +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml diff --git a/bin/configs/typescript-aurelia-default.yaml b/bin/configs/typescript-aurelia-default.yaml new file mode 100644 index 000000000000..c0b70a6ad9a1 --- /dev/null +++ b/bin/configs/typescript-aurelia-default.yaml @@ -0,0 +1,3 @@ +generatorName: typescript-aurelia +outputDir: samples/client/petstore/typescript-aurelia/default +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml diff --git a/bin/configs/typescript-axios-composed-schemas.yaml b/bin/configs/typescript-axios-composed-schemas.yaml new file mode 100644 index 000000000000..c9bea94bbad3 --- /dev/null +++ b/bin/configs/typescript-axios-composed-schemas.yaml @@ -0,0 +1,3 @@ +generatorName: typescript-axios +outputDir: samples/client/petstore/typescript-axios/builds/composed-schemas +inputSpec: modules/openapi-generator/src/test/resources/3_0/composed-schemas.yaml diff --git a/bin/configs/typescript-axios-default.yaml b/bin/configs/typescript-axios-default.yaml new file mode 100644 index 000000000000..5b3c9488a88c --- /dev/null +++ b/bin/configs/typescript-axios-default.yaml @@ -0,0 +1,3 @@ +generatorName: typescript-axios +outputDir: samples/client/petstore/typescript-axios/builds/default +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml diff --git a/bin/configs/typescript-axios-es6-target.yaml b/bin/configs/typescript-axios-es6-target.yaml new file mode 100644 index 000000000000..79b61fdaff00 --- /dev/null +++ b/bin/configs/typescript-axios-es6-target.yaml @@ -0,0 +1,9 @@ +generatorName: typescript-axios +outputDir: samples/client/petstore/typescript-axios/builds/es6-target +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +additionalProperties: + npmVersion: 1.0.0 + supportsES6: true + npmName: '@openapitools/typescript-axios-petstore' + npmRepository: https://skimdb.npmjs.com/registry + snapshot: false diff --git a/bin/configs/typescript-axios-with-complex-headers.yaml b/bin/configs/typescript-axios-with-complex-headers.yaml new file mode 100644 index 000000000000..c88e7a15d826 --- /dev/null +++ b/bin/configs/typescript-axios-with-complex-headers.yaml @@ -0,0 +1,3 @@ +generatorName: typescript-axios +outputDir: samples/client/petstore/typescript-axios/builds/with-complex-headers +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-complex-headers.yaml diff --git a/bin/configs/typescript-axios-with-interfaces.yaml b/bin/configs/typescript-axios-with-interfaces.yaml new file mode 100644 index 000000000000..11337d003530 --- /dev/null +++ b/bin/configs/typescript-axios-with-interfaces.yaml @@ -0,0 +1,5 @@ +generatorName: typescript-axios +outputDir: samples/client/petstore/typescript-axios/builds/with-interfaces +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +additionalProperties: + withInterfaces: "true" diff --git a/bin/configs/typescript-axios-with-npm-version-and-separate-models-and-api.yaml b/bin/configs/typescript-axios-with-npm-version-and-separate-models-and-api.yaml new file mode 100644 index 000000000000..48186cc0629c --- /dev/null +++ b/bin/configs/typescript-axios-with-npm-version-and-separate-models-and-api.yaml @@ -0,0 +1,11 @@ +generatorName: typescript-axios +outputDir: samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +additionalProperties: + npmVersion: 1.0.0 + apiPackage: api.another.level + modelPackage: model.some.levels.deep + withSeparateModelsAndApi: true + npmName: '@openapitools/typescript-axios-petstore' + npmRepository: https://skimdb.npmjs.com/registry + snapshot: false diff --git a/bin/configs/typescript-axios-with-npm-version.yaml b/bin/configs/typescript-axios-with-npm-version.yaml new file mode 100644 index 000000000000..8602cac04dd5 --- /dev/null +++ b/bin/configs/typescript-axios-with-npm-version.yaml @@ -0,0 +1,8 @@ +generatorName: typescript-axios +outputDir: samples/client/petstore/typescript-axios/builds/with-npm-version +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +additionalProperties: + npmVersion: 1.0.0 + npmName: '@openapitools/typescript-axios-petstore' + npmRepository: https://skimdb.npmjs.com/registry + snapshot: false diff --git a/bin/configs/typescript-axios-with-single-request-parameters.yaml b/bin/configs/typescript-axios-with-single-request-parameters.yaml new file mode 100644 index 000000000000..9239c6329388 --- /dev/null +++ b/bin/configs/typescript-axios-with-single-request-parameters.yaml @@ -0,0 +1,5 @@ +generatorName: typescript-axios +outputDir: samples/client/petstore/typescript-axios/builds/with-single-request-parameters +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-operations-without-required-params.yaml +additionalProperties: + useSingleRequestParameter: "true" diff --git a/bin/configs/typescript-fetch-default.yaml b/bin/configs/typescript-fetch-default.yaml new file mode 100644 index 000000000000..85301d86bb97 --- /dev/null +++ b/bin/configs/typescript-fetch-default.yaml @@ -0,0 +1,3 @@ +generatorName: typescript-fetch +outputDir: samples/client/petstore/typescript-fetch/builds/default +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml diff --git a/bin/configs/typescript-fetch-es6-target.yaml b/bin/configs/typescript-fetch-es6-target.yaml new file mode 100644 index 000000000000..aea1ad318487 --- /dev/null +++ b/bin/configs/typescript-fetch-es6-target.yaml @@ -0,0 +1,9 @@ +generatorName: typescript-fetch +outputDir: samples/client/petstore/typescript-fetch/builds/es6-target +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +additionalProperties: + npmVersion: 1.0.0 + supportsES6: true + npmName: '@openapitools/typescript-fetch-petstore' + npmRepository: https://skimdb.npmjs.com/registry + snapshot: false diff --git a/bin/configs/typescript-fetch-multiple-parameters.yaml b/bin/configs/typescript-fetch-multiple-parameters.yaml new file mode 100644 index 000000000000..0bc52605c272 --- /dev/null +++ b/bin/configs/typescript-fetch-multiple-parameters.yaml @@ -0,0 +1,6 @@ +generatorName: typescript-fetch +outputDir: samples/client/petstore/typescript-fetch/builds/multiple-parameters +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +additionalProperties: + useSingleRequestParameter: false + snapshot: false diff --git a/bin/configs/typescript-fetch-prefix-parameter-interfaces.yaml b/bin/configs/typescript-fetch-prefix-parameter-interfaces.yaml new file mode 100644 index 000000000000..27334256aad7 --- /dev/null +++ b/bin/configs/typescript-fetch-prefix-parameter-interfaces.yaml @@ -0,0 +1,9 @@ +generatorName: typescript-fetch +outputDir: samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +additionalProperties: + npmVersion: 1.0.0 + npmName: '@openapitools/typescript-fetch-petstore' + npmRepository: https://skimdb.npmjs.com/registry + prefixParameterInterfaces: true + snapshot: false diff --git a/bin/configs/typescript-fetch-typescript-three-plus.yaml b/bin/configs/typescript-fetch-typescript-three-plus.yaml new file mode 100644 index 000000000000..a18d0d8adbcd --- /dev/null +++ b/bin/configs/typescript-fetch-typescript-three-plus.yaml @@ -0,0 +1,9 @@ +generatorName: typescript-fetch +outputDir: samples/client/petstore/typescript-fetch/builds/typescript-three-plus +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +additionalProperties: + npmVersion: 1.0.0 + npmName: '@openapitools/typescript-fetch-petstore' + npmRepository: https://skimdb.npmjs.com/registry + typescriptThreePlus: true + snapshot: false diff --git a/bin/configs/typescript-fetch-with-interfaces.yaml b/bin/configs/typescript-fetch-with-interfaces.yaml new file mode 100644 index 000000000000..e0e84f57d124 --- /dev/null +++ b/bin/configs/typescript-fetch-with-interfaces.yaml @@ -0,0 +1,5 @@ +generatorName: typescript-fetch +outputDir: samples/client/petstore/typescript-fetch/builds/with-interfaces +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +additionalProperties: + withInterfaces: "true" diff --git a/bin/configs/typescript-fetch-with-npm-version.yaml b/bin/configs/typescript-fetch-with-npm-version.yaml new file mode 100644 index 000000000000..35e2c2a2d3ca --- /dev/null +++ b/bin/configs/typescript-fetch-with-npm-version.yaml @@ -0,0 +1,8 @@ +generatorName: typescript-fetch +outputDir: samples/client/petstore/typescript-fetch/builds/with-npm-version +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +additionalProperties: + npmVersion: 1.0.0 + npmName: '@openapitools/typescript-fetch-petstore' + npmRepository: https://skimdb.npmjs.com/registry + snapshot: false diff --git a/bin/configs/typescript-inversify.yaml b/bin/configs/typescript-inversify.yaml new file mode 100644 index 000000000000..de2fe10c96b5 --- /dev/null +++ b/bin/configs/typescript-inversify.yaml @@ -0,0 +1,3 @@ +generatorName: typescript-inversify +outputDir: samples/client/petstore/typescript-inversify +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml diff --git a/bin/configs/typescript-jquery-default.yaml b/bin/configs/typescript-jquery-default.yaml new file mode 100644 index 000000000000..77758d8e45a1 --- /dev/null +++ b/bin/configs/typescript-jquery-default.yaml @@ -0,0 +1,3 @@ +generatorName: typescript-jquery +outputDir: samples/client/petstore/typescript-jquery/default +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml diff --git a/bin/configs/typescript-jquery-npm.yaml b/bin/configs/typescript-jquery-npm.yaml new file mode 100644 index 000000000000..a0e53ec13ede --- /dev/null +++ b/bin/configs/typescript-jquery-npm.yaml @@ -0,0 +1,8 @@ +generatorName: typescript-jquery +outputDir: samples/client/petstore/typescript-jquery/npm +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +additionalProperties: + npmVersion: 0.0.1 + npmName: '@openapitools/jquery-typescript-petstore' + npmRepository: https://skimdb.npmjs.com/registry + snapshot: false diff --git a/bin/configs/typescript-node-default.yaml b/bin/configs/typescript-node-default.yaml new file mode 100644 index 000000000000..0b7bcafa0772 --- /dev/null +++ b/bin/configs/typescript-node-default.yaml @@ -0,0 +1,3 @@ +generatorName: typescript-node +outputDir: samples/client/petstore/typescript-node/default +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml diff --git a/bin/configs/typescript-node-npm.yaml b/bin/configs/typescript-node-npm.yaml new file mode 100644 index 000000000000..06dafcad3705 --- /dev/null +++ b/bin/configs/typescript-node-npm.yaml @@ -0,0 +1,8 @@ +generatorName: typescript-node +outputDir: samples/client/petstore/typescript-node/npm +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +additionalProperties: + npmVersion: 0.0.1 + npmName: '@openapitools/node-typescript-petstore' + npmRepository: https://skimdb.npmjs.com/registry + snapshot: false diff --git a/bin/configs/typescript-redux-query-with-npm-version.yaml b/bin/configs/typescript-redux-query-with-npm-version.yaml new file mode 100644 index 000000000000..1db6557857d7 --- /dev/null +++ b/bin/configs/typescript-redux-query-with-npm-version.yaml @@ -0,0 +1,9 @@ +generatorName: typescript-redux-query +outputDir: samples/client/petstore/typescript-redux-query/builds/with-npm-version +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/typescript-redux-query +additionalProperties: + npmVersion: 1.0.0 + npmName: '@openapitools/typescript-redux-query-petstore' + npmRepository: https://skimdb.npmjs.com/registry + snapshot: false diff --git a/bin/configs/typescript-rxjs-default.yaml b/bin/configs/typescript-rxjs-default.yaml new file mode 100644 index 000000000000..e2006a1ab3ea --- /dev/null +++ b/bin/configs/typescript-rxjs-default.yaml @@ -0,0 +1,3 @@ +generatorName: typescript-rxjs +outputDir: samples/client/petstore/typescript-rxjs/builds/default +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml diff --git a/bin/configs/typescript-rxjs-es6-target.yaml b/bin/configs/typescript-rxjs-es6-target.yaml new file mode 100644 index 000000000000..cb40131cee44 --- /dev/null +++ b/bin/configs/typescript-rxjs-es6-target.yaml @@ -0,0 +1,9 @@ +generatorName: typescript-rxjs +outputDir: samples/client/petstore/typescript-rxjs/builds/es6-target +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +additionalProperties: + npmVersion: 1.0.0 + supportsES6: true + npmName: '@openapitools/typescript-rxjs-petstore' + npmRepository: https://skimdb.npmjs.com/registry + snapshot: false diff --git a/bin/configs/typescript-rxjs-with-interfaces.yaml b/bin/configs/typescript-rxjs-with-interfaces.yaml new file mode 100644 index 000000000000..a5ef676abc7d --- /dev/null +++ b/bin/configs/typescript-rxjs-with-interfaces.yaml @@ -0,0 +1,5 @@ +generatorName: typescript-rxjs +outputDir: samples/client/petstore/typescript-rxjs/builds/with-interfaces +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +additionalProperties: + withInterfaces: "true" diff --git a/bin/configs/typescript-rxjs-with-npm-version.yaml b/bin/configs/typescript-rxjs-with-npm-version.yaml new file mode 100644 index 000000000000..4d2fd37f8f6f --- /dev/null +++ b/bin/configs/typescript-rxjs-with-npm-version.yaml @@ -0,0 +1,8 @@ +generatorName: typescript-rxjs +outputDir: samples/client/petstore/typescript-rxjs/builds/with-npm-version +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +additionalProperties: + npmVersion: 1.0.0 + npmName: '@openapitools/typescript-rxjs-petstore' + npmRepository: https://skimdb.npmjs.com/registry + snapshot: false diff --git a/bin/cpp-pistache-server-petstore.sh b/bin/cpp-pistache-server-petstore.sh deleted file mode 100755 index 7f2c734b6894..000000000000 --- a/bin/cpp-pistache-server-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bash - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -g cpp-pistache-server -t modules/openapi-generator/src/main/resources/cpp-pistache-server -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml --additional-properties addExternalLibs=true --additional-properties useStructModel=false -o samples/server/petstore/cpp-pistache $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/cpp-qt5-petstore.json b/bin/cpp-qt5-petstore.json deleted file mode 100644 index b27f55f17f84..000000000000 --- a/bin/cpp-qt5-petstore.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/cpp-qt5", - "additionalProperties": { - "cppNamespace": "test_namespace", - "modelNamePrefix": "PFX" - } -} diff --git a/bin/cpp-qt5-petstore.sh b/bin/cpp-qt5-petstore.sh deleted file mode 100755 index 68fb506a63bb..000000000000 --- a/bin/cpp-qt5-petstore.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -args="generate -t modules/openapi-generator/src/main/resources/cpp-qt5-client \ - -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml \ - -g cpp-qt5-client \ - -c bin/cpp-qt5-petstore.json \ - $@" - -java $JAVA_OPTS -jar $executable $args diff --git a/bin/cpp-qt5-qhttpengine-server-petstore.sh b/bin/cpp-qt5-qhttpengine-server-petstore.sh deleted file mode 100755 index 9425c273cea7..000000000000 --- a/bin/cpp-qt5-qhttpengine-server-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g cpp-qt5-qhttpengine-server -o samples/server/petstore/cpp-qt5-qhttpengine-server $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/cpp-restbed-petstore-server.sh b/bin/cpp-restbed-petstore-server.sh deleted file mode 100755 index 5a61f5e8c888..000000000000 --- a/bin/cpp-restbed-petstore-server.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bash - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -g cpp-restbed-server -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -o samples/server/petstore/cpp-restbed $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/cpp-restsdk-petstore.sh b/bin/cpp-restsdk-petstore.sh deleted file mode 100755 index ad9090d0b5c3..000000000000 --- a/bin/cpp-restsdk-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/cpp-rest-sdk-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g cpp-restsdk -o samples/client/petstore/cpp-restsdk/client $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/cpp-tizen-petstore.sh b/bin/cpp-tizen-petstore.sh deleted file mode 100755 index 4a280974fa6d..000000000000 --- a/bin/cpp-tizen-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/cpp-tizen-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g cpp-tizen -o samples/client/petstore/cpp-tizen $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/cpp-ue4-petstore.sh b/bin/cpp-ue4-petstore.sh deleted file mode 100755 index 9eeab274c870..000000000000 --- a/bin/cpp-ue4-petstore.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -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 -t modules/openapi-generator/src/main/resources/cpp-ue4 -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g cpp-ue4 -o samples/client/petstore/cpp-ue4" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/csharp-dotnet2-petstore.sh b/bin/csharp-dotnet2-petstore.sh deleted file mode 100755 index c953170bfaa0..000000000000 --- a/bin/csharp-dotnet2-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g csharp-dotnet2 -t modules/openapi-generator/src/main/resources/csharp-dotnet2 -o samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient --additional-properties hideGenerationTimestamp=true $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/csharp-netcore-petstore-all.sh b/bin/csharp-netcore-petstore-all.sh deleted file mode 100755 index 6db67b5e0e1e..000000000000 --- a/bin/csharp-netcore-petstore-all.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -# C# Petstore API client .NET Standard 2.0 -./bin/csharp-netcore-petstore.sh - -# C# Petstore API client .NET Core 2.0 -./bin/csharp-netcore-petstore-netcore.sh diff --git a/bin/csharp-netcore-petstore-netcore.sh b/bin/csharp-netcore-petstore-netcore.sh deleted file mode 100755 index 8f2e4824060e..000000000000 --- a/bin/csharp-netcore-petstore-netcore.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" -outdir="samples/client/petstore/csharp-netcore/OpenAPIClientCore" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/csharp-netcore/ -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g csharp-netcore -o ${outdir} --additional-properties packageGuid={321C8C3F-0156-40C1-AE42-D59761FB9B6C},useCompareNetObjects=true,targetFramework=netcoreapp2.0 $@" - -java $JAVA_OPTS -jar $executable $ags - -# restore csproj file -echo "restore csproject file: CI/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj" -cp ./CI/samples.ci/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj ./samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/ - diff --git a/bin/csharp-netcore-petstore.sh b/bin/csharp-netcore-petstore.sh deleted file mode 100755 index a525806f4d8e..000000000000 --- a/bin/csharp-netcore-petstore.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/csharp-netcore/ -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g csharp-netcore -o samples/client/petstore/csharp-netcore/OpenAPIClient --additional-properties packageGuid={321C8C3F-0156-40C1-AE42-D59761FB9B6C},useCompareNetObjects=true $@" - -java $JAVA_OPTS -jar $executable $ags - -# restore csproj file -echo "restore csproject file: CI/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj" -cp ./CI/samples.ci/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj ./samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/ - diff --git a/bin/csharp-petstore-all.sh b/bin/csharp-petstore-all.sh deleted file mode 100755 index 022d1713bbd0..000000000000 --- a/bin/csharp-petstore-all.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -# C# Petstore API client (.NET 3.5) -./bin/csharp-petstore.sh - -# C# Petstore API client with PropertyChanged -./bin/csharp-property-changed-petstore.sh - -# C# Petstore API client (.net standarnd 1.3+) -./bin/csharp-petstore-net-standard.sh - -# C# Petstore API client (.NET 4.0) -./bin/csharp-petstore-net-40.sh - -# C# Petstore API client (.NET 3.5) -./bin/csharp-petstore-net-35.sh - diff --git a/bin/csharp-petstore-net-35.json b/bin/csharp-petstore-net-35.json deleted file mode 100644 index 8d3ade9cd8a2..000000000000 --- a/bin/csharp-petstore-net-35.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "targetFramework": "v3.5" -} diff --git a/bin/csharp-petstore-net-35.sh b/bin/csharp-petstore-net-35.sh deleted file mode 100755 index 0096db9dbd9c..000000000000 --- a/bin/csharp-petstore-net-35.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g csharp -o samples/client/petstore/csharp/OpenAPIClientNet35 --additional-properties packageGuid={321C8C3F-0156-40C1-AE42-D59761FB9B6C} -c ./bin/csharp-petstore-net-35.json $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/csharp-petstore-net-40.json b/bin/csharp-petstore-net-40.json deleted file mode 100644 index 884f7ea9bc92..000000000000 --- a/bin/csharp-petstore-net-40.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "targetFramework": "v4.0" -} diff --git a/bin/csharp-petstore-net-40.sh b/bin/csharp-petstore-net-40.sh deleted file mode 100755 index a816c28d0b6f..000000000000 --- a/bin/csharp-petstore-net-40.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g csharp -o samples/client/petstore/csharp/OpenAPIClientNet40 --additional-properties packageGuid={321C8C3F-0156-40C1-AE42-D59761FB9B6C} -c ./bin/csharp-petstore-net-40.json $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/csharp-petstore-net-standard.json b/bin/csharp-petstore-net-standard.json deleted file mode 100644 index d6e7bb02d935..000000000000 --- a/bin/csharp-petstore-net-standard.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "targetFramework": "netstandard1.3" -} diff --git a/bin/csharp-petstore-net-standard.sh b/bin/csharp-petstore-net-standard.sh deleted file mode 100755 index a7902e38c731..000000000000 --- a/bin/csharp-petstore-net-standard.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g csharp -o samples/client/petstore/csharp/OpenAPIClientNetStandard --additional-properties packageGuid={321C8C3F-0156-40C1-AE42-D59761FB9B6C} -c ./bin/csharp-petstore-net-standard.json $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/csharp-petstore-netcore-project.sh b/bin/csharp-petstore-netcore-project.sh deleted file mode 100755 index 5ced67903acf..000000000000 --- a/bin/csharp-petstore-netcore-project.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g csharp -o samples/client/petstore/csharp/OpenAPIClientNetCoreProject --additional-properties packageGuid={67035b31-f8e5-41a4-9673-954035084f7d},netCoreProjectFile=true -c ./bin/csharp-petstore-net-standard.json $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/csharp-petstore.sh b/bin/csharp-petstore.sh deleted file mode 100755 index cbfeb6fab0d3..000000000000 --- a/bin/csharp-petstore.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g csharp -o samples/client/petstore/csharp/OpenAPIClient --additional-properties packageGuid={321C8C3F-0156-40C1-AE42-D59761FB9B6C} $@" - -java $JAVA_OPTS -jar $executable $ags - -# restore csproj file -echo "restore csproject file: CI/samples.ci/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj" -cp ./CI/samples.ci/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj ./samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/ - diff --git a/bin/csharp-property-changed-petstore.sh b/bin/csharp-property-changed-petstore.sh deleted file mode 100755 index 6ac09c9406c2..000000000000 --- a/bin/csharp-property-changed-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g csharp -o samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged --additional-properties generatePropertyChanged=true --additional-properties optionalEmitDefaultValues=true --additional-properties packageGuid={5CD900DE-8266-412F-A758-28E1F9C623D5} $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/cwiki-petstore.sh b/bin/cwiki-petstore.sh deleted file mode 100755 index 8be674102832..000000000000 --- a/bin/cwiki-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/confluenceWikiDocs -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g cwiki -o samples/documentation/cwiki $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/dart-dio-petstore.sh b/bin/dart-dio-petstore.sh deleted file mode 100755 index 724c0f9b0879..000000000000 --- a/bin/dart-dio-petstore.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" - -# Generate non-browserClient -ags="generate -t modules/openapi-generator/src/main/resources/dart-dio -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g dart-dio -o samples/client/petstore/dart-dio/ --additional-properties hideGenerationTimestamp=true $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/dart-jaguar-petstore.sh b/bin/dart-jaguar-petstore.sh deleted file mode 100755 index c5348cd34be0..000000000000 --- a/bin/dart-jaguar-petstore.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" - -# Generate client -ags="$@ generate -t modules/openapi-generator/src/main/resources/dart-jaguar -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g dart-jaguar -o samples/client/petstore/dart-jaguar/openapi --additional-properties hideGenerationTimestamp=true,pubName=openapi" -java $JAVA_OPTS -jar $executable $ags - -# Generate non-browserClient and put it to the flutter sample app -ags="$@ generate -t modules/openapi-generator/src/main/resources/dart-jaguar -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g dart-jaguar -o samples/client/petstore/dart-jaguar/flutter_petstore/openapi --additional-properties hideGenerationTimestamp=true,pubName=openapi" -java $JAVA_OPTS -jar $executable $ags - -# Generate proto and put it to the flutter sample app -ags="$@ generate -t modules/openapi-generator/src/main/resources/dart-jaguar -i modules/openapi-generator/src/test/resources/2_0/petstore-proto.yaml -g dart-jaguar -o samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi --additional-properties serialization=proto,hideGenerationTimestamp=true,pubName=openapi" -java $JAVA_OPTS -jar $executable $ags - -# Generate proto and put it to the sample -ags="$@ generate -t modules/openapi-generator/src/main/resources/dart-jaguar -i modules/openapi-generator/src/test/resources/2_0/petstore-proto.yaml -g dart-jaguar -o samples/client/petstore/dart-jaguar/openapi_proto --additional-properties serialization=proto,hideGenerationTimestamp=true,pubName=openapi" -java $JAVA_OPTS -jar $executable $ags - -# There is a proposal to allow importing different libraries depending on the environment: -# https://github.com/munificent/dep-interface-libraries -# When this is implemented there will only be one library. - -# The current petstore test will then work for both: the browser library and the vm library. diff --git a/bin/dart-petstore.sh b/bin/dart-petstore.sh deleted file mode 100755 index 74b52e234df1..000000000000 --- a/bin/dart-petstore.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" - -# Generate non-browserClient -ags="generate -t modules/openapi-generator/src/main/resources/dart -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g dart -o samples/client/petstore/dart/openapi --additional-properties hideGenerationTimestamp=true,browserClient=false,supportDart2=false $@" - -# then options to generate the library for vm would be: -#ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g dart -o samples/client/petstore/dart/openapi_vm --additional-properties browserClient=false,pubName=openapi_vm --additional-properties supportDart2=false $@" -java $JAVA_OPTS -jar $executable $ags - -# Generate browserClient -ags="generate -t modules/openapi-generator/src/main/resources/dart -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g dart -o samples/client/petstore/dart/openapi-browser-client --additional-properties hideGenerationTimestamp=true,browserClient=true,supportDart2=false $@" -java $JAVA_OPTS -jar $executable $ags - -# TODO: Remove this as it duplicate output from the first example in this file. -# Generate non-browserClient and put it to the flutter sample app -ags="generate -t modules/openapi-generator/src/main/resources/dart -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g dart -o samples/client/petstore/dart/flutter_petstore/openapi --additional-properties hideGenerationTimestamp=true,browserClient=false,supportDart2=false $@" -java $JAVA_OPTS -jar $executable $ags - -# There is a proposal to allow importing different libraries depending on the environment: -# https://github.com/munificent/dep-interface-libraries -# When this is implemented there will only be one library. - -# The current petstore test will then work for both: the browser library and the vm library. diff --git a/bin/dart2-petstore.sh b/bin/dart2-petstore.sh deleted file mode 100755 index e309802ed3af..000000000000 --- a/bin/dart2-petstore.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" - -# Generate client -ags="generate -t modules/openapi-generator/src/main/resources/dart2 -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g dart -o samples/client/petstore/dart2/petstore_client_lib --additional-properties hideGenerationTimestamp=true $@" -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/dynamic-html.sh b/bin/dynamic-html.sh deleted file mode 100755 index 6dfaa10cc4a1..000000000000 --- a/bin/dynamic-html.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g dynamic-html -o samples/documentation/dynamic-html $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/eiffel-petstore.sh b/bin/eiffel-petstore.sh deleted file mode 100755 index 50e73639e9db..000000000000 --- a/bin/eiffel-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -args="generate -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g eiffel -o samples/client/petstore/eiffel/ $@" - -java $JAVA_OPTS -jar $executable $args diff --git a/bin/elixir-petstore.sh b/bin/elixir-petstore.sh deleted file mode 100755 index c826ea8519f2..000000000000 --- a/bin/elixir-petstore.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# remove existing lib and model file -echo "removing existing lib, model files" -rm -Rf "samples/client/petstore/elixir/lib/openapi_petstore/model/" -rm -Rf "samples/client/petstore/elixir/lib/openapi_petstore/api/" - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -args="generate -t modules/openapi-generator/src/main/resources/elixir -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g elixir -o samples/client/petstore/elixir/ --additional-properties invokerPackage=OpenapiPetstore $@" - -java $JAVA_OPTS -jar $executable $args diff --git a/bin/erlang-petstore-client.sh b/bin/erlang-petstore-client.sh deleted file mode 100755 index 5ff65bf39282..000000000000 --- a/bin/erlang-petstore-client.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/erlang-client --additional-properties packageName=petstore -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g erlang-client -o samples/client/petstore/erlang-client $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/erlang-petstore-proper.sh b/bin/erlang-petstore-proper.sh deleted file mode 100755 index 2db7ed0e0e31..000000000000 --- a/bin/erlang-petstore-proper.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/erlang-proper --additional-properties packageName=petstore -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g erlang-proper -o samples/client/petstore/erlang-proper $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/erlang-petstore-server.sh b/bin/erlang-petstore-server.sh deleted file mode 100755 index de587f37b971..000000000000 --- a/bin/erlang-petstore-server.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/erlang-server -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g erlang-server -o samples/server/petstore/erlang-server $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/flash-petstore.json b/bin/flash-petstore.json deleted file mode 100644 index 8b52733fcf45..000000000000 --- a/bin/flash-petstore.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "packageName": "org.openapitools", - "invokerPackage": "org.openapitools" -} diff --git a/bin/flash-petstore.sh b/bin/flash-petstore.sh deleted file mode 100755 index bee991877699..000000000000 --- a/bin/flash-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/flash -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g flash -o samples/client/petstore/flash -c bin/flash-petstore.json $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/fsharp-functions-server-petstore.sh b/bin/fsharp-functions-server-petstore.sh deleted file mode 100755 index 23cce9c0e71c..000000000000 --- a/bin/fsharp-functions-server-petstore.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" - -while [ -h "$SCRIPT" ] ; do - ls=$(ls -ld "$SCRIPT") - link=$(expr "$ls" : '.*-> \(.*\)$') - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=$(dirname "$SCRIPT")/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=$(dirname "$SCRIPT")/.. - APP_DIR=$(cd "${APP_DIR}"; pwd) -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -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 fsharp-functions -o samples/server/petstore/fsharp-functions" - -java ${JAVA_OPTS} -jar ${executable} ${ags} diff --git a/bin/fsharp-giraffe-server-petstore.sh b/bin/fsharp-giraffe-server-petstore.sh deleted file mode 100755 index 659280983f94..000000000000 --- a/bin/fsharp-giraffe-server-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -t modules/openapi-generator/src/main/resources/fsharp-giraffe-server -g fsharp-giraffe-server -o samples/server/petstore/fsharp-giraffe $@" - -java ${JAVA_OPTS} -jar ${executable} ${ags} diff --git a/bin/generate-samples.sh b/bin/generate-samples.sh new file mode 100755 index 000000000000..5205b22c745c --- /dev/null +++ b/bin/generate-samples.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +# this bash script generates all samples. +# it ensures that all changes are committed into the 'samples/' folder +# shellcheck disable=SC2155 +declare cwd="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +declare root="$(cd "$cwd" && cd ../ && pwd)" +declare executable="${root}/modules/openapi-generator-cli/target/openapi-generator-cli.jar" + +echo "# START SCRIPT: $0" +echo "This script generates all configs under bin/configs by default." +echo "You may generate a targeted script or set of scripts using glob patterns." +echo "For example: $0 bin/configs/java-*" +echo "" +echo "Please press CTRL+C to stop or the script will continue in 5 seconds." + +sleep 5 +if [ ! -f "$executable" ]; then + (cd "${root}" && mvn -B --no-snapshot-updates clean package -DskipTests=true -Dmaven.javadoc.skip=true -Djacoco.skip=true) +fi + +export JAVA_OPTS="${JAVA_OPTS} -server -Duser.timezone=UTC" + +configs=${@:-"${root}"/bin/configs/*.yaml} + +# shellcheck disable=SC2086 +java $JAVA_OPTS -jar "$executable" batch --includes-base-dir "${root}" --fail-fast -- $configs diff --git a/bin/go-experimental-petstore.sh b/bin/go-experimental-petstore.sh deleted file mode 100755 index ea7d839795f5..000000000000 --- a/bin/go-experimental-petstore.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -SPEC="modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml" -GENERATOR="go-experimental" -STUB_DIR="samples/client/petstore/go-experimental/go-petstore" - -echo "Removing files and folders under $STUB_DIR" -rm -rf $STUB_DIR - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/$GENERATOR -i $SPEC -g $GENERATOR -o $STUB_DIR --additional-properties packageName=petstore $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/go-gin-petstore-server.sh b/bin/go-gin-petstore-server.sh deleted file mode 100755 index bbd7cda31648..000000000000 --- a/bin/go-gin-petstore-server.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -SPEC="modules/openapi-generator/src/test/resources/3_0/petstore.yaml" -GENERATOR="go-gin-server" -STUB_DIR="samples/server/petstore/go-gin-api-server" - -echo "Removing auto-generated files and folders under $STUB_DIR" -rm -rf $STUB_DIR/go - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" - -ags="generate -t modules/openapi-generator/src/main/resources/go-gin-server -i $SPEC -g $GENERATOR -o $STUB_DIR --additional-properties packageName=petstoreserver --additional-properties hideGenerationTimestamp=true $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/go-petstore-server.sh b/bin/go-petstore-server.sh deleted file mode 100755 index d58365c5dbe8..000000000000 --- a/bin/go-petstore-server.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -SPEC="modules/openapi-generator/src/test/resources/3_0/petstore.yaml" -GENERATOR="go-server" -STUB_DIR="samples/server/petstore/go-api-server" - -echo "Removing auto-generated files and folders under $STUB_DIR" -rm -rf $STUB_DIR/go - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" - -ags="generate -t modules/openapi-generator/src/main/resources/go-server -i $SPEC -g $GENERATOR -o $STUB_DIR --additional-properties packageName=petstoreserver,hideGenerationTimestamp=true $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/go-petstore-withxml.sh b/bin/go-petstore-withxml.sh deleted file mode 100755 index 4c5754972548..000000000000 --- a/bin/go-petstore-withxml.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -SPEC="modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml" -GENERATOR="go" -STUB_DIR="samples/client/petstore/go/go-petstore-withXml" - -echo "Removing files and folders under $STUB_DIR" -rm -rf $STUB_DIR - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/go -i $SPEC -g $GENERATOR -o $STUB_DIR --additional-properties packageName=petstore,withXml=true,withGoCodegenComment=true $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/go-petstore.sh b/bin/go-petstore.sh deleted file mode 100755 index 7dc5fe4907bf..000000000000 --- a/bin/go-petstore.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -SPEC="modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml" -GENERATOR="go" -STUB_DIR="samples/client/petstore/go/go-petstore" - -echo "Removing files and folders under $STUB_DIR" -rm -rf $STUB_DIR - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/go -i $SPEC -g $GENERATOR -o $STUB_DIR --additional-properties packageName=petstore $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/graphql-nodejs-express-server.sh b/bin/graphql-nodejs-express-server.sh deleted file mode 100755 index 69ee4a3bf556..000000000000 --- a/bin/graphql-nodejs-express-server.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties $@" -ags="generate -t modules/openapi-generator/src/main/resources/graphql-nodejs-express-server -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g graphql-nodejs-express-server -o samples/server/petstore/graphql-nodejs-express-server --additional-properties packageName=petstore $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/graphql-schema-petstore.sh b/bin/graphql-schema-petstore.sh deleted file mode 100755 index b99d3bba8774..000000000000 --- a/bin/graphql-schema-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties $@" -ags="generate -t modules/openapi-generator/src/main/resources/graphql-schema -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g graphql-schema -o samples/config/petstore/graphql-schema --additional-properties packageName=petstore $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/groovy-petstore.sh b/bin/groovy-petstore.sh deleted file mode 100755 index e5e5f688eb33..000000000000 --- a/bin/groovy-petstore.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/Groovy/ -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g groovy -o samples/client/petstore/groovy --additional-properties hideGenerationTimestamp=true $@" -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/haskell-http-client-petstore.sh b/bin/haskell-http-client-petstore.sh deleted file mode 100755 index 4cd7f86083a2..000000000000 --- a/bin/haskell-http-client-petstore.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" - -args="generate -t modules/openapi-generator/src/main/resources/haskell-http-client -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g haskell-http-client -o samples/client/petstore/haskell-http-client $@" - -echo "java ${JAVA_OPTS} -jar ${executable} ${args}" -java $JAVA_OPTS -jar $executable $args diff --git a/bin/haskell-servant-petstore.sh b/bin/haskell-servant-petstore.sh deleted file mode 100755 index 61d272a5805c..000000000000 --- a/bin/haskell-servant-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/haskell-servant -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g haskell -o samples/server/petstore/haskell-servant $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/html-markdown.sh b/bin/html-markdown.sh deleted file mode 100755 index 09d4b9206004..000000000000 --- a/bin/html-markdown.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/2_0/markdown.yaml -g html -o samples/documentation/html.md $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/html-petstore.sh b/bin/html-petstore.sh deleted file mode 100755 index 1b32f50726c2..000000000000 --- a/bin/html-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/htmlDocs -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g html -o samples/documentation/html $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/html2-petstore.sh b/bin/html2-petstore.sh deleted file mode 100755 index 6801db85f490..000000000000 --- a/bin/html2-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g html2 -o samples/documentation/html2 -t modules/openapi-generator/src/main/resources/htmlDocs2/ --additional-properties hideGenerationTimestamp=true $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/java-inflector-petstore-server.sh b/bin/java-inflector-petstore-server.sh deleted file mode 100755 index b37e444a9235..000000000000 --- a/bin/java-inflector-petstore-server.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/JavaInflector -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java-inflector -o samples/server/petstore/java-inflector --additional-properties hideGenerationTimestamp=true $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/java-jaxrs-petstore-server-all.sh b/bin/java-jaxrs-petstore-server-all.sh deleted file mode 100755 index eb6a7bacbdf6..000000000000 --- a/bin/java-jaxrs-petstore-server-all.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh -# script to run all generators extending AbstractJavaJAXRSServerCodegen - -./bin/jaxrs-petstore-server-datelib-j8.sh -./bin/jaxrs-cxf-cdi-petstore-server.sh -./bin/jaxrs-cxf-petstore-server-annotated-base-path.sh -./bin/jaxrs-cxf-petstore-server-non-spring-application.sh -./bin/jaxrs-cxf-petstore-server.sh -./bin/jaxrs-jersey1-petstore-server.sh -./bin/jaxrs-jersey1-usetags-petstore-server.sh -./bin/jaxrs-petstore-server.sh -./bin/jaxrs-resteasy-eap-java8-petstore-server.sh -./bin/jaxrs-resteasy-eap-joda-petstore-server.sh -./bin/jaxrs-resteasy-eap-petstore-server.sh -./bin/jaxrs-resteasy-joda-petstore-server.sh -./bin/jaxrs-resteasy-petstore-server.sh -./bin/jaxrs-spec-petstore-server-interface.sh -./bin/jaxrs-spec-petstore-server.sh -./bin/jaxrs-usetags-petstore-server.sh - -./bin/openapi3/jaxrs-jersey-petstore.sh - -echo " Please run ./bin/jaxrs-cxf-petstore-server-test-data.sh manually instead" diff --git a/bin/java-msf4j-petstore-server.sh b/bin/java-msf4j-petstore-server.sh deleted file mode 100755 index 46ae1caef9a8..000000000000 --- a/bin/java-msf4j-petstore-server.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/java-msf4j-server -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java-msf4j -o samples/server/petstore/java-msf4j/ --additional-properties hideGenerationTimestamp=true --additional-properties artifactId=java-msf4j-server $@" - -echo "Removing files and folders under samples/server/petstore/java-msf4j/src/main" -rm -rf samples/server/petstore/java-msf4j/src/main -find samples/server/petstore/java-msf4j -maxdepth 1 -type f ! -name "README.md" ! -name "pom.xml" ! -name "mvn_test_jdk8_only.sh" ! -name ".openapi-generator-ignore" -exec rm {} + -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/java-petstore-all.sh b/bin/java-petstore-all.sh deleted file mode 100755 index 2277e850bb76..000000000000 --- a/bin/java-petstore-all.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# update java petstore clients for all supported http libraries - -./bin/java-petstore-feign-10x.sh -./bin/java-petstore-google-api-client.sh -./bin/java-petstore-jersey1.sh -./bin/java-petstore-jersey2-java8.sh -./bin/java-petstore-microprofile.sh -./bin/java-petstore-native.sh -./bin/java-petstore-okhttp-gson-parcelable.sh -./bin/java-petstore-okhttp-gson.sh -./bin/java-petstore-rest-assured.sh -./bin/java-petstore-rest-assured-jackson.sh -./bin/java-petstore-resteasy.sh -./bin/java-petstore-resttemplate-withxml.sh -./bin/java-petstore-resttemplate.sh -./bin/java-petstore-retrofit2-play24.sh -./bin/java-petstore-retrofit2-play25.sh -./bin/java-petstore-retrofit2-play26.sh -./bin/java-petstore-retrofit2.sh -./bin/java-petstore-retrofit2rx.sh -./bin/java-petstore-retrofit2rx2.sh -./bin/java-petstore-vertx.sh -./bin/java-petstore-webclient.sh diff --git a/bin/java-petstore-feign-10x.json b/bin/java-petstore-feign-10x.json deleted file mode 100644 index 95949f4a9399..000000000000 --- a/bin/java-petstore-feign-10x.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "library": "feign", - "artifactId": "petstore-feign-10x" -} diff --git a/bin/java-petstore-feign-10x.sh b/bin/java-petstore-feign-10x.sh deleted file mode 100755 index 3a98ad061bb1..000000000000 --- a/bin/java-petstore-feign-10x.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/Java -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-feign-10x.json -o samples/client/petstore/java/feign10x --additional-properties hideGenerationTimestamp=true,booleanGetterPrefix=is $@" - -echo "Removing files and folders under samples/client/petstore/java/feign10x/src/main" -rm -rf samples/client/petstore/java/feign10x/src/main -find samples/client/petstore/java/feign10x -maxdepth 1 -type f ! -name "README.md" -exec rm {} + -java $JAVA_OPTS -jar $executable $ags - -# copy additional manually written unit-tests -mkdir samples/client/petstore/java/feign10x/src/test/java/org/openapitools/client - -cp CI/samples.ci/client/petstore/java/test-manual/common/StringUtilTest.java samples/client/petstore/java/feign10x/src/test/java/org/openapitools/client/StringUtilTest.java diff --git a/bin/java-petstore-google-api-client.json b/bin/java-petstore-google-api-client.json deleted file mode 100644 index c25698724b0a..000000000000 --- a/bin/java-petstore-google-api-client.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "library": "google-api-client", - "artifactId": "petstore-google-api-client" -} diff --git a/bin/java-petstore-google-api-client.sh b/bin/java-petstore-google-api-client.sh deleted file mode 100755 index 866e8d401061..000000000000 --- a/bin/java-petstore-google-api-client.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/Java -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-google-api-client.json -o samples/client/petstore/java/google-api-client --additional-properties hideGenerationTimestamp=true $@" - -echo "Removing files and folders under samples/client/petstore/java/google-api-client/src/main" -rm -rf samples/client/petstore/java/google-api-client/src/main -find samples/client/petstore/java/google-api-client -maxdepth 1 -type f ! -name "README.md" -exec rm {} + -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/java-petstore-jersey1.sh b/bin/java-petstore-jersey1.sh deleted file mode 100755 index 75a399b4766e..000000000000 --- a/bin/java-petstore-jersey1.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate --artifact-id petstore-java-client-jersey1 -t modules/openapi-generator/src/main/resources/Java -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -o samples/client/petstore/java/jersey1 --additional-properties hideGenerationTimestamp=true --library=jersey1 $@" - -echo "Removing files and folders under samples/client/petstore/java/jersey1/src/main" -rm -rf samples/client/petstore/java/jersey1/src/main -find samples/client/petstore/java/jersey1 -maxdepth 1 -type f ! -name "README.md" -exec rm {} + -java $JAVA_OPTS -jar $executable $ags - -# copy additional manually written unit-tests -mkdir samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client -mkdir samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/auth -mkdir samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/model - -cp CI/samples.ci/client/petstore/java/test-manual/common/StringUtilTest.java samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/StringUtilTest.java -cp CI/samples.ci/client/petstore/java/test-manual/jersey1/ApiClientTest.java samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/ApiClientTest.java -cp CI/samples.ci/client/petstore/java/test-manual/common/ConfigurationTest.java samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/ConfigurationTest.java -cp CI/samples.ci/client/petstore/java/test-manual/jersey1/auth/ApiKeyAuthTest.java samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/auth/ApiKeyAuthTest.java -cp CI/samples.ci/client/petstore/java/test-manual/jersey1/auth/HttpBasicAuthTest.java samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/auth/HttpBasicAuthTest.java -cp CI/samples.ci/client/petstore/java/test-manual/jersey1/model/EnumValueTest.java samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/model/EnumValueTest.java diff --git a/bin/java-petstore-jersey2-java8.json b/bin/java-petstore-jersey2-java8.json deleted file mode 100644 index 2c5ee492f6c3..000000000000 --- a/bin/java-petstore-jersey2-java8.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "library": "jersey2", - "artifactId": "petstore-jersey2", - "dateLibrary": "java8" -} diff --git a/bin/java-petstore-jersey2-java8.sh b/bin/java-petstore-jersey2-java8.sh deleted file mode 100755 index d964032cf076..000000000000 --- a/bin/java-petstore-jersey2-java8.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate --artifact-id petstore-jersey2-java8 -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-jersey2-java8.json -o samples/client/petstore/java/jersey2-java8 --additional-properties hideGenerationTimestamp=true --additional-properties serverPort=8082 $@" - -echo "Removing files and folders under samples/client/petstore/java/jersey2-java8/src/main" -rm -rf samples/client/petstore/java/jersey2-java8/src/main -find samples/client/petstore/java/jersey2-java8 -maxdepth 1 -type f ! -name "README.md" -exec rm {} + -java $JAVA_OPTS -jar $executable $ags - -# copy additional manually written unit-tests -mkdir -p samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client -mkdir -p samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/auth -mkdir -p samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model - -cp CI/samples.ci/client/petstore/java/test-manual/common/StringUtilTest.java samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/StringUtilTest.java -cp CI/samples.ci/client/petstore/java/test-manual/jersey2/ApiClientTest.java samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/ApiClientTest.java -cp CI/samples.ci/client/petstore/java/test-manual/common/ConfigurationTest.java samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/ConfigurationTest.java -cp CI/samples.ci/client/petstore/java/test-manual/jersey2/auth/ApiKeyAuthTest.java samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/auth/ApiKeyAuthTest.java -cp CI/samples.ci/client/petstore/java/test-manual/jersey2/auth/HttpBasicAuthTest.java samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/auth/HttpBasicAuthTest.java -cp CI/samples.ci/client/petstore/java/test-manual/jersey2/model/EnumValueTest.java samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/EnumValueTest.java -cp CI/samples.ci/client/petstore/java/test-manual/jersey2-java8/JSONTest.java samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/JSONTest.java diff --git a/bin/java-petstore-microprofile.sh b/bin/java-petstore-microprofile.sh deleted file mode 100755 index b7a93f6a9859..000000000000 --- a/bin/java-petstore-microprofile.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -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 --artifact-id "microprofile-rest-client" -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g java --library microprofile -o samples/client/petstore/java/microprofile-rest-client $@" - -echo "Removing files and folders under samples/client/petstore/java/microprofile-rest-client/src/main" -rm -rf samples/client/petstore/java/microprofile-rest-client/src/main -find samples/client/petstore/java/microprofile-rest-client -maxdepth 1 -type f ! -name "README.md" -exec rm {} + - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/java-petstore-native-async.sh b/bin/java-petstore-native-async.sh deleted file mode 100755 index 1782614d9eea..000000000000 --- a/bin/java-petstore-native-async.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/Java -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-native.json -o samples/client/petstore/java/native-async --additional-properties hideGenerationTimestamp=true,asyncNative=true $@" - -echo "Removing files and folders under samples/client/petstore/java/httpclient/src/main" -rm -rf samples/client/petstore/java/native-async/src/main -find samples/client/petstore/java/native-async -maxdepth 1 -type f ! -name "README.md" -exec rm {} + -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/java-petstore-native.json b/bin/java-petstore-native.json deleted file mode 100644 index b5642e5b5369..000000000000 --- a/bin/java-petstore-native.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "library": "native", - "artifactId": "petstore-native" -} diff --git a/bin/java-petstore-native.sh b/bin/java-petstore-native.sh deleted file mode 100755 index 063275017e9e..000000000000 --- a/bin/java-petstore-native.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/Java -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-native.json -o samples/client/petstore/java/native --additional-properties hideGenerationTimestamp=true $@" - -echo "Removing files and folders under samples/client/petstore/java/httpclient/src/main" -rm -rf samples/client/petstore/java/native/src/main -find samples/client/petstore/java/native -maxdepth 1 -type f ! -name "README.md" -exec rm {} + -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/java-petstore-okhttp-gson-parcelable.sh b/bin/java-petstore-okhttp-gson-parcelable.sh deleted file mode 100755 index 92087756ddbd..000000000000 --- a/bin/java-petstore-okhttp-gson-parcelable.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate --artifact-id petstore-okhttp-gson-parcelableModel -t modules/openapi-generator/src/main/resources/Java -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-okhttp-gson.json -o samples/client/petstore/java/okhttp-gson-parcelableModel --additional-properties hideGenerationTimestamp=true,parcelableModel=true $@" - -rm -rf samples/client/petstore/java/okhttp-gson-parcelableModel/src/main -find samples/client/petstore/java/okhttp-gson-parcelableModel -maxdepth 1 -type f ! -name "README.md" -exec rm {} + -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/java-petstore-okhttp-gson.json b/bin/java-petstore-okhttp-gson.json deleted file mode 100644 index 8ee5473563b9..000000000000 --- a/bin/java-petstore-okhttp-gson.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "library": "okhttp-gson", - "artifactId": "petstore-okhttp-gson" -} diff --git a/bin/java-petstore-okhttp-gson.sh b/bin/java-petstore-okhttp-gson.sh deleted file mode 100755 index 8e2e527d2a3e..000000000000 --- a/bin/java-petstore-okhttp-gson.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/Java -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-okhttp-gson.json -o samples/client/petstore/java/okhttp-gson --additional-properties hideGenerationTimestamp=true $@" - -rm -rf samples/client/petstore/java/okhttp-gson/src/main -find samples/client/petstore/java/okhttp-gson -maxdepth 1 -type f ! -name "README.md" -exec rm {} + -java $JAVA_OPTS -jar $executable $ags - -# copy additional manually written unit-tests -mkdir -p samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client -mkdir -p samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/auth -mkdir -p samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model - -cp CI/samples.ci/client/petstore/java/test-manual/common/StringUtilTest.java samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/StringUtilTest.java -cp CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/ApiClientTest.java samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/ApiClientTest.java -cp CI/samples.ci/client/petstore/java/test-manual/common/ConfigurationTest.java samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/ConfigurationTest.java -cp CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/auth/ApiKeyAuthTest.java samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/auth/ApiKeyAuthTest.java -cp CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/auth/HttpBasicAuthTest.java samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/auth/HttpBasicAuthTest.java -cp CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/model/EnumValueTest.java samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/EnumValueTest.java -cp CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/model/PetTest.java samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/PetTest.java -cp CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/model/ArrayOfArrayOfNumberOnlyTest.java samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java -cp CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/JSONTest.java samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/JSONTest.java -cp CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/api/PetApiTest.java samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/PetApiTest.java diff --git a/bin/java-petstore-rest-assured-jackson.json b/bin/java-petstore-rest-assured-jackson.json deleted file mode 100644 index d6e6035df801..000000000000 --- a/bin/java-petstore-rest-assured-jackson.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "library": "rest-assured", - "artifactId": "petstore-rest-assured-jackson" -} diff --git a/bin/java-petstore-rest-assured-jackson.sh b/bin/java-petstore-rest-assured-jackson.sh deleted file mode 100755 index b5d1888032b9..000000000000 --- a/bin/java-petstore-rest-assured-jackson.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" -target_dir="./samples/client/petstore/java/rest-assured-jackson/" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -args="generate -t modules/openapi-generator/src/main/resources/Java -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-rest-assured-jackson.json -o ${target_dir} --additional-properties hideGenerationTimestamp=true --additional-properties useBeanValidation=true --additional-properties performBeanValidation=true --additional-properties booleanGetterPrefix=is --additional-properties java8=true --additional-properties dateLibrary=java8 --additional-properties serializationLibrary=jackson $@" - -echo "Removing ${target_dir}" -rm -rf "${target_dir}" - -java $JAVA_OPTS -jar $executable $args diff --git a/bin/java-petstore-rest-assured.json b/bin/java-petstore-rest-assured.json deleted file mode 100644 index 86e6216a23f4..000000000000 --- a/bin/java-petstore-rest-assured.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "library": "rest-assured", - "artifactId": "petstore-rest-assured" -} diff --git a/bin/java-petstore-rest-assured.sh b/bin/java-petstore-rest-assured.sh deleted file mode 100755 index 81f1893ed895..000000000000 --- a/bin/java-petstore-rest-assured.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/Java -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-rest-assured.json -o samples/client/petstore/java/rest-assured --additional-properties hideGenerationTimestamp=true --additional-properties useBeanValidation=true --additional-properties performBeanValidation=true --additional-properties booleanGetterPrefix=is $@" - -echo "Removing files and folders under samples/client/petstore/java/rest-assured/src/main" -rm -rf samples/client/petstore/java/rest-assured/src/main -find samples/client/petstore/java/rest-assured -maxdepth 1 -type f ! -name "README.md" -exec rm {} + -java $JAVA_OPTS -jar $executable $ags - diff --git a/bin/java-petstore-resteasy-all.sh b/bin/java-petstore-resteasy-all.sh deleted file mode 100755 index c1a346943f79..000000000000 --- a/bin/java-petstore-resteasy-all.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -./bin/java-petstore-resteasy.sh -./bin/jaxrs-resteasy-eap-petstore-server.sh -./bin/jaxrs-resteasy-eap-java8-petstore-server.sh -./bin/jaxrs-resteasy-joda-petstore-server.sh -./bin/jaxrs-resteasy-eap-joda-petstore-server.sh -./bin/jaxrs-resteasy-petstore-server.sh* diff --git a/bin/java-petstore-resteasy.json b/bin/java-petstore-resteasy.json deleted file mode 100644 index 6998a56fd74a..000000000000 --- a/bin/java-petstore-resteasy.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "library": "resteasy", - "artifactId": "petstore-resteasy" -} diff --git a/bin/java-petstore-resteasy.sh b/bin/java-petstore-resteasy.sh deleted file mode 100755 index ae6113741313..000000000000 --- a/bin/java-petstore-resteasy.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-resteasy.json -o samples/client/petstore/java/resteasy --additional-properties hideGenerationTimestamp=true $@" - -echo "Removing files and folders under samples/client/petstore/java/resteasy/src/main" -rm -rf samples/client/petstore/java/resteasy/src/main -find samples/client/petstore/java/resteasy -maxdepth 1 -type f ! -name "README.md" -exec rm {} + -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/java-petstore-resttemplate-withxml.sh b/bin/java-petstore-resttemplate-withxml.sh deleted file mode 100755 index 19c142a2d4f9..000000000000 --- a/bin/java-petstore-resttemplate-withxml.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml --artifact-id petstore-resttemplate-withxml -g java -c bin/java-petstore-resttemplate.json -o samples/client/petstore/java/resttemplate-withXml --additional-properties hideGenerationTimestamp=true,withXml=true $@" - -echo "Removing files and folders under samples/client/petstore/java/resttemplate/src/main" -rm -rf samples/client/petstore/java/resttemplate-withXml/src/main -find samples/client/petstore/java/resttemplate-withXml -maxdepth 1 -type f ! -name "README.md" -exec rm {} + -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/java-petstore-resttemplate.json b/bin/java-petstore-resttemplate.json deleted file mode 100644 index ab1bc1e4dd79..000000000000 --- a/bin/java-petstore-resttemplate.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "library": "resttemplate", - "artifactId": "petstore-resttemplate" -} diff --git a/bin/java-petstore-resttemplate.sh b/bin/java-petstore-resttemplate.sh deleted file mode 100755 index d37d40059ffe..000000000000 --- a/bin/java-petstore-resttemplate.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-resttemplate.json -o samples/client/petstore/java/resttemplate --additional-properties hideGenerationTimestamp=true $@" - -echo "Removing files and folders under samples/client/petstore/java/resttemplate/src/main" -rm -rf samples/client/petstore/java/resttemplate/src/main -find samples/client/petstore/java/resttemplate -maxdepth 1 -type f ! -name "README.md" -exec rm {} + -java $JAVA_OPTS -jar $executable $ags - -# copy additional manually written unit-tests -mkdir samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client -mkdir samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/auth -mkdir samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/model - -cp CI/samples.ci/client/petstore/java/test-manual/resttemplate/ApiClientTest.java samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/ApiClientTest.java -cp CI/samples.ci/client/petstore/java/test-manual/resttemplate/auth/ApiKeyAuthTest.java samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/auth/ApiKeyAuthTest.java -cp CI/samples.ci/client/petstore/java/test-manual/resttemplate/auth/HttpBasicAuthTest.java samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/auth/HttpBasicAuthTest.java -cp CI/samples.ci/client/petstore/java/test-manual/resttemplate/model/EnumValueTest.java samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/model/EnumValueTest.java diff --git a/bin/java-petstore-retrofit2-all.sh b/bin/java-petstore-retrofit2-all.sh deleted file mode 100755 index 656006917a7f..000000000000 --- a/bin/java-petstore-retrofit2-all.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -./bin/java-petstore-retrofit2-play24.sh -./bin/java-petstore-retrofit2-play25.sh -./bin/java-petstore-retrofit2-play26.sh -./bin/java-petstore-retrofit2.sh -./bin/java-petstore-retrofit2rx.sh -./bin/java-petstore-retrofit2rx2.sh diff --git a/bin/java-petstore-retrofit2-play24.json b/bin/java-petstore-retrofit2-play24.json deleted file mode 100644 index f5398065c209..000000000000 --- a/bin/java-petstore-retrofit2-play24.json +++ /dev/null @@ -1 +0,0 @@ -{"useBeanValidation":"true","enableBuilderSupport":"true","library":"retrofit2","usePlayWS":"true","playVersion":"play24","dateLibrary":"java8"} diff --git a/bin/java-petstore-retrofit2-play24.sh b/bin/java-petstore-retrofit2-play24.sh deleted file mode 100755 index 4b94855865e8..000000000000 --- a/bin/java-petstore-retrofit2-play24.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate --artifact-id petstore-java-client-retrofit2-play24 -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-retrofit2-play24.json -o samples/client/petstore/java/retrofit2-play24 --additional-properties hideGenerationTimestamp=true $@" - -echo "Removing files and folders under samples/client/petstore/java/retrofit2-play24/src/main" -rm -rf samples/client/petstore/java/retrofit2-play24/src/main -find samples/client/petstore/java/retrofit2-play24 -maxdepth 1 -type f ! -name "README.md" -exec rm {} + -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/java-petstore-retrofit2-play25.json b/bin/java-petstore-retrofit2-play25.json deleted file mode 100644 index 49eda94f83ad..000000000000 --- a/bin/java-petstore-retrofit2-play25.json +++ /dev/null @@ -1 +0,0 @@ -{"useBeanValidation":"true","enableBuilderSupport":"true","library":"retrofit2","usePlayWS":"true","playVersion":"play25"} diff --git a/bin/java-petstore-retrofit2-play25.sh b/bin/java-petstore-retrofit2-play25.sh deleted file mode 100755 index 1954c2e045ee..000000000000 --- a/bin/java-petstore-retrofit2-play25.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate --artifact-id petstore-java-client-retrofit2-play25 -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-retrofit2-play25.json -o samples/client/petstore/java/retrofit2-play25 --additional-properties hideGenerationTimestamp=true $@" - -echo "Removing files and folders under samples/client/petstore/java/retrofit2-play25/src/main" -rm -rf samples/client/petstore/java/retrofit2-play25/src/main -find samples/client/petstore/java/retrofit2-play25 -maxdepth 1 -type f ! -name "README.md" -exec rm {} + -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/java-petstore-retrofit2-play26.json b/bin/java-petstore-retrofit2-play26.json deleted file mode 100644 index 0c7456430d4a..000000000000 --- a/bin/java-petstore-retrofit2-play26.json +++ /dev/null @@ -1 +0,0 @@ -{"useBeanValidation":"true","enableBuilderSupport":"true","library":"retrofit2","usePlayWS":"true","playVersion":"play26"} diff --git a/bin/java-petstore-retrofit2-play26.sh b/bin/java-petstore-retrofit2-play26.sh deleted file mode 100755 index 0c582d09af19..000000000000 --- a/bin/java-petstore-retrofit2-play26.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate --artifact-id petstore-java-client-retrofit2-play26 -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-retrofit2-play26.json -o samples/client/petstore/java/retrofit2-play26 --additional-properties hideGenerationTimestamp=true $@" - -echo "Removing files and folders under samples/client/petstore/java/retrofit2-play26/src/main" -rm -rf samples/client/petstore/java/retrofit2-play26/src/main -find samples/client/petstore/java/retrofit2-play26 -maxdepth 1 -type f ! -name "README.md" -exec rm {} + -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/java-petstore-retrofit2.json b/bin/java-petstore-retrofit2.json deleted file mode 100644 index dd835a73442f..000000000000 --- a/bin/java-petstore-retrofit2.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "library": "retrofit2", - "artifactId": "petstore-retrofit2" -} diff --git a/bin/java-petstore-retrofit2.sh b/bin/java-petstore-retrofit2.sh deleted file mode 100755 index 09bd66f45409..000000000000 --- a/bin/java-petstore-retrofit2.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/Java -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-retrofit2.json -o samples/client/petstore/java/retrofit2 --additional-properties hideGenerationTimestamp=true $@" - -echo "Removing files and folders under samples/client/petstore/java/retrofit2/src/main" -rm -rf samples/client/petstore/java/retrofit2/src/main -find samples/client/petstore/java/retrofit2 -maxdepth 1 -type f ! -name "README.md" -exec rm {} + -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/java-petstore-retrofit2rx.json b/bin/java-petstore-retrofit2rx.json deleted file mode 100644 index 739b1ddd272e..000000000000 --- a/bin/java-petstore-retrofit2rx.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "library": "retrofit2", - "artifactId": "petstore-retrofit2-rx" -} diff --git a/bin/java-petstore-retrofit2rx.sh b/bin/java-petstore-retrofit2rx.sh deleted file mode 100755 index c1ddc268e5ab..000000000000 --- a/bin/java-petstore-retrofit2rx.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/Java -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-retrofit2rx.json -o samples/client/petstore/java/retrofit2rx --additional-properties useRxJava=true,hideGenerationTimestamp=true $@" - -echo "Removing files and folders under samples/client/petstore/java/retrofit2rx/src/main" -rm -rf samples/client/petstore/java/retrofit2rx/src/main -find samples/client/petstore/java/retrofit2rx -maxdepth 1 -type f ! -name "README.md" -exec rm {} + -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/java-petstore-retrofit2rx2.json b/bin/java-petstore-retrofit2rx2.json deleted file mode 100644 index 1f4fb2918972..000000000000 --- a/bin/java-petstore-retrofit2rx2.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "library": "retrofit2", - "artifactId": "petstore-retrofit2-rx2" -} diff --git a/bin/java-petstore-retrofit2rx2.sh b/bin/java-petstore-retrofit2rx2.sh deleted file mode 100755 index 9e7d0fe40466..000000000000 --- a/bin/java-petstore-retrofit2rx2.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/Java -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-retrofit2rx2.json -o samples/client/petstore/java/retrofit2rx2 --additional-properties useRxJava2=true,hideGenerationTimestamp=true $@" - -echo "Removing files and folders under samples/client/petstore/java/retrofit2rx2/src/main" -rm -rf samples/client/petstore/java/retrofit2rx2/src/main -find samples/client/petstore/java/retrofit2rx2 -maxdepth 1 -type f ! -name "README.md" -exec rm {} + -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/java-petstore-vertx.json b/bin/java-petstore-vertx.json deleted file mode 100644 index 620481d02217..000000000000 --- a/bin/java-petstore-vertx.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "library": "vertx", - "dateLibrary": "java8", - "artifactId": "petstore-vertx" -} diff --git a/bin/java-petstore-vertx.sh b/bin/java-petstore-vertx.sh deleted file mode 100755 index a2536a3dbf28..000000000000 --- a/bin/java-petstore-vertx.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/Java -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-vertx.json -o samples/client/petstore/java/vertx --additional-properties hideGenerationTimestamp=true $@" - -echo "Removing files and folders under samples/client/petstore/java/vertx/src/main" -rm -rf samples/client/petstore/java/vertx/src/main -find samples/client/petstore/java/vertx -maxdepth 1 -type f ! -name "README.md" -exec rm {} + -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/java-petstore-webclient.json b/bin/java-petstore-webclient.json deleted file mode 100644 index 822ddccce55e..000000000000 --- a/bin/java-petstore-webclient.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "library": "webclient", - "artifactId": "petstore-webclient" -} diff --git a/bin/java-petstore-webclient.sh b/bin/java-petstore-webclient.sh deleted file mode 100755 index c9402c60c0aa..000000000000 --- a/bin/java-petstore-webclient.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-webclient.json -o samples/client/petstore/java/webclient --additional-properties hideGenerationTimestamp=true $@" - -echo "Removing files and folders under samples/client/petstore/java/webclient/src/main" -rm -rf samples/client/petstore/java/webclient/src/main -find samples/client/petstore/java/webclient -maxdepth 1 -type f ! -name "README.md" -exec rm {} + -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/java-pkmst-petstore-server.sh b/bin/java-pkmst-petstore-server.sh deleted file mode 100755 index 25d1c953197a..000000000000 --- a/bin/java-pkmst-petstore-server.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/java-pkmst -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g java-pkmst -o samples/server/petstore/java-pkmst/ --additional-properties hideGenerationTimestamp=true $@" - -echo "Removing files and folders under samples/server/petstore/java-pkmst/src/main" -rm -rf samples/server/petstore/java-pkmst/src/main -find samples/server/petstore/java-pkmst/ -maxdepth 1 -type f ! -name "README.md" -exec rm {} + -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/java-play-framework-petstore-server-all.sh b/bin/java-play-framework-petstore-server-all.sh deleted file mode 100755 index fa4fd9daf90e..000000000000 --- a/bin/java-play-framework-petstore-server-all.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -./bin/java-play-framework-petstore-server.sh -./bin/java-play-framework-petstore-server-controller-only.sh -./bin/java-play-framework-petstore-server-no-bean-validation.sh -./bin/java-play-framework-petstore-server-no-exception-handling.sh -./bin/java-play-framework-petstore-server-no-interface.sh -./bin/java-play-framework-petstore-server-no-swagger-ui.sh -./bin/java-play-framework-petstore-server-no-wrap-calls.sh -./bin/java-play-framework-petstore-server-fake-endpoints.sh -./bin/java-play-framework-petstore-server-api-package-override.sh -./bin/java-play-framework-petstore-server-async.sh diff --git a/bin/java-play-framework-petstore-server-api-package-override.sh b/bin/java-play-framework-petstore-server-api-package-override.sh deleted file mode 100755 index cba7507689e0..000000000000 --- a/bin/java-play-framework-petstore-server-api-package-override.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/JavaPlayFramework -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g java-play-framework -o samples/server/petstore/java-play-framework-api-package-override --additional-properties hideGenerationTimestamp=true,apiPackage=com.puppies.store.apis $@" - -java $JAVA_OPTS -jar $executable $ags - -cp CI/samples.ci/server/petstore/java-play-framework-api-package-override/pom.xml samples/server/petstore/java-play-framework-api-package-override/pom.xml diff --git a/bin/java-play-framework-petstore-server-async.json b/bin/java-play-framework-petstore-server-async.json deleted file mode 100755 index 69161a46d0f2..000000000000 --- a/bin/java-play-framework-petstore-server-async.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "additionalProperties" : { - "supportAsync" : true - } -} diff --git a/bin/java-play-framework-petstore-server-async.sh b/bin/java-play-framework-petstore-server-async.sh deleted file mode 100755 index c09f9772fa3c..000000000000 --- a/bin/java-play-framework-petstore-server-async.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/JavaPlayFramework -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g java-play-framework -c bin/java-play-framework-petstore-server-async.json -o samples/server/petstore/java-play-framework-async --additional-properties hideGenerationTimestamp=true $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/java-play-framework-petstore-server-controller-only.sh b/bin/java-play-framework-petstore-server-controller-only.sh deleted file mode 100755 index 85a232612216..000000000000 --- a/bin/java-play-framework-petstore-server-controller-only.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/JavaPlayFramework -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g java-play-framework -o samples/server/petstore/java-play-framework-controller-only --additional-properties hideGenerationTimestamp=true,controllerOnly=true $@" - -java $JAVA_OPTS -jar $executable $ags - -cp CI/samples.ci/server/petstore/java-play-framework-controller-only/pom.xml samples/server/petstore/java-play-framework-controller-only/pom.xml diff --git a/bin/java-play-framework-petstore-server-fake-endpoints.sh b/bin/java-play-framework-petstore-server-fake-endpoints.sh deleted file mode 100755 index 0ae05412047e..000000000000 --- a/bin/java-play-framework-petstore-server-fake-endpoints.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/JavaPlayFramework -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java-play-framework -o samples/server/petstore/java-play-framework-fake-endpoints --additional-properties hideGenerationTimestamp=true $@" - -java $JAVA_OPTS -jar $executable $ags - -cp CI/samples.ci/server/petstore/java-play-framework-fake-endpoints/pom.xml samples/server/petstore/java-play-framework-fake-endpoints/pom.xml diff --git a/bin/java-play-framework-petstore-server-no-bean-validation.sh b/bin/java-play-framework-petstore-server-no-bean-validation.sh deleted file mode 100755 index 92b924b73d03..000000000000 --- a/bin/java-play-framework-petstore-server-no-bean-validation.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/JavaPlayFramework -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g java-play-framework -o samples/server/petstore/java-play-framework-no-bean-validation --additional-properties hideGenerationTimestamp=true,useBeanValidation=false $@" - -java $JAVA_OPTS -jar $executable $ags - -cp CI/samples.ci/server/petstore/java-play-framework-no-bean-validation/pom.xml samples/server/petstore/java-play-framework-no-bean-validation/pom.xml diff --git a/bin/java-play-framework-petstore-server-no-exception-handling.sh b/bin/java-play-framework-petstore-server-no-exception-handling.sh deleted file mode 100755 index b9fe281c4c1a..000000000000 --- a/bin/java-play-framework-petstore-server-no-exception-handling.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/JavaPlayFramework -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g java-play-framework -o samples/server/petstore/java-play-framework-no-exception-handling --additional-properties hideGenerationTimestamp=true,handleExceptions=false $@" - -java $JAVA_OPTS -jar $executable $ags - -cp CI/samples.ci/server/petstore/java-play-framework-no-exception-handling/pom.xml samples/server/petstore/java-play-framework-no-exception-handling/pom.xml diff --git a/bin/java-play-framework-petstore-server-no-interface.sh b/bin/java-play-framework-petstore-server-no-interface.sh deleted file mode 100755 index dbc4b8734ab7..000000000000 --- a/bin/java-play-framework-petstore-server-no-interface.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/JavaPlayFramework -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g java-play-framework -o samples/server/petstore/java-play-framework-no-interface --additional-properties hideGenerationTimestamp=true,useInterfaces=false $@" - -java $JAVA_OPTS -jar $executable $ags - -cp CI/samples.ci/server/petstore/java-play-framework-no-interface/pom.xml samples/server/petstore/java-play-framework-no-interface/pom.xml diff --git a/bin/java-play-framework-petstore-server-no-swagger-ui.sh b/bin/java-play-framework-petstore-server-no-swagger-ui.sh deleted file mode 100755 index 494a0253161b..000000000000 --- a/bin/java-play-framework-petstore-server-no-swagger-ui.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/JavaPlayFramework -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g java-play-framework -o samples/server/petstore/java-play-framework-no-swagger-ui --additional-properties hideGenerationTimestamp=true,useSwaggerUI=false $@" - -java $JAVA_OPTS -jar $executable $ags - -cp CI/samples.ci/server/petstore/java-play-framework-no-swagger-ui/pom.xml samples/server/petstore/java-play-framework-no-swagger-ui/pom.xml diff --git a/bin/java-play-framework-petstore-server-no-wrap-calls.sh b/bin/java-play-framework-petstore-server-no-wrap-calls.sh deleted file mode 100755 index 7de56cc566e1..000000000000 --- a/bin/java-play-framework-petstore-server-no-wrap-calls.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/JavaPlayFramework -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g java-play-framework -o samples/server/petstore/java-play-framework-no-wrap-calls --additional-properties hideGenerationTimestamp=true,wrapCalls=false $@" - -java $JAVA_OPTS -jar $executable $ags - -cp CI/samples.ci/server/petstore/java-play-framework-no-wrap-calls/pom.xml samples/server/petstore/java-play-framework-no-wrap-calls/pom.xml diff --git a/bin/java-play-framework-petstore-server.sh b/bin/java-play-framework-petstore-server.sh deleted file mode 100755 index b187c2e47b9b..000000000000 --- a/bin/java-play-framework-petstore-server.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/JavaPlayFramework -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g java-play-framework -o samples/server/petstore/java-play-framework --additional-properties hideGenerationTimestamp=true $@" - -java $JAVA_OPTS -jar $executable $ags - -cp CI/samples.ci/server/petstore/java-play-framework/pom.xml samples/server/petstore/java-play-framework/pom.xml diff --git a/bin/java-undertow-petstore-server.sh b/bin/java-undertow-petstore-server.sh deleted file mode 100755 index 957d75925234..000000000000 --- a/bin/java-undertow-petstore-server.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/java-undertow-server -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g java-undertow-server -o samples/server/petstore/java-undertow --additional-properties hideGenerationTimestamp=true $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/java-vertx-async-petstore-server.sh b/bin/java-vertx-async-petstore-server.sh deleted file mode 100755 index 519dd79c2b31..000000000000 --- a/bin/java-vertx-async-petstore-server.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g java-vertx -o samples/server/petstore/java-vertx/async --additional-properties vertxSwaggerRouterVersion=1.4.0,hideGenerationTimestamp=true $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/java-vertx-rx-petstore-server.sh b/bin/java-vertx-rx-petstore-server.sh deleted file mode 100755 index 651f03f777dd..000000000000 --- a/bin/java-vertx-rx-petstore-server.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g java-vertx --artifact-id java-vertx-rx-server -o samples/server/petstore/java-vertx/rx --additional-properties vertxSwaggerRouterVersion=1.4.0,rxInterface=true --additional-properties hideGenerationTimestamp=true $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/java-vertx-web-rx-petstore-server.sh b/bin/java-vertx-web-rx-petstore-server.sh deleted file mode 100755 index 16a9b48ed186..000000000000 --- a/bin/java-vertx-web-rx-petstore-server.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -SPEC="modules/openapi-generator/src/test/resources/3_0/petstore.yaml" -GENERATOR="java-vertx-web" -TEMPLATE="modules/openapi-generator/src/main/resources/JavaVertXWebServer" -STUB_DIR="samples/server/petstore/java-vertx-web/rx" - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i $SPEC -t $TEMPLATE -g $GENERATOR --artifact-id java-vertx-web-rx-server -o $STUB_DIR --additional-properties hideGenerationTimestamp=true $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/javascript-apollo-petstore.sh b/bin/javascript-apollo-petstore.sh deleted file mode 100755 index 13a20dea5707..000000000000 --- a/bin/javascript-apollo-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/Javascript-Apollo -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g javascript-apollo -o samples/client/petstore/javascript-apollo --additional-properties appName=PetstoreClient $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/javascript-closure-angular.sh b/bin/javascript-closure-angular.sh deleted file mode 100755 index b3cac1c21d99..000000000000 --- a/bin/javascript-closure-angular.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g javascript-closure-angular -o samples/client/petstore/javascript-closure-angular $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/javascript-es6-petstore.sh b/bin/javascript-es6-petstore.sh deleted file mode 100755 index 518d3382b92a..000000000000 --- a/bin/javascript-es6-petstore.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/Javascript/es6 \ --i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g javascript \ --o samples/client/petstore/javascript-es6 --additional-properties appName=PetstoreClient $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/javascript-flowtyped-petstore.sh b/bin/javascript-flowtyped-petstore.sh deleted file mode 100755 index 061837a63843..000000000000 --- a/bin/javascript-flowtyped-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/Javascript-Flowtyped -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g javascript-flowtyped -o samples/client/petstore/javascript-flowtyped --additional-properties appName=PetstoreClient $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/javascript-petstore-all.sh b/bin/javascript-petstore-all.sh deleted file mode 100755 index 1a3a72af7ef2..000000000000 --- a/bin/javascript-petstore-all.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -./bin/javascript-es6-petstore.sh -./bin/javascript-promise-es6-petstore.sh diff --git a/bin/javascript-promise-es6-petstore.sh b/bin/javascript-promise-es6-petstore.sh deleted file mode 100755 index 42a866b1d655..000000000000 --- a/bin/javascript-promise-es6-petstore.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/Javascript/es6 \ --i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g javascript \ --o samples/client/petstore/javascript-promise-es6 \ ---additional-properties appName=PetstoreClient,usePromises=true $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/jaxrs-cxf-cdi-petstore-server.sh b/bin/jaxrs-cxf-cdi-petstore-server.sh deleted file mode 100755 index 3d1e538c3944..000000000000 --- a/bin/jaxrs-cxf-cdi-petstore-server.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g jaxrs-cxf-cdi -o samples/server/petstore/jaxrs-cxf-cdi --additional-properties hideGenerationTimestamp=true $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/jaxrs-cxf-client-petstore.sh b/bin/jaxrs-cxf-client-petstore.sh deleted file mode 100755 index 97346c61121d..000000000000 --- a/bin/jaxrs-cxf-client-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate --artifact-id "jaxrs-cxf-petstore-client" -t modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/ -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g jaxrs-cxf-client -o samples/client/petstore/jaxrs-cxf-client $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/jaxrs-cxf-petstore-server-annotated-base-path.sh b/bin/jaxrs-cxf-petstore-server-annotated-base-path.sh deleted file mode 100755 index 3c8b96a2e64c..000000000000 --- a/bin/jaxrs-cxf-petstore-server-annotated-base-path.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate --artifact-id cxf-annotated-basepath -t modules/openapi-generator/src/main/resources/JavaJaxRS/cxf -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g jaxrs-cxf -o samples/server/petstore/jaxrs-cxf-annotated-base-path --additional-properties hideGenerationTimestamp=true,useAnnotatedBasePath=true --additional-properties serverPort=8082 $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/jaxrs-cxf-petstore-server-non-spring-application.sh b/bin/jaxrs-cxf-petstore-server-non-spring-application.sh deleted file mode 100755 index 6db712b74bb8..000000000000 --- a/bin/jaxrs-cxf-petstore-server-non-spring-application.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate --artifact-id cxf-server-non-spring -t modules/openapi-generator/src/main/resources/JavaJaxRS/cxf -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g jaxrs-cxf -o samples/server/petstore/jaxrs-cxf-non-spring-app --additional-properties hideGenerationTimestamp=true,generateNonSpringApplication=true --additional-properties serverPort=8082 $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/jaxrs-cxf-petstore-server-test-data.sh b/bin/jaxrs-cxf-petstore-server-test-data.sh deleted file mode 100755 index 6844b7bcf847..000000000000 --- a/bin/jaxrs-cxf-petstore-server-test-data.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate --artifact-id cxf-test-data -t modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g jaxrs-cxf-extended -o samples/server/petstore/jaxrs-cxf-test-data --additional-properties hideGenerationTimestamp=true,useAnnotatedBasePath=true --generate-alias-as-model --additional-properties java8=true,generateSpringApplication=true,generateSpringBootApplication=true,generateOperationBody=true,loadTestDataFromFile=true $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/jaxrs-cxf-petstore-server.sh b/bin/jaxrs-cxf-petstore-server.sh deleted file mode 100755 index 4081b01e8624..000000000000 --- a/bin/jaxrs-cxf-petstore-server.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -echo "Removing files and folders under samples/server/petstore/jaxrs-cxf" -rm -rf samples/server/petstore/jaxrs-cxf - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/JavaJaxRS/cxf -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g jaxrs-cxf -o samples/server/petstore/jaxrs-cxf --additional-properties hideGenerationTimestamp=true --additional-properties serverPort=8082 $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/jaxrs-datelib-j8.json b/bin/jaxrs-datelib-j8.json deleted file mode 100644 index 7752cec1eeff..000000000000 --- a/bin/jaxrs-datelib-j8.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "serializableModel": true, - "withXml": true, - "dateLibrary": "java8", - "java8": true, - "useBeanValidation": true -} diff --git a/bin/jaxrs-jersey1-petstore-server.sh b/bin/jaxrs-jersey1-petstore-server.sh deleted file mode 100755 index 3cc7cc87615a..000000000000 --- a/bin/jaxrs-jersey1-petstore-server.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/JavaJaxRS -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g jaxrs-jersey -o samples/server/petstore/jaxrs/jersey1 --additional-properties hideGenerationTimestamp=true,serverPort=8082 --library=jersey1 --artifact-id=jaxrs-jersey1-server $@" - -echo "Removing files and folders under samples/server/petstore/jaxrs/jersey1/src/main" -rm -rf samples/server/petstore/jaxrs/jersey1/src/main -find samples/server/petstore/jaxrs/jersey1 -maxdepth 1 -type f ! -name "README.md" -exec rm {} + -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/jaxrs-jersey1-usetags-petstore-server.sh b/bin/jaxrs-jersey1-usetags-petstore-server.sh deleted file mode 100755 index 00746c68db1e..000000000000 --- a/bin/jaxrs-jersey1-usetags-petstore-server.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/JavaJaxRS -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g jaxrs-jersey -o samples/server/petstore/jaxrs/jersey1-useTags --additional-properties hideGenerationTimestamp=true,serverPort=8082 --library=jersey1 --artifact-id=jaxrs-jersey1-useTags --additional-properties useTags=true $@" - -echo "Removing files and folders under samples/server/petstore/jaxrs/jersey1-useTags/src/main" -rm -rf samples/server/petstore/jaxrs/jersey1-useTags/src/main -find samples/server/petstore/jaxrs/jersey1-useTags -maxdepth 1 -type f ! -name "README.md" -exec rm {} + -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/jaxrs-petstore-server-datelib-j8.sh b/bin/jaxrs-petstore-server-datelib-j8.sh deleted file mode 100755 index 64e9caff3bf3..000000000000 --- a/bin/jaxrs-petstore-server-datelib-j8.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/JavaJaxRS/ -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g jaxrs-jersey -o samples/server/petstore/jaxrs-datelib-j8/ -c ./bin/jaxrs-datelib-j8.json --additional-properties hideGenerationTimestamp=true --additional-properties serverPort=8082 $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/jaxrs-petstore-server.sh b/bin/jaxrs-petstore-server.sh deleted file mode 100755 index a75e5d3e55b0..000000000000 --- a/bin/jaxrs-petstore-server.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate --artifact-id jaxrs-jersey-petstore-server -t modules/openapi-generator/src/main/resources/JavaJaxRS -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g jaxrs-jersey -o samples/server/petstore/jaxrs/jersey2 --additional-properties hideGenerationTimestamp=true,serverPort=8082 $@" - -echo "Removing files and folders under samples/server/petstore/jaxrs/jersey2/src/main" -rm -rf samples/server/petstore/jaxrs/jersey2/src/main -find samples/server/petstore/jaxrs/jersey2 -maxdepth 1 -type f ! -name "README.md" -exec rm {} + -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/jaxrs-resteasy-eap-java8-petstore-server.json b/bin/jaxrs-resteasy-eap-java8-petstore-server.json deleted file mode 100644 index 3d80aca58ced..000000000000 --- a/bin/jaxrs-resteasy-eap-java8-petstore-server.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "dateLibrary": "java8" -} diff --git a/bin/jaxrs-resteasy-eap-java8-petstore-server.sh b/bin/jaxrs-resteasy-eap-java8-petstore-server.sh deleted file mode 100755 index 8b85c9037221..000000000000 --- a/bin/jaxrs-resteasy-eap-java8-petstore-server.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate --artifact-id jaxrs-resteasy-eap-java8-server -t modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g jaxrs-resteasy-eap -o samples/server/petstore/jaxrs-resteasy/eap-java8 --additional-properties hideGenerationTimestamp=true -c ./bin/jaxrs-resteasy-eap-java8-petstore-server.json $@" - -echo "Removing files and folders under samples/server/petstore/jaxrs-resteasy/eap-java8/src/main" -rm -rf samples/server/petstore/jaxrs-resteasy/eap-java8/src/main -find samples/server/petstore/jaxrs-resteasy/eap-java8 -maxdepth 1 -type f ! -name "README.md" -exec rm {} + - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/jaxrs-resteasy-eap-joda-petstore-server.json b/bin/jaxrs-resteasy-eap-joda-petstore-server.json deleted file mode 100644 index 785c7acdc6ac..000000000000 --- a/bin/jaxrs-resteasy-eap-joda-petstore-server.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "dateLibrary": "joda" -} diff --git a/bin/jaxrs-resteasy-eap-joda-petstore-server.sh b/bin/jaxrs-resteasy-eap-joda-petstore-server.sh deleted file mode 100755 index af9885025d66..000000000000 --- a/bin/jaxrs-resteasy-eap-joda-petstore-server.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate --artifact-id jaxrs-resteasy-eap-joda-server -t modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g jaxrs-resteasy-eap -o samples/server/petstore/jaxrs-resteasy/eap-joda --additional-properties hideGenerationTimestamp=true -c ./bin/jaxrs-resteasy-eap-joda-petstore-server.json $@" - -echo "Removing files and folders under samples/server/petstore/jaxrs-resteasy/eap-joda/src/main" -rm -rf samples/server/petstore/jaxrs-resteasy/eap-joda/src/main -find samples/server/petstore/jaxrs-resteasy/eap-joda -maxdepth 1 -type f ! -name "README.md" -exec rm {} + - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/jaxrs-resteasy-eap-petstore-server.sh b/bin/jaxrs-resteasy-eap-petstore-server.sh deleted file mode 100755 index 7cc23202f48f..000000000000 --- a/bin/jaxrs-resteasy-eap-petstore-server.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g jaxrs-resteasy-eap -o samples/server/petstore/jaxrs-resteasy/eap --additional-properties hideGenerationTimestamp=true $@" - -echo "Removing files and folders under samples/server/petstore/jaxrs-resteasy/eap/src/main" -rm -rf samples/server/petstore/jaxrs-resteasy/eap/src/main -find samples/server/petstore/jaxrs-resteasy/eap -maxdepth 1 -type f ! -name "README.md" -exec rm {} + - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/jaxrs-resteasy-joda-petstore-server.json b/bin/jaxrs-resteasy-joda-petstore-server.json deleted file mode 100644 index 785c7acdc6ac..000000000000 --- a/bin/jaxrs-resteasy-joda-petstore-server.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "dateLibrary": "joda" -} diff --git a/bin/jaxrs-resteasy-joda-petstore-server.sh b/bin/jaxrs-resteasy-joda-petstore-server.sh deleted file mode 100755 index 66bb1c3fffac..000000000000 --- a/bin/jaxrs-resteasy-joda-petstore-server.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate --artifact-id jaxrs-resteasy-joda-server -t modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g jaxrs-resteasy -o samples/server/petstore/jaxrs-resteasy/joda --additional-properties hideGenerationTimestamp=true -c ./bin/jaxrs-resteasy-joda-petstore-server.json $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/jaxrs-resteasy-petstore-server.sh b/bin/jaxrs-resteasy-petstore-server.sh deleted file mode 100755 index 6b40673aebd5..000000000000 --- a/bin/jaxrs-resteasy-petstore-server.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g jaxrs-resteasy -o samples/server/petstore/jaxrs-resteasy/default --additional-properties hideGenerationTimestamp=true $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/jaxrs-spec-petstore-server-interface-returning-response.sh b/bin/jaxrs-spec-petstore-server-interface-returning-response.sh deleted file mode 100755 index c4cc314bb4f5..000000000000 --- a/bin/jaxrs-spec-petstore-server-interface-returning-response.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate --artifact-id jaxrs-spec-interface-response-petstore-server -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g jaxrs-spec -o samples/server/petstore/jaxrs-spec-interface-response ---additional-properties hideGenerationTimestamp=true ---additional-properties serializableModel=true ---additional-properties interfaceOnly=true ---additional-properties returnResponse=true $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/jaxrs-spec-petstore-server-interface.sh b/bin/jaxrs-spec-petstore-server-interface.sh deleted file mode 100755 index 570443e26eee..000000000000 --- a/bin/jaxrs-spec-petstore-server-interface.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate --artifact-id jaxrs-spec-interface-petstore-server -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g jaxrs-spec -o samples/server/petstore/jaxrs-spec-interface ---additional-properties hideGenerationTimestamp=true ---additional-properties serializableModel=true ---additional-properties interfaceOnly=true $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/jaxrs-spec-petstore-server.sh b/bin/jaxrs-spec-petstore-server.sh deleted file mode 100755 index 9d0c75513bd0..000000000000 --- a/bin/jaxrs-spec-petstore-server.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate --artifact-id jaxrs-spec-petstore-server -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g jaxrs-spec -o samples/server/petstore/jaxrs-spec ---additional-properties hideGenerationTimestamp=true ---additional-properties serializableModel=true $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/jaxrs-usetags-petstore-server.sh b/bin/jaxrs-usetags-petstore-server.sh deleted file mode 100755 index 1c84b29a033c..000000000000 --- a/bin/jaxrs-usetags-petstore-server.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/JavaJaxRS -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g jaxrs-jersey -o samples/server/petstore/jaxrs/jersey2-useTags --additional-properties hideGenerationTimestamp=true,serverPort=8082 --artifact-id=jaxrs-jersey2-useTags --additional-properties useTags=true $@" - -echo "Removing files and folders under samples/server/petstore/jaxrs/jersey2-useTags/src/main" -rm -rf samples/server/petstore/jaxrs/jersey2-useTags/src/main -find samples/server/petstore/jaxrs/jersey2-useTags -maxdepth 1 -type f ! -name "README.md" -exec rm {} + -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/jmeter-petstore.sh b/bin/jmeter-petstore.sh deleted file mode 100755 index 68260d1cba38..000000000000 --- a/bin/jmeter-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g jmeter -o samples/client/petstore/jmeter/ $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/k6-petstore.sh b/bin/k6-petstore.sh deleted file mode 100755 index edb724827eb4..000000000000 --- a/bin/k6-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bash - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -g k6 -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -o samples/client/petstore/k6 $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/kotlin-client-all.sh b/bin/kotlin-client-all.sh deleted file mode 100755 index 91348c423e17..000000000000 --- a/bin/kotlin-client-all.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -./bin/kotlin-client-gson.sh -./bin/kotlin-client-jackson.sh -./bin/kotlin-client-moshi-codegen.sh -./bin/kotlin-client-nonpublic.sh -./bin/kotlin-client-okhttp3.sh -./bin/kotlin-client-petstore-multiplatform.sh -./bin/kotlin-client-petstore.sh -./bin/kotlin-client-string.sh -./bin/kotlin-client-threetenbp.sh -./bin/kotlin-client-nullable.sh -./bin/kotlin-client-retrofit2.sh -./bin/kotlin-client-json-request-string.sh -./bin/kotlin-client-petstore-okhttp-coroutines.sh diff --git a/bin/kotlin-client-gson.sh b/bin/kotlin-client-gson.sh deleted file mode 100755 index f178cb880389..000000000000 --- a/bin/kotlin-client-gson.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=$(ls -ld "$SCRIPT") - link=$(expr "$ls" : '.*-> \(.*\)$') - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=$(dirname "$SCRIPT")/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=$(dirname "$SCRIPT")/.. - APP_DIR=$(cd "${APP_DIR}"; pwd) -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/kotlin-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g kotlin --artifact-id kotlin-petstore-gson --additional-properties serializationLibrary=gson -o samples/client/petstore/kotlin-gson $@" - -java ${JAVA_OPTS} -jar ${executable} ${ags} diff --git a/bin/kotlin-client-jackson.sh b/bin/kotlin-client-jackson.sh deleted file mode 100755 index 516ffc693142..000000000000 --- a/bin/kotlin-client-jackson.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=$(ls -ld "$SCRIPT") - link=$(expr "$ls" : '.*-> \(.*\)$') - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=$(dirname "$SCRIPT")/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=$(dirname "$SCRIPT")/.. - APP_DIR=$(cd "${APP_DIR}"; pwd) -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/kotlin-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g kotlin --artifact-id kotlin-petstore-jackson --additional-properties serializationLibrary=jackson --additional-properties enumPropertyNaming=UPPERCASE -o samples/client/petstore/kotlin-jackson $@" - -java ${JAVA_OPTS} -jar ${executable} ${ags} diff --git a/bin/kotlin-client-json-request-string.sh b/bin/kotlin-client-json-request-string.sh deleted file mode 100755 index 2e32eed675a6..000000000000 --- a/bin/kotlin-client-json-request-string.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=$(ls -ld "$SCRIPT") - link=$(expr "$ls" : '.*-> \(.*\)$') - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=$(dirname "$SCRIPT")/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=$(dirname "$SCRIPT")/.. - APP_DIR=$(cd "${APP_DIR}"; pwd) -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/kotlin-client -i modules/openapi-generator/src/test/resources/2_0/petstore-with-date-field.yaml -g kotlin --artifact-id kotlin-petstore-json-request-string --additional-properties requestDateConverter=toString -o samples/client/petstore/kotlin-json-request-string $@" - -java ${JAVA_OPTS} -jar ${executable} ${ags} diff --git a/bin/kotlin-client-moshi-codegen.sh b/bin/kotlin-client-moshi-codegen.sh deleted file mode 100755 index c037b2efd88f..000000000000 --- a/bin/kotlin-client-moshi-codegen.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=$(ls -ld "$SCRIPT") - link=$(expr "$ls" : '.*-> \(.*\)$') - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=$(dirname "$SCRIPT")/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=$(dirname "$SCRIPT")/.. - APP_DIR=$(cd "${APP_DIR}"; pwd) -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/kotlin-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g kotlin --artifact-id kotlin-petstore-moshi-codegen --additional-properties serializationLibrary=moshi,moshiCodeGen=true -o samples/client/petstore/kotlin-moshi-codegen $@" - -java ${JAVA_OPTS} -jar ${executable} ${ags} diff --git a/bin/kotlin-client-nonpublic.sh b/bin/kotlin-client-nonpublic.sh deleted file mode 100755 index 16c366ef673b..000000000000 --- a/bin/kotlin-client-nonpublic.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=$(ls -ld "$SCRIPT") - link=$(expr "$ls" : '.*-> \(.*\)$') - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=$(dirname "$SCRIPT")/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=$(dirname "$SCRIPT")/.. - APP_DIR=$(cd "${APP_DIR}"; pwd) -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/kotlin-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g kotlin --artifact-id kotlin-petstore-nonpublic --additional-properties nonPublicApi=true -o samples/client/petstore/kotlin-nonpublic $@" - -java ${JAVA_OPTS} -jar ${executable} ${ags} diff --git a/bin/kotlin-client-nullable.sh b/bin/kotlin-client-nullable.sh deleted file mode 100755 index aaa3ae06f418..000000000000 --- a/bin/kotlin-client-nullable.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=$(ls -ld "$SCRIPT") - link=$(expr "$ls" : '.*-> \(.*\)$') - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=$(dirname "$SCRIPT")/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=$(dirname "$SCRIPT")/.. - APP_DIR=$(cd "${APP_DIR}"; pwd) -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/kotlin-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g kotlin --artifact-id kotlin-petstore-nullable --additional-properties nullableReturnType=true,serializableModel=true -o samples/client/petstore/kotlin-nullable $@" - -java ${JAVA_OPTS} -jar ${executable} ${ags} diff --git a/bin/kotlin-client-okhttp3.sh b/bin/kotlin-client-okhttp3.sh deleted file mode 100755 index 3f1cc101700d..000000000000 --- a/bin/kotlin-client-okhttp3.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=$(ls -ld "$SCRIPT") - link=$(expr "$ls" : '.*-> \(.*\)$') - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=$(dirname "$SCRIPT")/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=$(dirname "$SCRIPT")/.. - APP_DIR=$(cd "${APP_DIR}"; pwd) -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/kotlin-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g kotlin --artifact-id kotlin-petstore-okhttp3 --library jvm-okhttp3 -o samples/client/petstore/kotlin-okhttp3 $@" - -java ${JAVA_OPTS} -jar ${executable} ${ags} diff --git a/bin/kotlin-client-petstore-multiplatform.sh b/bin/kotlin-client-petstore-multiplatform.sh deleted file mode 100755 index a0b5de50b53d..000000000000 --- a/bin/kotlin-client-petstore-multiplatform.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=$(ls -ld "$SCRIPT") - link=$(expr "$ls" : '.*-> \(.*\)$') - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=$(dirname "$SCRIPT")/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=$(dirname "$SCRIPT")/.. - APP_DIR=$(cd "${APP_DIR}"; pwd) -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/kotlin-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g kotlin --artifact-id kotlin-client-petstore-multiplatform --library multiplatform -o samples/client/petstore/kotlin-multiplatform $@" - -java ${JAVA_OPTS} -jar ${executable} ${ags} diff --git a/bin/kotlin-client-petstore-okhttp-coroutines.sh b/bin/kotlin-client-petstore-okhttp-coroutines.sh deleted file mode 100755 index 6d7325821efa..000000000000 --- a/bin/kotlin-client-petstore-okhttp-coroutines.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=$(ls -ld "$SCRIPT") - link=$(expr "$ls" : '.*-> \(.*\)$') - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=$(dirname "$SCRIPT")/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=$(dirname "$SCRIPT")/.. - APP_DIR=$(cd "${APP_DIR}"; pwd) -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -samplePath="samples/client/petstore/kotlin-jvm-okhttp4-coroutines" - -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -t modules/openapi-generator/src/main/resources/kotlin-client -g kotlin --artifact-id kotlin-petstore-okhttp4-coroutines-client --library jvm-okhttp4 --additional-properties serializationLibrary=gson,dateLibrary=java8,serializableModel=true,useCoroutines=true -o $samplePath $@" - -echo "Cleaning previously generated files if any from $samplePath" -rm -rf $samplePath - -echo "Generating Kotling client..." -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/kotlin-client-petstore.sh b/bin/kotlin-client-petstore.sh deleted file mode 100755 index 409911eb1137..000000000000 --- a/bin/kotlin-client-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=$(ls -ld "$SCRIPT") - link=$(expr "$ls" : '.*-> \(.*\)$') - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=$(dirname "$SCRIPT")/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=$(dirname "$SCRIPT")/.. - APP_DIR=$(cd "${APP_DIR}"; pwd) -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/kotlin-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g kotlin --artifact-id kotlin-petstore-client --additional-properties dateLibrary=java8,serializableModel=true -o samples/client/petstore/kotlin $@" - -java ${JAVA_OPTS} -jar ${executable} ${ags} diff --git a/bin/kotlin-client-retrofit2.sh b/bin/kotlin-client-retrofit2.sh deleted file mode 100755 index 07bf41fa3e75..000000000000 --- a/bin/kotlin-client-retrofit2.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=$(ls -ld "$SCRIPT") - link=$(expr "$ls" : '.*-> \(.*\)$') - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=$(dirname "$SCRIPT")/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=$(dirname "$SCRIPT")/.. - APP_DIR=$(cd "${APP_DIR}"; pwd) -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/kotlin-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g kotlin --artifact-id kotlin-petstore-retrofit2 --library jvm-retrofit2 -o samples/client/petstore/kotlin-retrofit2 $@" - -java ${JAVA_OPTS} -jar ${executable} ${ags} \ No newline at end of file diff --git a/bin/kotlin-client-string.sh b/bin/kotlin-client-string.sh deleted file mode 100755 index b5440137541f..000000000000 --- a/bin/kotlin-client-string.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=$(ls -ld "$SCRIPT") - link=$(expr "$ls" : '.*-> \(.*\)$') - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=$(dirname "$SCRIPT")/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=$(dirname "$SCRIPT")/.. - APP_DIR=$(cd "${APP_DIR}"; pwd) -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/kotlin-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g kotlin --artifact-id kotlin-petstore-string --additional-properties dateLibrary=string,serializableModel=true,sortParamsByRequiredFlag=false,sortModelPropertiesByRequiredFlag=false -o samples/client/petstore/kotlin-string $@" - -java ${JAVA_OPTS} -jar ${executable} ${ags} - -cp CI/samples.ci/client/petstore/kotlin-string/pom.xml samples/client/petstore/kotlin-string/pom.xml diff --git a/bin/kotlin-client-threetenbp.sh b/bin/kotlin-client-threetenbp.sh deleted file mode 100755 index 0cb7f27da091..000000000000 --- a/bin/kotlin-client-threetenbp.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=$(ls -ld "$SCRIPT") - link=$(expr "$ls" : '.*-> \(.*\)$') - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=$(dirname "$SCRIPT")/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=$(dirname "$SCRIPT")/.. - APP_DIR=$(cd "${APP_DIR}"; pwd) -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/kotlin-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g kotlin --artifact-id kotlin-petstore-threetenbp --additional-properties dateLibrary=threetenbp -o samples/client/petstore/kotlin-threetenbp $@" - -java ${JAVA_OPTS} -jar ${executable} ${ags} - -cp CI/samples.ci/client/petstore/kotlin-threetenbp/pom.xml samples/client/petstore/kotlin-threetenbp/pom.xml diff --git a/bin/kotlin-client-uppercase-enum.sh b/bin/kotlin-client-uppercase-enum.sh deleted file mode 100755 index 7f456fc3a068..000000000000 --- a/bin/kotlin-client-uppercase-enum.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=$(ls -ld "$SCRIPT") - link=$(expr "$ls" : '.*-> \(.*\)$') - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=$(dirname "$SCRIPT")/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=$(dirname "$SCRIPT")/.. - APP_DIR=$(cd "${APP_DIR}"; pwd) -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/kotlin-client -i modules/openapi-generator/src/test/resources/3_0/issue-4062.yaml -g kotlin --artifact-id kotlin-uppercase-enum --additional-properties enumPropertyNaming=UPPERCASE -o samples/client/petstore/kotlin-uppercase-enum $@" - -java ${JAVA_OPTS} -jar ${executable} ${ags} - -#cp CI/samples.ci/client/petstore/kotlin-uppercase-enum/pom.xml samples/client/petstore/kotlin-uppercase-enum/pom.xml diff --git a/bin/kotlin-server-petstore.sh b/bin/kotlin-server-petstore.sh deleted file mode 100755 index 755a560a1f1d..000000000000 --- a/bin/kotlin-server-petstore.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=$(ls -ld "$SCRIPT") - link=$(expr "$ls" : '.*-> \(.*\)$') - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=$(dirname "$SCRIPT")/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=$(dirname "$SCRIPT")/.. - APP_DIR=$(cd "${APP_DIR}"; pwd) -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -t modules/openapi-generator/src/main/resources/kotlin-server -g kotlin-server --library=ktor -o samples/server/petstore/kotlin-server/ktor --additional-properties hideGenerationTimestamp=true,serializableModel=true $@" - -java ${JAVA_OPTS} -jar ${executable} ${ags} - -cp CI/samples.ci/server/petstore/kotlin-server/ktor/pom.xml samples/server/petstore/kotlin-server/ktor/pom.xml diff --git a/bin/kotlin-springboot-petstore-all.sh b/bin/kotlin-springboot-petstore-all.sh deleted file mode 100755 index b24ada15722a..000000000000 --- a/bin/kotlin-springboot-petstore-all.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -./bin/kotlin-springboot-petstore-server.sh -./bin/kotlin-springboot-petstore-server-reactive.sh -./bin/kotlin-springboot-petstore-server-model-mutable.sh diff --git a/bin/kotlin-springboot-petstore-server-model-mutable.sh b/bin/kotlin-springboot-petstore-server-model-mutable.sh deleted file mode 100755 index ed3712db26a9..000000000000 --- a/bin/kotlin-springboot-petstore-server-model-mutable.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=$(ls -ld "$SCRIPT") - link=$(expr "$ls" : '.*-> \(.*\)$') - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=$(dirname "$SCRIPT")/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=$(dirname "$SCRIPT")/.. - APP_DIR=$(cd "${APP_DIR}"; pwd) -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -t modules/openapi-generator/src/main/resources/kotlin-spring -g kotlin-spring -o samples/server/petstore/kotlin-springboot-modelMutable --additional-properties=library=spring-boot,beanValidations=true,swaggerAnnotations=true,serviceImplementation=true,serializableModel=true,modelMutable=true" - -echo "Cleaning previously generated files if any from samples/server/petstore/kotlin-springboot" -rm -rf samples/server/petstore/kotlin-springboot-modelMutable - -echo "Generating Kotling Spring Boot server..." -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/kotlin-springboot-petstore-server-reactive.sh b/bin/kotlin-springboot-petstore-server-reactive.sh deleted file mode 100755 index f5e72350b622..000000000000 --- a/bin/kotlin-springboot-petstore-server-reactive.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=$(ls -ld "$SCRIPT") - link=$(expr "$ls" : '.*-> \(.*\)$') - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=$(dirname "$SCRIPT")/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=$(dirname "$SCRIPT")/.. - APP_DIR=$(cd "${APP_DIR}"; pwd) -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -t modules/openapi-generator/src/main/resources/kotlin-spring -g kotlin-spring -o samples/server/petstore/kotlin-springboot-reactive --additional-properties=library=spring-boot,beanValidations=true,swaggerAnnotations=true,serviceImplementation=true,reactive=true" - -echo "Cleaning previously generated files if any from samples/server/petstore/kotlin-springboot-reactive" -rm -rf samples/server/petstore/kotlin-springboot-reactive - -echo "Generating Kotling Spring Boot reactive server..." -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/kotlin-springboot-petstore-server.sh b/bin/kotlin-springboot-petstore-server.sh deleted file mode 100755 index 73b56bcf8fa5..000000000000 --- a/bin/kotlin-springboot-petstore-server.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=$(ls -ld "$SCRIPT") - link=$(expr "$ls" : '.*-> \(.*\)$') - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=$(dirname "$SCRIPT")/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=$(dirname "$SCRIPT")/.. - APP_DIR=$(cd "${APP_DIR}"; pwd) -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -t modules/openapi-generator/src/main/resources/kotlin-spring -g kotlin-spring -o samples/server/petstore/kotlin-springboot --additional-properties=library=spring-boot,beanValidations=true,swaggerAnnotations=true,serviceImplementation=true,serializableModel=true" - -echo "Cleaning previously generated files if any from samples/server/petstore/kotlin-springboot" -rm -rf samples/server/petstore/kotlin-springboot - -echo "Generating Kotling Spring Boot server..." -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/kotlin-vertx-server-petstore.sh b/bin/kotlin-vertx-server-petstore.sh deleted file mode 100755 index 7cfc82179c51..000000000000 --- a/bin/kotlin-vertx-server-petstore.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" - -while [ -h "$SCRIPT" ] ; do - ls=$(ls -ld "$SCRIPT") - link=$(expr "$ls" : '.*-> \(.*\)$') - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=$(dirname "$SCRIPT")/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=$(dirname "$SCRIPT")/.. - APP_DIR=$(cd "${APP_DIR}"; pwd) -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g kotlin-vertx -o samples/server/petstore/kotlin/vertx --additional-properties=modelMutable=false" - -java ${JAVA_OPTS} -jar ${executable} ${ags} diff --git a/bin/lua-petstore.sh b/bin/lua-petstore.sh deleted file mode 100755 index 77e9589e85da..000000000000 --- a/bin/lua-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties $@" -ags="generate -t modules/openapi-generator/src/main/resources/lua -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g lua -o samples/client/petstore/lua --additional-properties packageName=petstore $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/markdown-documentation-petstore.sh b/bin/markdown-documentation-petstore.sh deleted file mode 100755 index ce4c65035c0e..000000000000 --- a/bin/markdown-documentation-petstore.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" - -while [ -h "$SCRIPT" ] ; do - ls=$(ls -ld "$SCRIPT") - link=$(expr "$ls" : '.*-> \(.*\)$') - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=$(dirname "$SCRIPT")/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=$(dirname "$SCRIPT")/.. - APP_DIR=$(cd "${APP_DIR}"; pwd) -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/markdown-documentation -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g markdown -o samples/documentation/markdown $@" - -java ${JAVA_OPTS} -jar ${executable} ${ags} diff --git a/bin/meta-codegen-kotlin.sh b/bin/meta-codegen-kotlin.sh index 347d8f76144d..905334f5f9fb 100755 --- a/bin/meta-codegen-kotlin.sh +++ b/bin/meta-codegen-kotlin.sh @@ -26,15 +26,15 @@ ags="meta -n myClientCodegen -t DOCUMENTATION -p com.my.company.codegen -o sampl java $JAVA_OPTS -jar $executable $ags if [ ! -f "${root}"samples/meta-codegen-kotlin/gradle/wrapper/gradle-wrapper.jar ]; then - (cd "${root}"/samples/meta-codegen-kotlin/ && gradle wrapper --gradle-version 5.6.2 --distribution-type bin) + (cd "${root}"/samples/meta-codegen-kotlin/ && gradle --no-daemon wrapper --gradle-version 5.6.2 --distribution-type bin) fi (cp "${root}"/samples/meta-codegen-kotlin/gradlew "${root}"/samples/meta-codegen-kotlin/lib/ && \ cp -R "${root}"/samples/meta-codegen-kotlin/gradle "${root}"/samples/meta-codegen-kotlin/lib/ && \ cd "${root}"/samples/meta-codegen-kotlin/lib && \ - ./gradlew shadowJar) + ./gradlew --no-daemon shadowJar) ags2="generate -g myClientCodegen -i modules/openapi-generator/src/test/resources/2_0/petstore.json -o samples/meta-codegen-kotlin/usage $@" -java $JAVA_OPTS -cp ${root}/samples/meta-codegen-kotlin/lib/build/libs/my-client-codegen-openapi-generator-1.0-SNAPSHOT-all.jar:$executable org.openapitools.codegen.OpenAPIGenerator $ags2 +java $JAVA_OPTS -cp ${root}/samples/meta-codegen-kotlin/lib/build/libs/my-client-codegen-openapi-generator-1.0-SNAPSHOT-all.jar:$executable org.openapitools.codegen.OpenAPIGenerator $ags2 \ No newline at end of file diff --git a/bin/meta-codegen.sh b/bin/meta-codegen.sh index f45875ea3ae3..d2a05a0fe6a7 100755 --- a/bin/meta-codegen.sh +++ b/bin/meta-codegen.sh @@ -9,6 +9,7 @@ declare root="$(cd "$cwd" && cd ../ && pwd)" executable="${root}/modules/openapi-generator-cli/target/openapi-generator-cli.jar" if [ ! -f "$executable" ]; then + echo "Rebuilding…" (cd "$root" && ./mvnw -B clean package) fi @@ -17,8 +18,8 @@ ags="meta -n myClientCodegen -t DOCUMENTATION -p com.my.company.codegen -o sampl java $JAVA_OPTS -jar $executable $ags -(cd "$root" && ./mvnw clean package -f samples/meta-codegen/pom.xml) +(cd "$root"/samples/meta-codegen/ && mvn -B package -Djacoco.skip=true -DskipTests=true -f pom.xml) ags2="generate -g myClientCodegen -i modules/openapi-generator/src/test/resources/2_0/petstore.json -o samples/meta-codegen/usage $@" -java $JAVA_OPTS -cp ${root}/samples/meta-codegen/lib/target/myClientCodegen-openapi-generator-1.0.0.jar:$executable org.openapitools.codegen.OpenAPIGenerator $ags2 +java $JAVA_OPTS -cp ${root}/samples/meta-codegen/lib/target/myClientCodegen-openapi-generator-1.0.0.jar:$executable org.openapitools.codegen.OpenAPIGenerator $ags2 \ No newline at end of file diff --git a/bin/mysql-schema-petstore.sh b/bin/mysql-schema-petstore.sh deleted file mode 100755 index ed35c12a07be..000000000000 --- a/bin/mysql-schema-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/mysql-schema -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g mysql-schema -o samples/schema/petstore/mysql $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/nancyfx-petstore-server-async.sh b/bin/nancyfx-petstore-server-async.sh deleted file mode 100755 index e39ed8f08cd8..000000000000 --- a/bin/nancyfx-petstore-server-async.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/csharp-nancyfx -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g csharp-nancyfx -o samples/server/petstore/nancyfx-async --additional-properties packageGuid={768B8DC6-54EE-4D40-9B20-7857E1D742A4},asyncServer=true $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/nancyfx-petstore-server.sh b/bin/nancyfx-petstore-server.sh deleted file mode 100755 index 1556ada3c23a..000000000000 --- a/bin/nancyfx-petstore-server.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/csharp-nancyfx -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g csharp-nancyfx -o samples/server/petstore/nancyfx --additional-properties packageGuid={768B8DC6-54EE-4D40-9B20-7857E1D742A4},asyncServer=false $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/nim-client-petstore.sh b/bin/nim-client-petstore.sh deleted file mode 100755 index 43eb2f3e3a59..000000000000 --- a/bin/nim-client-petstore.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" - -while [ -h "$SCRIPT" ] ; do - ls=$(ls -ld "$SCRIPT") - link=$(expr "$ls" : '.*-> \(.*\)$') - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=$(dirname "$SCRIPT")/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=$(dirname "$SCRIPT")/.. - APP_DIR=$(cd "${APP_DIR}"; pwd) -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ generate -t modules/openapi-generator/src/main/resources/nim-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml --additional-properties packageName=petstore -g nim -o samples/client/petstore/nim" - -java ${JAVA_OPTS} -jar ${executable} ${ags} diff --git a/bin/nodejs-express-petstore-server.sh b/bin/nodejs-express-petstore-server.sh deleted file mode 100755 index 436cedfd41cb..000000000000 --- a/bin/nodejs-express-petstore-server.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/nodejs-express-server -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g nodejs-express-server -o samples/server/petstore/nodejs-express-server $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/objc-petstore-all.sh b/bin/objc-petstore-all.sh deleted file mode 100755 index ba79aee09d5f..000000000000 --- a/bin/objc-petstore-all.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -# default setting -./bin/objc-petstore.sh - -# coredata support -./bin/objc-petstore-coredata.sh - diff --git a/bin/objc-petstore-coredata.sh b/bin/objc-petstore-coredata.sh deleted file mode 100755 index ffa6d1988227..000000000000 --- a/bin/objc-petstore-coredata.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export GENERATOR_GLOBALS="-DapiDocs=false -DmodelDocs=false" -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties ${GENERATOR_GLOBALS}" -ags="generate -t modules/openapi-generator/src/main/resources/objc -i modules/openapi-generator/src/test/resources/2_0/petstore.json -g objc -o samples/client/petstore/objc/core-data --additional-properties coreData=true -c bin/objc-petstore.json $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/objc-petstore.json b/bin/objc-petstore.json deleted file mode 100644 index 9cbfa58d39c3..000000000000 --- a/bin/objc-petstore.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "classPrefix": "SWG", - "podName": "SwaggerClient" -} diff --git a/bin/objc-petstore.sh b/bin/objc-petstore.sh deleted file mode 100755 index 2ceee96867f4..000000000000 --- a/bin/objc-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/objc -i modules/openapi-generator/src/test/resources/2_0/petstore.json -g objc -o samples/client/petstore/objc/default -c ./bin/objc-petstore.json $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/ocaml-petstore.sh b/bin/ocaml-petstore.sh deleted file mode 100755 index 1018d3c005f0..000000000000 --- a/bin/ocaml-petstore.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" - -args="generate -t modules/openapi-generator/src/main/resources/ocaml -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g ocaml -o samples/client/petstore/ocaml --additional-properties packageName=petstore_client $@" - -echo "java ${JAVA_OPTS} -jar ${executable} ${args}" -java $JAVA_OPTS -jar $executable $args diff --git a/bin/openapi3/android-petstore-all.sh b/bin/openapi3/android-petstore-all.sh deleted file mode 100755 index c01f0997041e..000000000000 --- a/bin/openapi3/android-petstore-all.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -./bin/openapi3/android-petstore-httpclient.sh -./bin/openapi3/android-petstore-volley.sh - diff --git a/bin/openapi3/android-petstore-httpclient.sh b/bin/openapi3/android-petstore-httpclient.sh deleted file mode 100755 index a16ff89917af..000000000000 --- a/bin/openapi3/android-petstore-httpclient.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/android -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g android --additional-properties library=httpclient -o samples/client/petstore/android/httpclient $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/android-petstore-volley.sh b/bin/openapi3/android-petstore-volley.sh deleted file mode 100755 index 43160c95c647..000000000000 --- a/bin/openapi3/android-petstore-volley.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g android -c bin/android-petstore-volley.json -o samples/client/petstore/android/volley $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/avro-petstore.sh b/bin/openapi3/avro-petstore.sh deleted file mode 100755 index 0098368e067e..000000000000 --- a/bin/openapi3/avro-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/avro-schema -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g avro-schema -o samples/openapi3/schema/petstore/avro-schema $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/bash-petstore.sh b/bin/openapi3/bash-petstore.sh deleted file mode 100755 index d247da5b8a0e..000000000000 --- a/bin/openapi3/bash-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -args="generate -t modules/openapi-generator/src/main/resources/bash -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g bash -o samples/client/petstore/bash -c modules/openapi-generator/src/test/resources/2_0/bash-config.json --additional-properties hideGenerationTimestamp=true $@" - -java $JAVA_OPTS -jar $executable $args diff --git a/bin/openapi3/clojure-petstore.sh b/bin/openapi3/clojure-petstore.sh deleted file mode 100755 index 43e62b4005d0..000000000000 --- a/bin/openapi3/clojure-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore.json -g clojure -o samples/client/petstore/clojure $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/cpp-pistache-server-petstore.sh b/bin/openapi3/cpp-pistache-server-petstore.sh deleted file mode 100755 index 739bf59df94a..000000000000 --- a/bin/openapi3/cpp-pistache-server-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bash - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -g cpp-pistache-server -t modules/openapi-generator/src/main/resources/cpp-pistache-server -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -o samples/server/petstore/cpp-pistache $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/cpp-qt5-petstore.sh b/bin/openapi3/cpp-qt5-petstore.sh deleted file mode 100755 index a5e0e94bd617..000000000000 --- a/bin/openapi3/cpp-qt5-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/cpp-qt5-client -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g cpp-qt5-client -o samples/client/petstore/cpp-qt5 $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/cpp-qt5-qhttpengine-server-petstore.sh b/bin/openapi3/cpp-qt5-qhttpengine-server-petstore.sh deleted file mode 100755 index e93f5130fe65..000000000000 --- a/bin/openapi3/cpp-qt5-qhttpengine-server-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g cpp-qt5-qhttpengine-server -o samples/client/petstore/cpp-qt5-qhttpengine-server $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/cpp-restbed-petstore-server.sh b/bin/openapi3/cpp-restbed-petstore-server.sh deleted file mode 100755 index e896e6dcd781..000000000000 --- a/bin/openapi3/cpp-restbed-petstore-server.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bash - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -g cpp-restbed-server -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -o samples/server/petstore/cpp-restbed $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/cpp-tizen-petstore.sh b/bin/openapi3/cpp-tizen-petstore.sh deleted file mode 100755 index 75378d4a51aa..000000000000 --- a/bin/openapi3/cpp-tizen-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/cpp-tizen-client -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g cpp-tizen -o samples/client/petstore/cpp-tizen $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/csharp-dotnet2-petstore.sh b/bin/openapi3/csharp-dotnet2-petstore.sh deleted file mode 100755 index 7b0aa62696ea..000000000000 --- a/bin/openapi3/csharp-dotnet2-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g csharp-dotnet2 -o samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient --additional-properties hideGenerationTimestamp=true $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/csharp-petstore-net-standard.sh b/bin/openapi3/csharp-petstore-net-standard.sh deleted file mode 100755 index fff5b780e7b3..000000000000 --- a/bin/openapi3/csharp-petstore-net-standard.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate $@ -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g csharp -o samples/client/petstore/csharp/OpenAPIClientNetStandard --additional-properties packageGuid={321C8C3F-0156-40C1-AE42-D59761FB9B6C} -c ./bin/csharp-petstore-net-standard.json" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/csharp-petstore.sh b/bin/openapi3/csharp-petstore.sh deleted file mode 100755 index 224d5ff207f9..000000000000 --- a/bin/openapi3/csharp-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate $@ -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g csharp -o samples/openapi3/client/petstore/csharp/OpenAPIClient --additional-properties packageGuid={321C8C3F-0156-40C1-AE42-D59761FB9B6C}" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/csharp-property-changed-petstore.sh b/bin/openapi3/csharp-property-changed-petstore.sh deleted file mode 100755 index a3b11ad5697e..000000000000 --- a/bin/openapi3/csharp-property-changed-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate $@ -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g csharp -o samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged --additional-properties generatePropertyChanged=true --additional-properties optionalEmitDefaultValues=true --additional-properties packageGuid={5CD900DE-8266-412F-A758-28E1F9C623D5}" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/dart-petstore.sh b/bin/openapi3/dart-petstore.sh deleted file mode 100755 index 2bab8d1abac9..000000000000 --- a/bin/openapi3/dart-petstore.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" - -# Generate non-browserClient -ags="generate -t modules/openapi-generator/src/main/resources/dart -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g dart -o samples/client/petstore/dart/openapi --additional-properties hideGenerationTimestamp=true,browserClient=false $@" - -# then options to generate the library for vm would be: -#ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g dart -o samples/client/petstore/dart/openapi_vm --additional-properties browserClient=false,pubName=openapi_vm $@" -#java $JAVA_OPTS -jar $executable $ags - -# Generate browserClient -ags="generate -t modules/openapi-generator/src/main/resources/dart -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g dart -o samples/client/petstore/dart/openapi-browser-client --additional-properties hideGenerationTimestamp=true,browserClient=true $@" -#java $JAVA_OPTS -jar $executable $ags - -# Generate non-browserClient and put it to the flutter sample app -ags="generate -t modules/openapi-generator/src/main/resources/dart -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g dart -o samples/client/petstore/dart/flutter_petstore/openapi --additional-properties hideGenerationTimestamp=true,browserClient=false $@" -java $JAVA_OPTS -jar $executable $ags - -# There is a proposal to allow importing different libraries depending on the environment: -# https://github.com/munificent/dep-interface-libraries -# When this is implemented there will only be one library. - -# The current petstore test will then work for both: the browser library and the vm library. - diff --git a/bin/openapi3/elixir-petstore.sh b/bin/openapi3/elixir-petstore.sh deleted file mode 100755 index 1ff5c13d32f7..000000000000 --- a/bin/openapi3/elixir-petstore.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# remove existing lib and model file -echo "removing existing lib, model files" -rm -Rf "samples/client/petstore/elixir/lib/swagger_petstore/model/" -rm -Rf "samples/client/petstore/elixir/lib/swagger_petstore/lib/" - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -args="generate -t modules/openapi-generator/src/main/resources/elixir -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g elixir -o samples/client/petstore/elixir/ $@" - -java $JAVA_OPTS -jar $executable $args diff --git a/bin/openapi3/elm.sh b/bin/openapi3/elm.sh deleted file mode 100755 index 9f7eba8ce334..000000000000 --- a/bin/openapi3/elm.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/3_0/elm.yaml -g elm -t modules/openapi-generator/src/main/resources/elm -o samples/openapi3/client/elm $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/finch-petstore-server.sh b/bin/openapi3/finch-petstore-server.sh deleted file mode 100755 index f6b4a46a42b7..000000000000 --- a/bin/openapi3/finch-petstore-server.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate $@ -t modules/openapi-generator/src/main/resources/scala-finch -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g scala-finch -o samples/server/petstore/scala-finch" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/flash-petstore.sh b/bin/openapi3/flash-petstore.sh deleted file mode 100755 index 04fe76bd695f..000000000000 --- a/bin/openapi3/flash-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/flash -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g flash -o samples/client/petstore/flash -c bin/flash-petstore.json $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/go-experimental-petstore.sh b/bin/openapi3/go-experimental-petstore.sh deleted file mode 100755 index 901c8c62dc4e..000000000000 --- a/bin/openapi3/go-experimental-petstore.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -#SPEC="modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml" -# petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml is the same as the above file, with -# the addition of the HTTP signature security scheme. Ideally, this would have been directly added to -# petstore-with-fake-endpoints-models-for-testing.yaml, but this cannot be done until issue #5025 is resolved. -SPEC="modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml" -GENERATOR="go-experimental" -STUB_DIR="samples/openapi3/client/petstore/go-experimental/go-petstore" - -echo "Removing files and folders under $STUB_DIR" -rm -rf $STUB_DIR - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/$GENERATOR -i $SPEC -g $GENERATOR -o $STUB_DIR" -ags="$ags --additional-properties enumClassPrefix=true,packageName=petstore" -ags="$ags $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/go-gin-petstore-server.sh b/bin/openapi3/go-gin-petstore-server.sh deleted file mode 100755 index 8ab2b8397e0e..000000000000 --- a/bin/openapi3/go-gin-petstore-server.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -SPEC="modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml" -GENERATOR="go-gin-server" -STUB_DIR="samples/openapi3/server/petstore/go-gin-api-server" - -echo "Removing files and folders under $STUB_DIR" -rm -rf $STUB_DIR - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" - -ags="generate -t modules/openapi-generator/src/main/resources/go-gin-server -i $SPEC -g $GENERATOR -o $STUB_DIR --additional-properties packageName=petstoreserver --additional-properties hideGenerationTimestamp=true $@" - -java $JAVA_OPTS -jar $executable $ags -#!/usr/bin/env bash \ No newline at end of file diff --git a/bin/openapi3/go-petstore-server.sh b/bin/openapi3/go-petstore-server.sh deleted file mode 100755 index 7909ec7d5db7..000000000000 --- a/bin/openapi3/go-petstore-server.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -SPEC="modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml" -GENERATOR="go-server" -STUB_DIR="samples/openapi3/server/petstore/go-api-server" - -echo "Removing files and folders under $STUB_DIR" -rm -rf $STUB_DIR - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" - -ags="generate -t modules/openapi-generator/src/main/resources/go-server -i $SPEC -g $GENERATOR -o $STUB_DIR --additional-properties packageName=petstoreserver,hideGenerationTimestamp=true $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/go-petstore.sh b/bin/openapi3/go-petstore.sh deleted file mode 100755 index f67ecfbbb6d9..000000000000 --- a/bin/openapi3/go-petstore.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -SPEC="modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml" -GENERATOR="go" -STUB_DIR="samples/openapi3/client/petstore/go/go-petstore" - -echo "Removing files and folders under $STUB_DIR" -rm -rf $STUB_DIR - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/go -i $SPEC -g $GENERATOR -o $STUB_DIR" -ags="$ags --additional-properties enumClassPrefix=true,packageName=petstore" -ags="$ags $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/graphql-nodejs-express-server.sh b/bin/openapi3/graphql-nodejs-express-server.sh deleted file mode 100755 index 41a695116014..000000000000 --- a/bin/openapi3/graphql-nodejs-express-server.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties $@" -ags="generate -t modules/openapi-generator/src/main/resources/graphql-nodejs-express-server -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g graphql-nodejs-express-server -o samples/server/petstore/graphql-nodejs-express-server --additional-properties packageName=petstore $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/haskell-http-client-petstore.sh b/bin/openapi3/haskell-http-client-petstore.sh deleted file mode 100755 index 7eb116f540bb..000000000000 --- a/bin/openapi3/haskell-http-client-petstore.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" - -args="generate -t modules/openapi-generator/src/main/resources/haskell-http-client -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g haskell-http-client -o samples/client/petstore/haskell-http-client $@" - -echo "java ${JAVA_OPTS} -jar ${executable} ${args}" -java $JAVA_OPTS -jar $executable $args diff --git a/bin/openapi3/haskell-servant-petstore.sh b/bin/openapi3/haskell-servant-petstore.sh deleted file mode 100755 index 2b289a580c52..000000000000 --- a/bin/openapi3/haskell-servant-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/haskell-servant -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g haskell -o samples/server/petstore/haskell-servant $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/java-petstore-jersey2-java8.json b/bin/openapi3/java-petstore-jersey2-java8.json deleted file mode 100644 index dd2a70a3c328..000000000000 --- a/bin/openapi3/java-petstore-jersey2-java8.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "library": "jersey2", - "artifactId": "petstore-openapi3-jersey2-java8", - "dateLibrary": "java8" -} diff --git a/bin/openapi3/java-petstore-jersey2-java8.sh b/bin/openapi3/java-petstore-jersey2-java8.sh deleted file mode 100755 index 8eb4da0f944f..000000000000 --- a/bin/openapi3/java-petstore-jersey2-java8.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -yaml="modules/openapi-generator/src/test/resources/3_0/python-experimental/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml" -ags="generate --artifact-id petstore-openapi3-jersey2-java8 -i $yaml -g java -c bin/openapi3/java-petstore-jersey2-java8.json -o samples/openapi3/client/petstore/java/jersey2-java8 --additional-properties hideGenerationTimestamp=true --additional-properties serverPort=8082 $@" - -echo "Removing files and folders under samples/openapi3/client/petstore/java/jersey2-java8/src/main" -rm -rf samples/openapi3/client/petstore/java/jersey2-java8/src/main -find samples/openapi3/client/petstore/java/jersey2-java8 -maxdepth 1 -type f ! -name "README.md" -exec rm {} + -java $JAVA_OPTS -jar $executable $ags - -# copy additional manually written unit-tests -mkdir -p samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client -mkdir -p samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/auth -mkdir -p samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model - -cp CI/samples.ci/client/petstore/java/test-manual/jersey2-java8/JSONTest.java samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/JSONTest.java -cp CI/samples.ci/client/petstore/java/test-manual/jersey2-java8/JSONComposedSchemaTest.java samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/JSONComposedSchemaTest.java diff --git a/bin/openapi3/javascript-closure-angular.sh b/bin/openapi3/javascript-closure-angular.sh deleted file mode 100755 index a1a38da413e1..000000000000 --- a/bin/openapi3/javascript-closure-angular.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g javascript-closure-angular -o samples/client/petstore/javascript-closure-angular $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/jaxrs-cxf-client-petstore.sh b/bin/openapi3/jaxrs-cxf-client-petstore.sh deleted file mode 100755 index edb3bfcf13a3..000000000000 --- a/bin/openapi3/jaxrs-cxf-client-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate --artifact-id "jaxrs-cxf-petstore-client" -t modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/ -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g jaxrs-cxf-client -o samples/client/petstore/jaxrs-cxf-client $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/jaxrs-jersey-petstore.sh b/bin/openapi3/jaxrs-jersey-petstore.sh deleted file mode 100755 index 8c541731166d..000000000000 --- a/bin/openapi3/jaxrs-jersey-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate --artifact-id "openapiv3-jaxrs-jersey-petstore-server" -t modules/openapi-generator/src/main/resources/JavaJaxRS/ -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g jaxrs-jersey -o samples/server/petstore/jaxrs-jersey --additional-properties hideGenerationTimestamp=true,serverPort=8080 $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/kotlin-client-petstore-all.sh b/bin/openapi3/kotlin-client-petstore-all.sh deleted file mode 100755 index 951e2befa170..000000000000 --- a/bin/openapi3/kotlin-client-petstore-all.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - - -./bin/openapi3/kotlin-client-petstore.sh -./bin/openapi3/kotlin-client-petstore-multiplatform.sh -./bin/openapi3/kotlin-client-petstore-nullable-required.sh -./bin/openapi3/kotlin-client-petstore-retrofit2-coroutines.sh -./bin/openapi3/kotlin-client-petstore-retrofit2-rx.sh -./bin/openapi3/kotlin-client-petstore-retrofit2-rx2.sh diff --git a/bin/openapi3/kotlin-client-petstore-deprecated.sh b/bin/openapi3/kotlin-client-petstore-deprecated.sh deleted file mode 100644 index 8062ad9887bb..000000000000 --- a/bin/openapi3/kotlin-client-petstore-deprecated.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=$(ls -ld "$SCRIPT") - link=$(expr "$ls" : '.*-> \(.*\)$') - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=$(dirname "$SCRIPT")/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=$(dirname "$SCRIPT")/.. - APP_DIR=$(cd "${APP_DIR}"; pwd) -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore-with-depreacted-fields.yaml -t modules/openapi-generator/src/main/resources/kotlin-client -g kotlin --artifact-id kotlin-petstore-deprecated -o samples/openapi3/client/petstore/kotlin-deprecated $@" - -echo "Cleaning previously generated files if any from samples/openapi3/client/petstore/kotlin-deprecated" -rm -rf samples/openapi3/client/petstore/kotlin-deprecated - -echo "Generating Kotling client..." -java $JAVA_OPTS -jar $executable $ags \ No newline at end of file diff --git a/bin/openapi3/kotlin-client-petstore-multiplatform.sh b/bin/openapi3/kotlin-client-petstore-multiplatform.sh deleted file mode 100755 index 9ea035839446..000000000000 --- a/bin/openapi3/kotlin-client-petstore-multiplatform.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=$(ls -ld "$SCRIPT") - link=$(expr "$ls" : '.*-> \(.*\)$') - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=$(dirname "$SCRIPT")/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=$(dirname "$SCRIPT")/.. - APP_DIR=$(cd "${APP_DIR}"; pwd) -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -samplePath="samples/openapi3/client/petstore/kotlin-multiplatform" - -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -t modules/openapi-generator/src/main/resources/kotlin-client -g kotlin --artifact-id kotlin-client-petstore-multiplatform --library multiplatform -o $samplePath $@" - -echo "Cleaning previously generated files if any from $samplePath" -rm -rf $samplePath - -echo "Generating Kotling client..." -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/kotlin-client-petstore-nullable-required.sh b/bin/openapi3/kotlin-client-petstore-nullable-required.sh deleted file mode 100644 index a59f31ecb542..000000000000 --- a/bin/openapi3/kotlin-client-petstore-nullable-required.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=$(ls -ld "$SCRIPT") - link=$(expr "$ls" : '.*-> \(.*\)$') - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=$(dirname "$SCRIPT")/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=$(dirname "$SCRIPT")/.. - APP_DIR=$(cd "${APP_DIR}"; pwd) -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -samplePath="samples/openapi3/client/petstore/kotlin-nullable-required" - -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore-with-nullable-required.yaml -t modules/openapi-generator/src/main/resources/kotlin-client -g kotlin --artifact-id kotlin-petstore-nullable-required --additional-properties allowRequiredAsNullable=true -o $samplePath $@" - -echo "Cleaning previously generated files if any from $samplePath" -rm -rf $samplePath - -echo "Generating Kotling client..." -java $JAVA_OPTS -jar $executable $ags \ No newline at end of file diff --git a/bin/openapi3/kotlin-client-petstore-retrofit2-coroutines.sh b/bin/openapi3/kotlin-client-petstore-retrofit2-coroutines.sh deleted file mode 100755 index 0c45c5584df1..000000000000 --- a/bin/openapi3/kotlin-client-petstore-retrofit2-coroutines.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=$(ls -ld "$SCRIPT") - link=$(expr "$ls" : '.*-> \(.*\)$') - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=$(dirname "$SCRIPT")/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=$(dirname "$SCRIPT")/.. - APP_DIR=$(cd "${APP_DIR}"; pwd) -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -samplePath="samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines" - -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -t modules/openapi-generator/src/main/resources/kotlin-client -g kotlin --artifact-id kotlin-petstore-coroutines-client --library jvm-retrofit2 --additional-properties serializationLibrary=gson,dateLibrary=java8,serializableModel=true,useCoroutines=true -o $samplePath $@" - -echo "Cleaning previously generated files if any from $samplePath" -rm -rf $samplePath - -echo "Generating Kotling client..." -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/kotlin-client-petstore-retrofit2-rx.sh b/bin/openapi3/kotlin-client-petstore-retrofit2-rx.sh deleted file mode 100755 index fef65a303b20..000000000000 --- a/bin/openapi3/kotlin-client-petstore-retrofit2-rx.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=$(ls -ld "$SCRIPT") - link=$(expr "$ls" : '.*-> \(.*\)$') - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=$(dirname "$SCRIPT")/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=$(dirname "$SCRIPT")/.. - APP_DIR=$(cd "${APP_DIR}"; pwd) -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -samplePath="samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx" - -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -t modules/openapi-generator/src/main/resources/kotlin-client -g kotlin --artifact-id kotlin-petstore-rx-client --library jvm-retrofit2 --additional-properties serializationLibrary=gson,dateLibrary=java8,serializableModel=true,useRxJava=true -o $samplePath $@" - -echo "Cleaning previously generated files if any from $samplePath" -rm -rf $samplePath - -echo "Generating Kotling client..." -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/kotlin-client-petstore-retrofit2-rx2.sh b/bin/openapi3/kotlin-client-petstore-retrofit2-rx2.sh deleted file mode 100755 index d6265f8fea98..000000000000 --- a/bin/openapi3/kotlin-client-petstore-retrofit2-rx2.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=$(ls -ld "$SCRIPT") - link=$(expr "$ls" : '.*-> \(.*\)$') - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=$(dirname "$SCRIPT")/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=$(dirname "$SCRIPT")/.. - APP_DIR=$(cd "${APP_DIR}"; pwd) -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -samplePath="samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2" - -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -t modules/openapi-generator/src/main/resources/kotlin-client -g kotlin --artifact-id kotlin-petstore-rx2-client --library jvm-retrofit2 --additional-properties serializationLibrary=gson,dateLibrary=java8,serializableModel=true,useRxJava2=true -o $samplePath $@" - -echo "Cleaning previously generated files if any from $samplePath" -rm -rf $samplePath - -echo "Generating Kotling client..." -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/kotlin-client-petstore.sh b/bin/openapi3/kotlin-client-petstore.sh deleted file mode 100755 index a36d42599bef..000000000000 --- a/bin/openapi3/kotlin-client-petstore.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=$(ls -ld "$SCRIPT") - link=$(expr "$ls" : '.*-> \(.*\)$') - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=$(dirname "$SCRIPT")/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=$(dirname "$SCRIPT")/.. - APP_DIR=$(cd "${APP_DIR}"; pwd) -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -samplePath="samples/openapi3/client/petstore/kotlin" - -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -t modules/openapi-generator/src/main/resources/kotlin-client -g kotlin --artifact-id kotlin-petstore-client --additional-properties dateLibrary=java8,serializableModel=true -o $samplePath $@" - -echo "Cleaning previously generated files if any from $samplePath" -rm -rf $samplePath - -echo "Generating Kotling client..." -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/kotlin-springboot-petstore-all.sh b/bin/openapi3/kotlin-springboot-petstore-all.sh deleted file mode 100755 index 7aa4f697bbd3..000000000000 --- a/bin/openapi3/kotlin-springboot-petstore-all.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -./bin/openapi3/kotlin-springboot-petstore-server.sh -./bin/openapi3/kotlin-springboot-petstore-server-reactive.sh diff --git a/bin/openapi3/kotlin-springboot-petstore-server-reactive.sh b/bin/openapi3/kotlin-springboot-petstore-server-reactive.sh deleted file mode 100755 index f14abcd4242e..000000000000 --- a/bin/openapi3/kotlin-springboot-petstore-server-reactive.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=$(ls -ld "$SCRIPT") - link=$(expr "$ls" : '.*-> \(.*\)$') - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=$(dirname "$SCRIPT")/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=$(dirname "$SCRIPT")/.. - APP_DIR=$(cd "${APP_DIR}"; pwd) -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -t modules/openapi-generator/src/main/resources/kotlin-spring -g kotlin-spring -o samples/openapi3/server/petstore/kotlin-springboot-reactive --additional-properties=library=spring-boot,beanValidations=true,swaggerAnnotations=true,serviceImplementation=true,reactive=true" - -echo "Cleaning previously generated files if any from samples/server/openapi3/petstore/kotlin-springboot-reactive" -rm -rf samples/server/openapi3/petstore/kotlin-springboot-reactive - -echo "Generating Kotling Spring Boot server..." -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/kotlin-springboot-petstore-server.sh b/bin/openapi3/kotlin-springboot-petstore-server.sh deleted file mode 100755 index 8779e1a04122..000000000000 --- a/bin/openapi3/kotlin-springboot-petstore-server.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=$(ls -ld "$SCRIPT") - link=$(expr "$ls" : '.*-> \(.*\)$') - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=$(dirname "$SCRIPT")/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=$(dirname "$SCRIPT")/.. - APP_DIR=$(cd "${APP_DIR}"; pwd) -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -t modules/openapi-generator/src/main/resources/kotlin-spring -g kotlin-spring -o samples/openapi3/server/petstore/kotlin-springboot --additional-properties=library=spring-boot,beanValidations=true,swaggerAnnotations=true,serviceImplementation=true,serializableModel=true" - -echo "Cleaning previously generated files if any from samples/server/openapi3/petstore/kotlin-springboot" -rm -rf samples/server/openapi3/petstore/kotlin-springboot - -echo "Generating Kotling Spring Boot server..." -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/objc-petstore-coredata.sh b/bin/openapi3/objc-petstore-coredata.sh deleted file mode 100755 index ec36e2f510a4..000000000000 --- a/bin/openapi3/objc-petstore-coredata.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export GENERATOR_GLOBALS="-DapiDocs=false -DmodelDocs=false" -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties ${GENERATOR_GLOBALS}" -ags="generate -t modules/openapi-generator/src/main/resources/objc -i modules/openapi-generator/src/test/resources/3_0/petstore.json -g objc -o samples/client/petstore/objc/core-data --additional-properties coreData=true,appName=PetstoreClient $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/objc-petstore.sh b/bin/openapi3/objc-petstore.sh deleted file mode 100755 index 5840e39a4507..000000000000 --- a/bin/openapi3/objc-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/objc -i modules/openapi-generator/src/test/resources/3_0/petstore.json -g objc -o samples/client/petstore/objc/default --additional-properties appName=PetstoreClient $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/perl-petstore.sh b/bin/openapi3/perl-petstore.sh deleted file mode 100755 index 7707591647b8..000000000000 --- a/bin/openapi3/perl-petstore.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -# complex module name used for testing -ags="generate -t modules/openapi-generator/src/main/resources/perl -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g perl -o samples/client/petstore/perl --additional-properties hideGenerationTimestamp=true $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/php-laravel-petstore.sh b/bin/openapi3/php-laravel-petstore.sh deleted file mode 100755 index 97d2061f57a1..000000000000 --- a/bin/openapi3/php-laravel-petstore.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -# Make sure that the working directory is the root dir -SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -cd "${SCRIPT_DIR}/../" - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -# Make sure that we are regenerating the sample by removing any existing target directory -TARGET_DIR="$SCRIPT_DIR/../../samples/server/petstore/php-laravel" -if [ -d "$TARGET_DIR" ]; then - rm -rf $TARGET_DIR -fi - -executable="$SCRIPT_DIR/../../modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t $SCRIPT_DIR/../../modules/openapi-generator/src/main/resources/php-laravel -i $SCRIPT_DIR/../../modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g php-laravel -o $TARGET_DIR $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/php-lumen-petstore-server.sh b/bin/openapi3/php-lumen-petstore-server.sh deleted file mode 100755 index 5b599415c702..000000000000 --- a/bin/openapi3/php-lumen-petstore-server.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/php-lumen -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g php-lumen -o samples/server/petstore/php-lumen $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/php-petstore.sh b/bin/openapi3/php-petstore.sh deleted file mode 100755 index 18ab1224ee4a..000000000000 --- a/bin/openapi3/php-petstore.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# cleanup tests -TEST_DIR="./samples/openapi3/client/petstore/php/OpenAPIClient-php/test" -if [ -d $TEST_DIR ]; then - rm -rf $TEST_DIR -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/php -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g php -o samples/openapi3/client/petstore/php/OpenAPIClient-php $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/php-silex-petstore-server.sh b/bin/openapi3/php-silex-petstore-server.sh deleted file mode 100755 index f3c33d37ec21..000000000000 --- a/bin/openapi3/php-silex-petstore-server.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/php-silex -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g php-silex-deprecated -o samples/server/petstore/php-silex/OpenAPIServer $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/php-slim-server-petstore.sh b/bin/openapi3/php-slim-server-petstore.sh deleted file mode 100755 index e497f4f027f3..000000000000 --- a/bin/openapi3/php-slim-server-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/php-slim-server -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g php-slim-deprecated -o samples/server/petstore/php-slim $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/php-slim4-server-petstore.sh b/bin/openapi3/php-slim4-server-petstore.sh deleted file mode 100755 index 904c4675b3fa..000000000000 --- a/bin/openapi3/php-slim4-server-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/php-slim4-server -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g php-slim4 -o samples/server/petstore/php-slim4 $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/php-symfony-petstore.sh b/bin/openapi3/php-symfony-petstore.sh deleted file mode 100755 index 8c6ce35bd0bc..000000000000 --- a/bin/openapi3/php-symfony-petstore.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -# Make sure that the working directory is the root dir -SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -cd "${SCRIPT_DIR}/../" - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -# Make sure that we are regenerating the sample by removing any existing target directory -TARGET_DIR="$SCRIPT_DIR/../../samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php" -if [ -d "$TARGET_DIR" ]; then - rm -rf $TARGET_DIR -fi - -executable="$SCRIPT_DIR/../../modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t $SCRIPT_DIR/../../modules/openapi-generator/src/main/resources/php-symfony -i $SCRIPT_DIR/../../modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g php-symfony -o $TARGET_DIR $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/php-ze-ph-petstore-server.sh b/bin/openapi3/php-ze-ph-petstore-server.sh deleted file mode 100644 index 5b92d0131099..000000000000 --- a/bin/openapi3/php-ze-ph-petstore-server.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -input=modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -out_folder=samples/openapi3/server/petstore/php-ze-ph -resources=modules/openapi-generator/src/main/resources/php-ze-ph - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t $resources -i $input -g php-ze-ph -o $out_folder $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/plantuml-documentation-petstore.sh b/bin/openapi3/plantuml-documentation-petstore.sh deleted file mode 100644 index 61bdfbbcb4a6..000000000000 --- a/bin/openapi3/plantuml-documentation-petstore.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" - -while [ -h "$SCRIPT" ] ; do - ls=$(ls -ld "$SCRIPT") - link=$(expr "$ls" : '.*-> \(.*\)$') - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=$(dirname "$SCRIPT")/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=$(dirname "$SCRIPT")/.. - APP_DIR=$(cd "${APP_DIR}"; pwd) -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g plantuml -o samples/documentation/petstore/plantuml" - -java ${JAVA_OPTS} -jar ${executable} ${ags} diff --git a/bin/openapi3/python-experimental-petstore.sh b/bin/openapi3/python-experimental-petstore.sh deleted file mode 100755 index 20d0595485c3..000000000000 --- a/bin/openapi3/python-experimental-petstore.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -#yaml="modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml" -yaml="modules/openapi-generator/src/test/resources/3_0/python-experimental/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml" -ags="generate -t modules/openapi-generator/src/main/resources/python -i $yaml -g python-experimental -o samples/openapi3/client/petstore/python-experimental/ --additional-properties packageName=petstore_api $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/python-flask-petstore-python2.sh b/bin/openapi3/python-flask-petstore-python2.sh deleted file mode 100755 index b9afa34fcd63..000000000000 --- a/bin/openapi3/python-flask-petstore-python2.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -input=modules/openapi-generator/src/test/resources/3_0/petstore-with-object-as-parameter.yaml -out_folder=samples/openapi3/server/petstore/python-flask-python2 -resources=modules/openapi-generator/src/main/resources/python-flask - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t $resources -i $input -g python-flask -o $out_folder -c bin/supportPython2.json $@" - -rm -rf $out_folder/.openapi* -rm -rf $out_folder/openapi_server -rm $out_folder/.dockerignore -rm $out_folder/.gitignore -rm $out_folder/.travis.yml -rm $out_folder/Dockerfile -rm $out_folder/git_push.sh -rm $out_folder/README.md -rm $out_folder/requirements.txt -rm $out_folder/setup.py -rm $out_folder/test-requirements.txt -rm $out_folder/tox.ini - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/python-flask-petstore.sh b/bin/openapi3/python-flask-petstore.sh deleted file mode 100755 index 6b0f03aa3d28..000000000000 --- a/bin/openapi3/python-flask-petstore.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -input=modules/openapi-generator/src/test/resources/3_0/petstore-with-object-as-parameter.yaml -out_folder=samples/openapi3/server/petstore/python-flask -resources=modules/openapi-generator/src/main/resources/python-flask - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties -Dservice" -ags="generate -t $resources -i $input -g python-flask -o $out_folder $@" - -rm -rf $out_folder/.openapi* -rm -rf $out_folder/openapi_server -rm $out_folder/.dockerignore -rm $out_folder/.gitignore -rm $out_folder/.travis.yml -rm $out_folder/Dockerfile -rm $out_folder/git_push.sh -rm $out_folder/README.md -rm $out_folder/requirements.txt -rm $out_folder/setup.py -rm $out_folder/test-requirements.txt -rm $out_folder/tox.ini - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/python-petstore.sh b/bin/openapi3/python-petstore.sh deleted file mode 100755 index c1dce94f9c25..000000000000 --- a/bin/openapi3/python-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/python -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g python -o samples/openapi3/client/petstore/python/ --additional-properties packageName=petstore_api $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/r-petstore.sh b/bin/openapi3/r-petstore.sh deleted file mode 100755 index 9ca5ed61d004..000000000000 --- a/bin/openapi3/r-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/r -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g r -o samples/client/petstore/R --additional-properties packageName=petstore $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/run-all-petstore b/bin/openapi3/run-all-petstore deleted file mode 100755 index 4ee75b99f629..000000000000 --- a/bin/openapi3/run-all-petstore +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -# this bash script will loop through all the .sh files under bin -# execute the script and check the result (exit code) to see if -# there's any error - -echo "IMPORTANT: this script should be run by the CI (e.g. Shippable) only. There's no need to run this script to update Petstore samples for all generators." -echo "Please press CTRL+C to stop or the script will continue in 10 seconds." - -sleep 10 - -successes=0 -failures=0 -export JAVA_OPTS="${JAVA_OPTS} -Djava.awt.headless=true -Dorg.slf4j.simpleLogger.defaultLogLevel=warn" -for SCRIPT in $(ls -l ./bin/openapi3/*.sh | grep -v all) -do - if [ -f ${SCRIPT} -a -x ${SCRIPT} ]; then - echo "Running $SCRIPT (output to /dev/null)" - ${SCRIPT} 2>&1 > /dev/null - rc=$? - if [[ ${rc} != 0 ]]; then - >&2 echo "ERROR!! FAILED TO RUN ${SCRIPT}" - ((failures+=1)) - else - ((successes+=1)) - fi - fi -done - -if (( failures > 0 )); then - >&2 echo "[ERROR] ${failures} out of $((failures+successes)) scripts failed." - exit 1 -else - echo "[SUCCESS] ${successes} generators finished." -fi diff --git a/bin/openapi3/rust-petstore.sh b/bin/openapi3/rust-petstore.sh deleted file mode 100755 index a4812fc9093b..000000000000 --- a/bin/openapi3/rust-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=$(ls -ld "$SCRIPT") - link=$(expr "$ls" : '.*-> \(.*\)$') - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=$(dirname "$SCRIPT")/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=$(dirname "$SCRIPT")/.. - APP_DIR=$(cd "${APP_DIR}"; pwd) -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/rust -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g rust -o samples/client/petstore/rust --additional-properties packageName=petstore_client $@" - -java ${JAVA_OPTS} -jar ${executable} ${ags} diff --git a/bin/openapi3/typescript-angular-petstore-all.sh b/bin/openapi3/typescript-angular-petstore-all.sh deleted file mode 100755 index bb0d6d2479c7..000000000000 --- a/bin/openapi3/typescript-angular-petstore-all.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" - -echo "Typescript Petstore API client (default)" -ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g typescript-angular -o samples/client/petstore/typescript-angular-v2/default --additional-properties ngVersion=2 $@" -java $JAVA_OPTS -jar $executable $ags - -echo "Typescript Petstore API client (npm setting)" -ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g typescript-angular -c bin/typescript-petstore-npm.json -o samples/client/petstore/typescript-angular-v2/npm --additional-properties ngVersion=2 $@" -java $JAVA_OPTS -jar $executable $ags - -echo "Typescript Petstore API client (with interfaces generated)" -ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g typescript-angular -o samples/client/petstore/typescript-angular-v2/with-interfaces --additional-properties ngVersion=2,withInterfaces=true $@" -java $JAVA_OPTS -jar $executable $ags - -echo "Typescript Petstore API client (v4 { Adding InjectionToken Over OpaqueToken })" -ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g typescript-angular -c bin/typescript-petstore-npm.json -o samples/client/petstore/typescript-angular-v4/npm --additional-properties ngVersion=4 $@" -java $JAVA_OPTS -jar $executable $ags - -echo "Typescript Petstore API client (v4.3 { Adding HttpClientModule over HttpModule })" -ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g typescript-angular -c bin/typescript-petstore-npm.json -o samples/client/petstore/typescript-angular-v4.3/npm --additional-properties ngVersion=4.3 $@" -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/typescript-angular-v2-petstore-interfaces.sh b/bin/openapi3/typescript-angular-v2-petstore-interfaces.sh deleted file mode 100755 index 3d74ccc1a95e..000000000000 --- a/bin/openapi3/typescript-angular-v2-petstore-interfaces.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g typescript-angular -o samples/client/petstore/typescript-angular-v2/with-interfaces --additional-properties ngVersion=2,withInterfaces=true $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/typescript-angular-v2-petstore-with-npm.sh b/bin/openapi3/typescript-angular-v2-petstore-with-npm.sh deleted file mode 100755 index 0bb15f5e72e6..000000000000 --- a/bin/openapi3/typescript-angular-v2-petstore-with-npm.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g typescript-angular -c bin/typescript-petstore-npm.json -o samples/client/petstore/typescript-angular-v2/npm --additional-properties ngVersion=2 $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/typescript-angular-v2-petstore.sh b/bin/openapi3/typescript-angular-v2-petstore.sh deleted file mode 100755 index f495ce2b1f1f..000000000000 --- a/bin/openapi3/typescript-angular-v2-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g typescript-angular -o samples/client/petstore/typescript-angular-v2/default --additional-properties ngVersion=2 $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/typescript-angular-v4-petstore-with-npm.sh b/bin/openapi3/typescript-angular-v4-petstore-with-npm.sh deleted file mode 100755 index da00def7a00e..000000000000 --- a/bin/openapi3/typescript-angular-v4-petstore-with-npm.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g typescript-angular -c bin/typescript-petstore-npm.json -o samples/client/petstore/typescript-angular-v4/npm --additional-properties ngVersion=4 $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/typescript-angular-v4.3-petstore-with-npm.sh b/bin/openapi3/typescript-angular-v4.3-petstore-with-npm.sh deleted file mode 100755 index 82de2c52ae3a..000000000000 --- a/bin/openapi3/typescript-angular-v4.3-petstore-with-npm.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g typescript-angular -c bin/typescript-petstore-npm.json -o samples/client/petstore/typescript-angular-v4.3/npm --additional-properties ngVersion=4.3 $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/typescript-angularjs-petstore.sh b/bin/openapi3/typescript-angularjs-petstore.sh deleted file mode 100755 index b0e617e58833..000000000000 --- a/bin/openapi3/typescript-angularjs-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g typescript-angularjs -o samples/client/petstore/typescript-angularjs $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/typescript-aurelia-petstore.sh b/bin/openapi3/typescript-aurelia-petstore.sh deleted file mode 100755 index a5cee045ab27..000000000000 --- a/bin/openapi3/typescript-aurelia-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g typescript-aurelia -o samples/client/petstore/typescript-aurelia/default $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/typescript-fetch-petstore-all.sh b/bin/openapi3/typescript-fetch-petstore-all.sh deleted file mode 100755 index c052045b1068..000000000000 --- a/bin/openapi3/typescript-fetch-petstore-all.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -./bin/openapi3/typescript-fetch-petstore-target-es6.sh -./bin/openapi3/typescript-fetch-petstore-with-npm-version.sh -./bin/openapi3/typescript-fetch-petstore-interfaces.sh -./bin/openapi3/typescript-fetch-petstore.sh -./bin/openapi3/typescript-fetch-petstore-prefix-parameter-interfaces.sh diff --git a/bin/openapi3/typescript-fetch-petstore-interfaces.sh b/bin/openapi3/typescript-fetch-petstore-interfaces.sh deleted file mode 100755 index d1e21dfbca73..000000000000 --- a/bin/openapi3/typescript-fetch-petstore-interfaces.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g typescript-fetch -o samples/client/petstore/typescript-fetch/builds/with-interfaces --additional-properties withInterfaces=true $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/typescript-fetch-petstore-prefix-parameter-interfaces.sh b/bin/openapi3/typescript-fetch-petstore-prefix-parameter-interfaces.sh deleted file mode 100755 index b4f24da65321..000000000000 --- a/bin/openapi3/typescript-fetch-petstore-prefix-parameter-interfaces.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g typescript-fetch -o samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces --additional-properties prefixParameterInterfaces=true $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/typescript-fetch-petstore-target-es6.sh b/bin/openapi3/typescript-fetch-petstore-target-es6.sh deleted file mode 100755 index 1d452572baa2..000000000000 --- a/bin/openapi3/typescript-fetch-petstore-target-es6.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g typescript-fetch -c bin/typescript-fetch-petstore-target-es6.json -o samples/client/petstore/typescript-fetch/builds/es6-target $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/typescript-fetch-petstore-with-npm-version.sh b/bin/openapi3/typescript-fetch-petstore-with-npm-version.sh deleted file mode 100755 index 477c36e9bc01..000000000000 --- a/bin/openapi3/typescript-fetch-petstore-with-npm-version.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g typescript-fetch -c bin/typescript-fetch-petstore-with-npm-version.json -o samples/client/petstore/typescript-fetch/builds/with-npm-version $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/typescript-fetch-petstore.sh b/bin/openapi3/typescript-fetch-petstore.sh deleted file mode 100755 index 90d3062bd016..000000000000 --- a/bin/openapi3/typescript-fetch-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g typescript-fetch -o samples/client/petstore/typescript-fetch/builds/default $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/typescript-inversify-petstore.sh b/bin/openapi3/typescript-inversify-petstore.sh deleted file mode 100755 index 2dec4414c9f0..000000000000 --- a/bin/openapi3/typescript-inversify-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g typescript-inversify -o samples/client/petstore/typescript-inversify $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/typescript-jquery-petstore-all.sh b/bin/openapi3/typescript-jquery-petstore-all.sh deleted file mode 100755 index 7320a518c2f7..000000000000 --- a/bin/openapi3/typescript-jquery-petstore-all.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" - -echo "Typescript Petstore API client (default)" -ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g typescript-jquery -o samples/client/petstore/typescript-jquery/default $@" -java $JAVA_OPTS -jar $executable $ags - -echo "Typescript Petstore API client (npm setting)" -ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g typescript-jquery -c bin/typescript-jquery-petstore-npm.json -o samples/client/petstore/typescript-jquery/npm $@" -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/typescript-jquery-petstore-with-npm.sh b/bin/openapi3/typescript-jquery-petstore-with-npm.sh deleted file mode 100755 index 2aee5b82bcc3..000000000000 --- a/bin/openapi3/typescript-jquery-petstore-with-npm.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g typescript-jquery -c bin/typescript-jquery-petstore-npm.json -o samples/client/petstore/typescript-jquery/npm $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/typescript-jquery-petstore.sh b/bin/openapi3/typescript-jquery-petstore.sh deleted file mode 100755 index 2054fecfee6a..000000000000 --- a/bin/openapi3/typescript-jquery-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g typescript-jquery -o samples/client/petstore/typescript-jquery/default $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/typescript-node-petstore-all.sh b/bin/openapi3/typescript-node-petstore-all.sh deleted file mode 100755 index 5597a52c5874..000000000000 --- a/bin/openapi3/typescript-node-petstore-all.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" - -echo "Typescript node Petstore API client (default setting)" -ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g typescript-node -o samples/client/petstore/typescript-node/default $@" -java $JAVA_OPTS -jar $executable $ags - -echo "Typescript node Petstore API client with npm setting" -ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g typescript-node -c bin/typescript-petstore-npm.json -o samples/client/petstore/typescript-node/npm $@" -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/typescript-node-petstore-with-npm.sh b/bin/openapi3/typescript-node-petstore-with-npm.sh deleted file mode 100755 index a1b4b8c90823..000000000000 --- a/bin/openapi3/typescript-node-petstore-with-npm.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g typescript-node -c bin/typescript-petstore-npm.json -o samples/client/petstore/typescript-node/npm $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/typescript-node-petstore.sh b/bin/openapi3/typescript-node-petstore.sh deleted file mode 100755 index 45a6eec7016f..000000000000 --- a/bin/openapi3/typescript-node-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g typescript-node -o samples/client/petstore/typescript-node/default $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/windows/csharp-netcore-petstore-netcore.bat b/bin/openapi3/windows/csharp-netcore-petstore-netcore.bat deleted file mode 100644 index 7d5454a18913..000000000000 --- a/bin/openapi3/windows/csharp-netcore-petstore-netcore.bat +++ /dev/null @@ -1,14 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\3_0\petstore-with-fake-endpoints-models-for-testing.yaml -g csharp-netcore -o samples\openapi3\client\petstore\csharp-netcore\OpenAPIClientCore --additional-properties packageGuid={321C8C3F-0156-40C1-AE42-D59761FB9B6C},useCompareNetObjects=true,targetFramework=netcoreapp2.0 - -java %JAVA_OPTS% -jar %executable% %ags% - -REM restore csproj file -echo "restore csproject file: CI\samples.ci\client\petstore\csharp-netcore\OpenAPIClientCore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj" -copy /b/v/y CI\samples.ci\client\petstore\csharp-netcore\OpenAPIClientCore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj samples\openapi3\client\petstore\csharp-netcore\OpenAPIClientCore\src\Org.OpenAPITools.Test\ diff --git a/bin/openapi3/windows/csharp-netcore-petstore.bat b/bin/openapi3/windows/csharp-netcore-petstore.bat deleted file mode 100644 index e99d5ab4a4f8..000000000000 --- a/bin/openapi3/windows/csharp-netcore-petstore.bat +++ /dev/null @@ -1,14 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\3_0\petstore-with-fake-endpoints-models-for-testing.yaml -g csharp-netcore -o samples\openapi3\client\petstore\csharp-netcore\OpenAPIClient --additional-properties packageGuid={321C8C3F-0156-40C1-AE42-D59761FB9B6C},useCompareNetObjects=true - -java %JAVA_OPTS% -jar %executable% %ags% - -REM restore csproj file -echo "restore csproject file: CI\samples.ci\client\petstore\csharp-netcore\OpenAPIClient\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj" -copy /b/v/y CI\samples.ci\client\petstore\csharp-netcore\OpenAPIClient\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj samples\openapi3\client\petstore\csharp-netcore\OpenAPIClient\src\Org.OpenAPITools.Test\ diff --git a/bin/openapi3/windows/csharp-petstore.bat b/bin/openapi3/windows/csharp-petstore.bat deleted file mode 100755 index 5e8de764dc27..000000000000 --- a/bin/openapi3/windows/csharp-petstore.bat +++ /dev/null @@ -1,14 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test/resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g csharp -o samples\openapi3\client\petstore\csharp\SwaggerClient --additional-properties packageGuid={321C8C3F-0156-40C1-AE42-D59761FB9B6C} - -java %JAVA_OPTS% -jar %executable% %ags% - -REM restore csproj file -echo "restore csproject file: CI\samples.ci\client\petstore\csharp\OpenAPIClient\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj" -copy /b/v/y CI\samples.ci\client\petstore\csharp\OpenAPIClient\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj samples\openapi3\client\petstore\csharp\OpenAPIClient\src\Org.OpenAPITools.Test\ diff --git a/bin/openapi3/windows/kotlin-client-deprecated.bat b/bin/openapi3/windows/kotlin-client-deprecated.bat deleted file mode 100644 index f12a5178e4ea..000000000000 --- a/bin/openapi3/windows/kotlin-client-deprecated.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\3_0\petstore-with-depreacted-fields.yaml -g kotlin --artifact-id "kotlin-petstore-deprecated" -o samples\openapi3\client\petstore\kotlin-deprecated - -java %JAVA_OPTS% -jar %executable% %ags% \ No newline at end of file diff --git a/bin/openapi3/windows/kotlin-client-nullable-required.bat b/bin/openapi3/windows/kotlin-client-nullable-required.bat deleted file mode 100644 index dd7bf0d16a7b..000000000000 --- a/bin/openapi3/windows/kotlin-client-nullable-required.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\3_0\petstore-with-nullable-required.yaml -g kotlin --artifact-id "kotlin-petstore-nullable-required" --additional-properties allowRequiredAsNullable=true -o samples\openapi3\client\petstore\kotlin-nullable-required - -java %JAVA_OPTS% -jar %executable% %ags% \ No newline at end of file diff --git a/bin/openapi3/windows/kotlin-springboot-petstore-server.bat b/bin/openapi3/windows/kotlin-springboot-petstore-server.bat deleted file mode 100644 index 0f557f0cb335..000000000000 --- a/bin/openapi3/windows/kotlin-springboot-petstore-server.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\3_0\petstore.yaml -g kotlin-spring -o samples\openapi3\server\petstore\kotlin-springboot --additional-properties=library=spring-boot - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/openapi3/windows/nodejs-express-server-petstore.bat b/bin/openapi3/windows/nodejs-express-server-petstore.bat deleted file mode 100755 index 73cf61835f07..000000000000 --- a/bin/openapi3/windows/nodejs-express-server-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate -i modules\openapi-generator\src\test\resources\3_0\petstore.yaml -g nodejs-express-server -o samples\openapi3\server\petstore\nodejs-express-server - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/openapi3/windows/php-petstore.bat b/bin/openapi3/windows/php-petstore.bat deleted file mode 100644 index edd5e5c45ea0..000000000000 --- a/bin/openapi3/windows/php-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\3_0\petstore-with-fake-endpoints-models-for-testing.yaml -g php -o samples\openapi3\client\petstore\php\OpenAPIClient-php - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/openapi3/windows/plantuml-documentation-petstore.bat b/bin/openapi3/windows/plantuml-documentation-petstore.bat deleted file mode 100644 index 8928568143e8..000000000000 --- a/bin/openapi3/windows/plantuml-documentation-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate --artifact-id "plantuml-petstore-documentation" -i modules\openapi-generator\src\test\resources\3_0\petstore.yaml -g plantuml -o samples\documentation\petstore\plantuml - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/openapi3/windows/python-experimental-petstore.bat b/bin/openapi3/windows/python-experimental-petstore.bat deleted file mode 100644 index 29c097a55721..000000000000 --- a/bin/openapi3/windows/python-experimental-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\3_0\petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml -g python-experimental -o samples\openapi3\client\petstore\python-experimental --additional-properties packageName=petstore_api - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/openapi3/windows/r-petstore.bat b/bin/openapi3/windows/r-petstore.bat deleted file mode 100755 index 6dac7327f39a..000000000000 --- a/bin/openapi3/windows/r-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate -i modules\openapi-generator\src\test\resources\3_0\petstore.yaml -g r -o samples\client\petstore\R - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/openapi3/windows/run-all-petstore.cmd b/bin/openapi3/windows/run-all-petstore.cmd deleted file mode 100644 index 1e5c0fb4ed8f..000000000000 --- a/bin/openapi3/windows/run-all-petstore.cmd +++ /dev/null @@ -1,15 +0,0 @@ -REM this batch file will loop through all the .bat files under bin\openapi3\windows\ -REM execute the script and check the error level to see if there's any error - -echo IMPORTANT: this script should be run by the CI (e.g. appveyor) only. There's no need to run this script to update Petstore samples for all generators. -echo Please press CTRL+C to stop or the script will continue in 10 seconds. - -timeout 10 - -for /f "delims=" %%i in ('dir /b ".\bin\openapi3\windows\*.bat"') do ( - - CALL .\bin\openapi3\windows\%%i - - IF ERRORLEVEL 1 IF NOT ERRORLEVEL 2 exit /b 1 - -) diff --git a/bin/openapi3/windows/scala-sttp-petstore.bat b/bin/openapi3/windows/scala-sttp-petstore.bat deleted file mode 100755 index 3aaf98462a8b..000000000000 --- a/bin/openapi3/windows/scala-sttp-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate --artifact-id "scala-sttp-petstore" -t modules\openapi-generator\src\main\resources\scala-sttp -i modules\openapi-generator\src\test\resources\3_0\petstore.yaml -g scala-sttp -o samples\openapi3\client\petstore\scala-sttp - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/perl-deep-module-petstore.sh b/bin/perl-deep-module-petstore.sh deleted file mode 100755 index 8e47a7d3b826..000000000000 --- a/bin/perl-deep-module-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -# complex module name used for testing -ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g perl -o samples/client/petstore/perl/deep_module_test --additional-properties hideGenerationTimestamp=true $@" - -java $JAVA_OPTS -jar $executable $ags --additional-properties moduleName=Something::Deep -o samples/client/petstore/perl/deep_module_test diff --git a/bin/perl-petstore-all.sh b/bin/perl-petstore-all.sh deleted file mode 100755 index 084857fa28cd..000000000000 --- a/bin/perl-petstore-all.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -./bin/perl-petstore.sh -./bin/perl-deep-module-petstore.sh - diff --git a/bin/perl-petstore.sh b/bin/perl-petstore.sh deleted file mode 100755 index e4864503b1e5..000000000000 --- a/bin/perl-petstore.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -# complex module name used for testing -ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g perl -o samples/client/petstore/perl --additional-properties hideGenerationTimestamp=true $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/php-laravel-petstore-server.sh b/bin/php-laravel-petstore-server.sh deleted file mode 100755 index 6b13f6c54049..000000000000 --- a/bin/php-laravel-petstore-server.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/php-laravel -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g php-laravel -o samples/server/petstore/php-laravel $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/php-lumen-petstore-server.sh b/bin/php-lumen-petstore-server.sh deleted file mode 100755 index 3f940bd34ae7..000000000000 --- a/bin/php-lumen-petstore-server.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/php-lumen -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g php-lumen -o samples/server/petstore/php-lumen $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/php-petstore.sh b/bin/php-petstore.sh deleted file mode 100755 index d15e004a1ae9..000000000000 --- a/bin/php-petstore.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# cleanup tests -TEST_DIR="./samples/client/petstore/php/OpenAPIClient-php/test" -if [ -d $TEST_DIR ]; then - rm -rf $TEST_DIR -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/php -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g php -o samples/client/petstore/php/OpenAPIClient-php $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/php-silex-petstore-server.sh b/bin/php-silex-petstore-server.sh deleted file mode 100755 index c3f97b702373..000000000000 --- a/bin/php-silex-petstore-server.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/php-silex -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g php-silex-deprecated -o samples/server/petstore/php-silex/OpenAPIServer $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/php-slim-server-petstore.sh b/bin/php-slim-server-petstore.sh deleted file mode 100755 index b26b05895957..000000000000 --- a/bin/php-slim-server-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/php-slim-server -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g php-slim-deprecated -o samples/server/petstore/php-slim $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/php-slim4-server-petstore.sh b/bin/php-slim4-server-petstore.sh deleted file mode 100755 index a87ebbcc7ac9..000000000000 --- a/bin/php-slim4-server-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/php-slim4-server -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g php-slim4 -o samples/server/petstore/php-slim4 $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/php-symfony-petstore.sh b/bin/php-symfony-petstore.sh deleted file mode 100755 index 44a46239a2f1..000000000000 --- a/bin/php-symfony-petstore.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -# Make sure that the working directory is the root dir -SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -cd "${SCRIPT_DIR}/../" - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -# Make sure that we are regenerating the sample by removing any existing target directory -TARGET_DIR="$SCRIPT_DIR/../samples/server/petstore/php-symfony/SymfonyBundle-php" -if [ -d "$TARGET_DIR" ]; then - rm -rf $TARGET_DIR -fi - -executable="$SCRIPT_DIR/../modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t $SCRIPT_DIR/../modules/openapi-generator/src/main/resources/php-symfony -i $SCRIPT_DIR/../modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g php-symfony -o $TARGET_DIR $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/php-ze-ph-petstore-server.sh b/bin/php-ze-ph-petstore-server.sh deleted file mode 100755 index 371e65fe46fd..000000000000 --- a/bin/php-ze-ph-petstore-server.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -input=modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -out_folder=samples/server/petstore/php-ze-ph -resources=modules/openapi-generator/src/main/resources/php-ze-ph - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t $resources -i $input -g php-ze-ph -o $out_folder $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/plantuml-documentation-petstore.sh b/bin/plantuml-documentation-petstore.sh deleted file mode 100755 index 82740590056b..000000000000 --- a/bin/plantuml-documentation-petstore.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" - -while [ -h "$SCRIPT" ] ; do - ls=$(ls -ld "$SCRIPT") - link=$(expr "$ls" : '.*-> \(.*\)$') - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=$(dirname "$SCRIPT")/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=$(dirname "$SCRIPT")/.. - APP_DIR=$(cd "${APP_DIR}"; pwd) -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ generate -t modules/openapi-generator/src/main/resources/plantuml -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g plantuml -o samples/documentation/petstore/plantuml" - -java ${JAVA_OPTS} -jar ${executable} ${ags} diff --git a/bin/powershell-config.json b/bin/powershell-config.json deleted file mode 100644 index 72db80af89df..000000000000 --- a/bin/powershell-config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "skipFormModel": true -} diff --git a/bin/powershell-petstore.sh b/bin/powershell-petstore.sh deleted file mode 100755 index 264e58d9f5b5..000000000000 --- a/bin/powershell-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=$(ls -ld "$SCRIPT") - link=$(expr "$ls" : '.*-> \(.*\)$') - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=$(dirname "$SCRIPT")/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=$(dirname "$SCRIPT")/.. - APP_DIR=$(cd "${APP_DIR}"; pwd) -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/powershell -i modules/openapi-generator/src/test/resources/3_0/powershell/petstore.yaml -g powershell -o samples/client/petstore/powershell --additional-properties powershellGalleryUrl=https://www.powershellgallery.com/packages/PSPetstore,packageGuid=a27b908d-2a20-467f-bc32-af6f3a654ac5,packageName=PSPetstore,apiNamePrefix=PS,packageVersion=0.1.2,commonVerbs=Delete=Remove:Patch=Update $@" - -java ${JAVA_OPTS} -jar ${executable} ${ags} diff --git a/bin/protobuf-schema-petstore.sh b/bin/protobuf-schema-petstore.sh deleted file mode 100755 index 09b132ad26b5..000000000000 --- a/bin/protobuf-schema-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties $@" -ags="generate -t modules/openapi-generator/src/main/resources/protobuf-schema -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g protobuf-schema -o samples/config/petstore/protobuf-schema --additional-properties packageName=petstore $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/python-asyncio-petstore.sh b/bin/python-asyncio-petstore.sh deleted file mode 100755 index 4219e51927ef..000000000000 --- a/bin/python-asyncio-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package $@ -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/python -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g python -o samples/client/petstore/python-asyncio --additional-properties packageName=petstore_api --library asyncio $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/python-experimental-petstore.sh b/bin/python-experimental-petstore.sh deleted file mode 100755 index 8a64ca988983..000000000000 --- a/bin/python-experimental-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package $@ -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/python -i modules/openapi-generator/src/test/resources/2_0/python-client-experimental/petstore-with-fake-endpoints-models-for-testing.yaml -g python-experimental -o samples/client/petstore/python-experimental --additional-properties packageName=petstore_api --additional-properties disallowAdditionalPropertiesIfNotPresent=true $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/python-petstore-all.sh b/bin/python-petstore-all.sh deleted file mode 100755 index 86c179eaa0d9..000000000000 --- a/bin/python-petstore-all.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -# update python petstore clients - -./bin/python-asyncio-petstore.sh -./bin/python-petstore.sh -./bin/python-experimental-petstore.sh -./bin/python-tornado-petstore.sh diff --git a/bin/python-petstore.sh b/bin/python-petstore.sh deleted file mode 100755 index 651fda1e721f..000000000000 --- a/bin/python-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package $@ -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/python -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g python -o samples/client/petstore/python --additional-properties packageName=petstore_api $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/python-server-aiohttp-petstore.sh b/bin/python-server-aiohttp-petstore.sh deleted file mode 100755 index f5cc9bc711b6..000000000000 --- a/bin/python-server-aiohttp-petstore.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -generator=python-aiohttp -input=modules/openapi-generator/src/test/resources/2_0/petstore.yaml -out_folder=samples/server/petstore/$generator -resources=modules/openapi-generator/src/main/resources/$generator - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties -Dservice" -ags="generate -t $resources -i $input -g $generator -o $out_folder $@" - -rm -rf $out_folder/.openapi* -rm -rf $out_folder/openapi_server -rm -rf $out_folder/tests* -rm $out_folder/README.md -rm $out_folder/requirements.txt -rm $out_folder/test-requirements.txt - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/python-server-aiohttp-srclayout-petstore.sh b/bin/python-server-aiohttp-srclayout-petstore.sh deleted file mode 100755 index 126e2d9fcc13..000000000000 --- a/bin/python-server-aiohttp-srclayout-petstore.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -generator=python-aiohttp -input=modules/openapi-generator/src/test/resources/2_0/petstore.yaml -out_folder=samples/server/petstore/${generator}-srclayout -resources=modules/openapi-generator/src/main/resources/${generator} - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties -Dservice" -ags="generate -t $resources -i $input -g $generator -o $out_folder --additional-properties pythonSrcRoot=src $@" - -rm -rf $out_folder/.openapi* -rm -rf $out_folder/openapi_server -rm -rf $out_folder/tests* -rm $out_folder/README.md -rm $out_folder/requirements.txt -rm $out_folder/test-requirements.txt - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/python-server-all.sh b/bin/python-server-all.sh deleted file mode 100755 index c4fa204d1c6a..000000000000 --- a/bin/python-server-all.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -./bin/python-server-aiohttp-petstore.sh -./bin/python-server-aiohttp-srclayout-petstore.sh -./bin/python-server-flask-petstore.sh -./bin/python-server-flask-petstore-python2.sh -./bin/python-server-blueplanet-petstore.sh diff --git a/bin/python-server-blueplanet-petstore.sh b/bin/python-server-blueplanet-petstore.sh deleted file mode 100755 index bf2bfe771d7e..000000000000 --- a/bin/python-server-blueplanet-petstore.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -generator=python-blueplanet -input=modules/openapi-generator/src/test/resources/2_0/petstore.yaml -out_folder=samples/server/petstore/$generator -resources=modules/openapi-generator/src/main/resources/$generator - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties -Dservice" -ags="generate -t $resources -i $input -g $generator -o $out_folder $@" - -rm -rf $out_folder/.openapi* -rm -rf $out_folder/openapi_server -rm -rf $out_folder/tests* -rm -f $out_folder/README.md -rm -f $out_folder/requirements.txt -rm -f $out_folder/test-requirements.txt - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/python-server-flask-petstore-python2.sh b/bin/python-server-flask-petstore-python2.sh deleted file mode 100755 index f720fd5d4f48..000000000000 --- a/bin/python-server-flask-petstore-python2.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -generator=python-flask -input=modules/openapi-generator/src/test/resources/2_0/petstore.yaml -out_folder=samples/server/petstore/$generator-python2 -resources=modules/openapi-generator/src/main/resources/$generator - -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t $resources -i $input -g $generator -o $out_folder -c bin/supportPython2.json $@" - -rm -rf $out_folder/.openapi* -rm -rf $out_folder/openapi_server -rm $out_folder/.dockerignore -rm $out_folder/.gitignore -rm $out_folder/.travis.yml -rm $out_folder/Dockerfile -rm $out_folder/git_push.sh -rm $out_folder/README.md -rm $out_folder/requirements.txt -rm $out_folder/setup.py -rm $out_folder/test-requirements.txt -rm $out_folder/tox.ini - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/python-server-flask-petstore.sh b/bin/python-server-flask-petstore.sh deleted file mode 100755 index eead0ce0d4fc..000000000000 --- a/bin/python-server-flask-petstore.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -generator=python-flask -input=modules/openapi-generator/src/test/resources/2_0/petstore.yaml -out_folder=samples/server/petstore/$generator -resources=modules/openapi-generator/src/main/resources/$generator - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties -Dservice" -ags="generate -t $resources -i $input -g $generator -o $out_folder $@" - -rm -rf $out_folder/.openapi* -rm -rf $out_folder/openapi_server -rm $out_folder/.dockerignore -rm $out_folder/.gitignore -rm $out_folder/.travis.yml -rm $out_folder/Dockerfile -rm $out_folder/git_push.sh -rm $out_folder/README.md -rm $out_folder/requirements.txt -rm $out_folder/setup.py -rm $out_folder/test-requirements.txt -rm $out_folder/tox.ini - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/python-tornado-petstore.sh b/bin/python-tornado-petstore.sh deleted file mode 100755 index 1d51e798fe92..000000000000 --- a/bin/python-tornado-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package $@ -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/python -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g python -o samples/client/petstore/python-tornado --additional-properties packageName=petstore_api --library tornado $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/r-petstore.sh b/bin/r-petstore.sh deleted file mode 100755 index 4decf28f72f0..000000000000 --- a/bin/r-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/r -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g r -o samples/client/petstore/R --additional-properties packageName=petstore $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/ruby-client-petstore-faraday.sh b/bin/ruby-client-petstore-faraday.sh deleted file mode 100755 index 502cc689fe3c..000000000000 --- a/bin/ruby-client-petstore-faraday.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# purge lib/doc folder -echo "purge ruby petstore lib, docs folder" -rm -Rf samples/client/petstore/ruby-faraday/lib -rm -Rf samples/client/petstore/ruby-faraday/docs - -# purge test files other than integration test -# NOTE: spec/custom/*.rb and spec/petstore_helper.rb are not generated files -echo "purge ruby petstore spec" -find samples/client/petstore/ruby-faraday/spec -type d -not -name spec -not -name custom | xargs rm -Rf -find samples/client/petstore/ruby-faraday/spec -type f -not -name petstore_helper.rb -not -iwholename '*/spec/custom/*' | xargs rm -Rf - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -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-faraday.json -o samples/client/petstore/ruby-faraday --global-property skipFormModel=true $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/ruby-client-petstore.sh b/bin/ruby-client-petstore.sh deleted file mode 100755 index 8a92eb8f1ac0..000000000000 --- a/bin/ruby-client-petstore.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# purge lib/doc folder -echo "purge ruby petstore lib, docs folder" -rm -Rf samples/client/petstore/ruby/lib -rm -Rf samples/client/petstore/ruby/docs - -# purge test files other than integration test -# NOTE: spec/custom/*.rb and spec/petstore_helper.rb are not generated files -echo "purge ruby petstore spec" -find samples/client/petstore/ruby/spec -type d -not -name spec -not -name custom | xargs rm -Rf -find samples/client/petstore/ruby/spec -type f -not -name petstore_helper.rb -not -iwholename '*/spec/custom/*' | xargs rm -Rf - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -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/client/petstore/ruby --global-property skipFormModel=true $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/ruby-on-rails-server-petstore.sh b/bin/ruby-on-rails-server-petstore.sh deleted file mode 100755 index 3cb83a0c517f..000000000000 --- a/bin/ruby-on-rails-server-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/ruby-on-rails-server -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g ruby-on-rails -o samples/server/petstore/ruby-on-rails $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/ruby-petstore-faraday.json b/bin/ruby-petstore-faraday.json deleted file mode 100644 index 21974c307f26..000000000000 --- a/bin/ruby-petstore-faraday.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "gemName": "petstore", - "moduleName": "Petstore", - "library": "faraday", - "gemVersion": "1.0.0" -} diff --git a/bin/ruby-petstore.json b/bin/ruby-petstore.json deleted file mode 100644 index 8e597283f8ba..000000000000 --- a/bin/ruby-petstore.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "gemName": "petstore", - "library": "typhoeus", - "moduleName": "Petstore", - "gemVersion": "1.0.0", - "strictSpecBehavior": false -} diff --git a/bin/ruby-sinatra-server-petstore.sh b/bin/ruby-sinatra-server-petstore.sh deleted file mode 100755 index 88701e48793e..000000000000 --- a/bin/ruby-sinatra-server-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/ruby-sinatra-server -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g ruby-sinatra -o samples/server/petstore/ruby-sinatra $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/run-all-petstore b/bin/run-all-petstore deleted file mode 100755 index b709a303b476..000000000000 --- a/bin/run-all-petstore +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -# this bash script will loop through all the .sh files under bin -# execute the script and check the result (exit code) to see if -# there's any error - -echo "IMPORTANT: this script should be run by the CI (e.g. Shippable) only. There's no need to run this script to update Petstore samples for all generators." -echo "Please press CTRL+C to stop or the script will continue in 10 seconds." - -sleep 10 - -successes=0 -failures=0 -for SCRIPT in $(ls -l ./bin/*.sh | grep -v all) -do - if [ -f ${SCRIPT} -a -x ${SCRIPT} ]; then - echo "Running $SCRIPT (output to /dev/null)" - ${SCRIPT} 2>&1 > /dev/null - rc=$? - if [[ ${rc} != 0 ]]; then - >&2 echo "ERROR!! FAILED TO RUN ${SCRIPT}" - ((failures+=1)) - else - ((successes+=1)) - fi - fi -done - -if (( failures > 0 )); then - >&2 echo "[ERROR] ${failures} out of $((failures+successes)) scripts failed." - exit 1 -else - echo "[SUCCESS] ${successes} generators finished." -fi diff --git a/bin/rust-petstore-reqwest-async.sh b/bin/rust-petstore-reqwest-async.sh deleted file mode 100755 index 65a1d1b4a597..000000000000 --- a/bin/rust-petstore-reqwest-async.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties $@" -ags="generate -t modules/openapi-generator/src/main/resources/rust -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g rust --library reqwest -o samples/client/petstore/rust/reqwest/petstore-async --additional-properties supportAsync=true,useSingleRequestParameter=true,packageName=petstore-reqwest-async $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/rust-petstore.sh b/bin/rust-petstore.sh deleted file mode 100755 index bee0348ca066..000000000000 --- a/bin/rust-petstore.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=$(ls -ld "$SCRIPT") - link=$(expr "$ls" : '.*-> \(.*\)$') - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=$(dirname "$SCRIPT")/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=$(dirname "$SCRIPT")/.. - APP_DIR=$(cd "${APP_DIR}"; pwd) -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" - -for spec_path in \ - modules/openapi-generator/src/test/resources/2_0/petstore.yaml \ - modules/openapi-generator/src/test/resources/3_0/rust/rust-test.yaml \ - modules/openapi-generator/src/test/resources/2_0/fileResponseTest.json\ - ; do - spec=$(basename "$spec_path" | sed 's/.yaml//' | sed 's/.json//' ) - - for library in hyper reqwest; do - args="generate --template-dir modules/openapi-generator/src/main/resources/rust - --input-spec $spec_path - --generator-name rust - --output samples/client/petstore/rust/$library/$spec - --additional-properties packageName=${spec}-${library},supportAsync=false - --library=$library $@" - java ${JAVA_OPTS} -jar ${executable} ${args} || exit 1 - done -done diff --git a/bin/rust-server-petstore.sh b/bin/rust-server-petstore.sh deleted file mode 100755 index f1ded085f6fd..000000000000 --- a/bin/rust-server-petstore.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -for spec_path in modules/openapi-generator/src/test/resources/*/rust-server/* ; do - echo "Generating: $spec_path" - export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" - spec=$(basename "$spec_path" | sed 's/.yaml//') - args="generate --template-dir modules/openapi-generator/src/main/resources/rust-server - --input-spec $spec_path - --generator-name rust-server - --output samples/server/petstore/rust-server/output/$spec - --additional-properties packageName=$spec - --additional-properties hideGenerationTimestamp=true - --generate-alias-as-model - $@" - - java $JAVA_OPTS -jar $executable $args - - if [ $? -ne 0 ]; then - exit $? - fi -done diff --git a/bin/scala-akka-http-server-petstore.sh b/bin/scala-akka-http-server-petstore.sh deleted file mode 100755 index 83f97fca797d..000000000000 --- a/bin/scala-akka-http-server-petstore.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" - -while [ -h "$SCRIPT" ] ; do - ls=$(ls -ld "$SCRIPT") - link=$(expr "$ls" : '.*-> \(.*\)$') - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=$(dirname "$SCRIPT")/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=$(dirname "$SCRIPT")/.. - APP_DIR=$(cd "${APP_DIR}"; pwd) -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g scala-akka-http-server -o samples/server/petstore/scala-akka-http-server $@" - -java ${JAVA_OPTS} -jar ${executable} ${ags} diff --git a/bin/scala-akka-petstore.sh b/bin/scala-akka-petstore.sh deleted file mode 100755 index 037fa6a962e3..000000000000 --- a/bin/scala-akka-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate --artifact-id "scala-akka-petstore-client" -t modules/openapi-generator/src/main/resources/scala-akka-client -i modules/openapi-generator/src/test/resources/3_0/scala-akka/petstore.yaml -g scala-akka -o samples/client/petstore/scala-akka $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/scala-finch-petstore-server.sh b/bin/scala-finch-petstore-server.sh deleted file mode 100755 index 08fd0ae1e7d5..000000000000 --- a/bin/scala-finch-petstore-server.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/scala-finch -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g scala-finch -o samples/server/petstore/scala-finch --global-property skipFormModel=true $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/scala-gatling-petstore.sh b/bin/scala-gatling-petstore.sh deleted file mode 100755 index 227ad58c3d10..000000000000 --- a/bin/scala-gatling-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/scala-gatling -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g scala-gatling -o samples/client/petstore/scala-gatling $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/scala-httpclient-petstore.sh b/bin/scala-httpclient-petstore.sh deleted file mode 100755 index d3629abc4741..000000000000 --- a/bin/scala-httpclient-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/scala-httpclient -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g scala-httpclient-deprecated -o samples/client/petstore/scala-httpclient $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/scala-lagom-server-petstore.sh b/bin/scala-lagom-server-petstore.sh deleted file mode 100755 index ff9ab8ce7177..000000000000 --- a/bin/scala-lagom-server-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/scala-lagom-server -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g scala-lagom-server -o samples/server/petstore/scala-lagom-server --global-property skipFormModel=true $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/scala-play-framework-petstore.sh b/bin/scala-play-framework-petstore.sh deleted file mode 100755 index 90258c2a597e..000000000000 --- a/bin/scala-play-framework-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/scala-play-server -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g scala-play-server -o samples/server/petstore/scala-play-server --additional-properties hideGenerationTimestamp=true $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/scala-sttp-petstore.sh b/bin/scala-sttp-petstore.sh deleted file mode 100755 index 3521fd6e419a..000000000000 --- a/bin/scala-sttp-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate --artifact-id 'scala-sttp-petstore' -t modules/openapi-generator/src/main/resources/scala-sttp -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g scala-sttp -o samples/client/petstore/scala-sttp $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/scalatra-petstore-server.sh b/bin/scalatra-petstore-server.sh deleted file mode 100755 index 04d037b89ce7..000000000000 --- a/bin/scalatra-petstore-server.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/scalatra -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g scalatra -o samples/server/petstore/scalatra $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/scalaz-petstore.sh b/bin/scalaz-petstore.sh deleted file mode 100755 index dca1f9544f5a..000000000000 --- a/bin/scalaz-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/scalaz -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g scalaz -o samples/client/petstore/scalaz --global-property skipFormModel=true $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/spring-all-petstore.sh b/bin/spring-all-petstore.sh deleted file mode 100755 index 3f3536cf1ab9..000000000000 --- a/bin/spring-all-petstore.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh - -# Generate clients: -./bin/spring-cloud-feign-petstore.sh -./bin/spring-cloud-feign-async-petstore.sh -./bin/spring-stubs.sh - -# Generate spring-mvc servers: -./bin/spring-mvc-petstore-server.sh -./bin/spring-mvc-petstore-j8-async-server.sh -./bin/spring-mvc-petstore-j8-localdatetime.sh - -# Generate springboot servers: -./bin/spring-delegate.sh -./bin/spring-delegate-j8.sh -./bin/springboot-petstore-server.sh -./bin/springboot-petstore-server-reactive.sh -./bin/springboot-petstore-server-beanvalidation.sh -./bin/springboot-petstore-server-implicitHeaders.sh -./bin/springboot-petstore-server-useOptional.sh -./bin/springboot-virtualan-petstore-server.sh \ No newline at end of file diff --git a/bin/spring-cloud-feign-async-petstore.sh b/bin/spring-cloud-feign-async-petstore.sh deleted file mode 100755 index ec2df4089744..000000000000 --- a/bin/spring-cloud-feign-async-petstore.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g spring -c bin/spring-cloud-feign-petstore.json -o samples/client/petstore/spring-cloud-async --additional-properties hideGenerationTimestamp=true,java8=true,async=true $@" - -echo "Removing files and folders under samples/client/petstore/spring-cloud-async/src/main" -rm -rf samples/client/petstore/spring-cloud-async/src/main -find samples/client/petstore/spring-cloud-async -maxdepth 1 -type f ! -name "README.md" -exec rm {} + -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/spring-cloud-feign-petstore.json b/bin/spring-cloud-feign-petstore.json deleted file mode 100644 index 572f58c1c7e7..000000000000 --- a/bin/spring-cloud-feign-petstore.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "library": "spring-cloud", - "artifactId": "petstore-spring-cloud" -} diff --git a/bin/spring-cloud-feign-petstore.sh b/bin/spring-cloud-feign-petstore.sh deleted file mode 100755 index 2dfef88064f7..000000000000 --- a/bin/spring-cloud-feign-petstore.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g spring -c bin/spring-cloud-feign-petstore.json -o samples/client/petstore/spring-cloud --additional-properties hideGenerationTimestamp=true,responseWrapper=HystrixCommand $@" - -echo "Removing files and folders under samples/client/petstore/spring-cloud/src/main" -rm -rf samples/client/petstore/spring-cloud/src/main -find samples/client/petstore/spring-cloud -maxdepth 1 -type f ! -name "README.md" -exec rm {} + -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/spring-delegate-j8.sh b/bin/spring-delegate-j8.sh deleted file mode 100755 index df75a5d169bd..000000000000 --- a/bin/spring-delegate-j8.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate --artifact-id springboot-delegate-j8 -t modules/openapi-generator/src/main/resources/JavaSpring -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g spring -o samples/server/petstore/springboot-delegate-j8 --additional-properties delegatePattern=true,hideGenerationTimestamp=true $@" - -echo "Removing files and folders under samples/server/petstore/springboot-delegate-j8/src/main" -rm -rf samples/server/petstore/springboot-delegate-j8/src/main -find samples/server/petstore/springboot-delegate-j8/ -maxdepth 1 -type f ! -name "README.md" -exec rm {} + -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/spring-delegate.sh b/bin/spring-delegate.sh deleted file mode 100755 index 2404c24cedcc..000000000000 --- a/bin/spring-delegate.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate --artifact-id springboot-delegate -t modules/openapi-generator/src/main/resources/JavaSpring -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g spring -o samples/server/petstore/springboot-delegate --additional-properties delegatePattern=true,hideGenerationTimestamp=true,java8=false $@" - -echo "Removing files and folders under samples/server/petstore/springboot-delegate/src/main" -rm -rf samples/server/petstore/springboot-delegate/src/main -find samples/server/petstore/springboot-delegate/ -maxdepth 1 -type f ! -name "README.md" -exec rm {} + -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/spring-mvc-petstore-j8-async-server.sh b/bin/spring-mvc-petstore-j8-async-server.sh deleted file mode 100755 index fdbb35d4b415..000000000000 --- a/bin/spring-mvc-petstore-j8-async-server.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/JavaSpring -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g spring -o samples/server/petstore/spring-mvc-j8-async -c bin/spring-mvc-petstore-j8-async.json --additional-properties hideGenerationTimestamp=true,async=true --additional-properties serverPort=8002 $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/spring-mvc-petstore-j8-async.json b/bin/spring-mvc-petstore-j8-async.json deleted file mode 100644 index b73cbb09fe49..000000000000 --- a/bin/spring-mvc-petstore-j8-async.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "java8": true, - "async": true, - "library": "spring-mvc", - "artifactId": "spring-mvc-server-j8-async" -} diff --git a/bin/spring-mvc-petstore-j8-localdatetime.json b/bin/spring-mvc-petstore-j8-localdatetime.json deleted file mode 100644 index 6eeb5d21443b..000000000000 --- a/bin/spring-mvc-petstore-j8-localdatetime.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "library": "spring-mvc", - "dateLibrary": "java8-localdatetime", - "artifactId": "spring-mvc-j8-localdatetime" -} diff --git a/bin/spring-mvc-petstore-j8-localdatetime.sh b/bin/spring-mvc-petstore-j8-localdatetime.sh deleted file mode 100755 index ae3b16177af7..000000000000 --- a/bin/spring-mvc-petstore-j8-localdatetime.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/JavaSpring -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g spring -c bin/spring-mvc-petstore-j8-localdatetime.json -o samples/server/petstore/spring-mvc-j8-localdatetime --additional-properties hideGenerationTimestamp=true,booleanGetterPrefix=get,serverPort=8002 $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/spring-mvc-petstore-server.json b/bin/spring-mvc-petstore-server.json deleted file mode 100644 index d07026ffcbc6..000000000000 --- a/bin/spring-mvc-petstore-server.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "library": "spring-mvc", - "artifactId": "spring-mvc-server" -} diff --git a/bin/spring-mvc-petstore-server.sh b/bin/spring-mvc-petstore-server.sh deleted file mode 100755 index ddbb1b4d64f4..000000000000 --- a/bin/spring-mvc-petstore-server.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/JavaSpring -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g spring -c bin/spring-mvc-petstore-server.json -o samples/server/petstore/spring-mvc --additional-properties hideGenerationTimestamp=true,java8=false --additional-properties serverPort=8002 --additional-properties booleanGetterPrefix=get $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/spring-stubs.sh b/bin/spring-stubs.sh deleted file mode 100755 index 79edfa1820e2..000000000000 --- a/bin/spring-stubs.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate --artifact-id spring-stubs -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g spring -o samples/client/petstore/spring-stubs --additional-properties interfaceOnly=true,singleContentTypes=true,hideGenerationTimestamp=true $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/springboot-petstore-server-beanvalidation.json b/bin/springboot-petstore-server-beanvalidation.json deleted file mode 100644 index 21db69b6d8d9..000000000000 --- a/bin/springboot-petstore-server-beanvalidation.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "artifactId": "spring-boot-beanvalidation", - "library": "spring-boot", - "useBeanValidation": true -} diff --git a/bin/springboot-petstore-server-beanvalidation.sh b/bin/springboot-petstore-server-beanvalidation.sh deleted file mode 100755 index 33b1fdce58b3..000000000000 --- a/bin/springboot-petstore-server-beanvalidation.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/JavaSpring -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g spring -o samples/server/petstore/springboot-beanvalidation -c bin/springboot-petstore-server-beanvalidation.json --additional-properties hideGenerationTimestamp=true,java8=false $@" - -echo "Removing files and folders under samples/server/petstore/springboot-beanvalidation/src/main" -rm -rf samples/server/petstore/springboot-beanvalidation/src/main -find samples/server/petstore/springboot-beanvalidation -maxdepth 1 -type f ! -name "README.md" -exec rm {} + -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/springboot-petstore-server-implicitHeaders.json b/bin/springboot-petstore-server-implicitHeaders.json deleted file mode 100644 index 8b76ddb5d26d..000000000000 --- a/bin/springboot-petstore-server-implicitHeaders.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "implicitHeaders": true -} \ No newline at end of file diff --git a/bin/springboot-petstore-server-implicitHeaders.sh b/bin/springboot-petstore-server-implicitHeaders.sh deleted file mode 100755 index 277c57fcbddf..000000000000 --- a/bin/springboot-petstore-server-implicitHeaders.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate --artifact-id springboot-implicitHeaders -t modules/openapi-generator/src/main/resources/JavaSpring -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g spring -c bin/springboot-petstore-server-implicitHeaders.json -o samples/server/petstore/springboot-implicitHeaders --additional-properties hideGenerationTimestamp=true $@" - -echo "Removing files and folders under samples/server/petstore/springboot-implicitHeaders/src/main" -rm -rf samples/server/petstore/springboot-implicitHeaders/src/main -find samples/server/petstore/springboot-implicitHeaders -maxdepth 1 -type f ! -name "README.md" -exec rm {} + -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/springboot-petstore-server-reactive.sh b/bin/springboot-petstore-server-reactive.sh deleted file mode 100755 index 6cc531e66e2c..000000000000 --- a/bin/springboot-petstore-server-reactive.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate --artifact-id springboot-reactive -t modules/openapi-generator/src/main/resources/JavaSpring -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g spring -o samples/server/petstore/springboot-reactive --additional-properties reactive=true,delegatePattern=true,hideGenerationTimestamp=true $@" - -echo "Removing files and folders under samples/server/petstore/springboot-reactive/src/main" -rm -rf samples/server/petstore/springboot-reactive/src/main -find samples/server/petstore/springboot-reactive -maxdepth 1 -type f ! -name "README.md" -exec rm {} + -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/springboot-petstore-server-useOptional.json b/bin/springboot-petstore-server-useOptional.json deleted file mode 100644 index 5a0c80d6b9c9..000000000000 --- a/bin/springboot-petstore-server-useOptional.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "artifactId": "spring-boot-useoptional", - "useOptional": true -} diff --git a/bin/springboot-petstore-server-useOptional.sh b/bin/springboot-petstore-server-useOptional.sh deleted file mode 100755 index 029f923862ac..000000000000 --- a/bin/springboot-petstore-server-useOptional.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/JavaSpring -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g spring -c bin/springboot-petstore-server-useOptional.json -o samples/server/petstore/springboot-useoptional --additional-properties hideGenerationTimestamp=true $@" - -echo "Removing files and folders under samples/server/petstore/springboot-useoptional/src/main" -rm -rf samples/server/petstore/springboot-useoptional/src/main -find samples/server/petstore/springboot-useoptional -maxdepth 1 -type f ! -name "README.md" -exec rm {} + -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/springboot-petstore-server.sh b/bin/springboot-petstore-server.sh deleted file mode 100755 index b1f408e5f3e8..000000000000 --- a/bin/springboot-petstore-server.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate --artifact-id springboot -t modules/openapi-generator/src/main/resources/JavaSpring -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g spring -o samples/server/petstore/springboot --additional-properties hideGenerationTimestamp=true,snapshotVersion=true $@" - -echo "Removing files and folders under samples/server/petstore/springboot/src/main" -rm -rf samples/server/petstore/springboot/src/main -find samples/server/petstore/springboot -maxdepth 1 -type f ! -name "README.md" -exec rm {} + -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/springboot-virtualan-petstore-server.json b/bin/springboot-virtualan-petstore-server.json deleted file mode 100644 index d02799fde624..000000000000 --- a/bin/springboot-virtualan-petstore-server.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "artifactId": "springboot-virtualan", - "library": "spring-boot", - "virtualService": true, - "modelPackage" : "org.openapitools.virtualan.model", - "apiPackage" : "org.openapitools.virtualan.api" -} diff --git a/bin/springboot-virtualan-petstore-server.sh b/bin/springboot-virtualan-petstore-server.sh deleted file mode 100755 index a8471cf19984..000000000000 --- a/bin/springboot-virtualan-petstore-server.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate --artifact-id springboot-virtualan -t modules/openapi-generator/src/main/resources/JavaSpring -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g spring -o samples/server/petstore/springboot-virtualan -c bin/springboot-virtualan-petstore-server.json --additional-properties hideGenerationTimestamp=true $@" - -echo "Removing files and folders under samples/server/petstore/springboot-virtualan/src/main" -rm -rf samples/server/petstore/springboot-virtualan/src/main -find samples/server/petstore/springboot-virtualan -maxdepth 1 -type f ! -name "README.md" -exec rm {} + -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/supportPython2.json b/bin/supportPython2.json deleted file mode 100644 index 8fc7eca95eca..000000000000 --- a/bin/supportPython2.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "supportPython2": true -} diff --git a/bin/swift5-all.sh b/bin/swift5-all.sh deleted file mode 100755 index 0fabcabab42d..000000000000 --- a/bin/swift5-all.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -./bin/swift5-petstore-all.sh -./bin/swift5-test.sh diff --git a/bin/swift5-petstore-alamofire.json b/bin/swift5-petstore-alamofire.json deleted file mode 100644 index f6cc7270be64..000000000000 --- a/bin/swift5-petstore-alamofire.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "podSummary": "PetstoreClient", - "podHomepage": "https://github.com/openapitools/openapi-generator", - "podAuthors": "", - "projectName": "PetstoreClient", - "library": "alamofire" -} diff --git a/bin/swift5-petstore-alamofire.sh b/bin/swift5-petstore-alamofire.sh deleted file mode 100755 index 6c8ef2c5f803..000000000000 --- a/bin/swift5-petstore-alamofire.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/swift5 -i modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -g swift5 -c ./bin/swift5-petstore-alamofire.json -o samples/client/petstore/swift5/alamofireLibrary --generate-alias-as-model $@" - -java $JAVA_OPTS -jar $executable $ags - -if type "xcodegen" > /dev/null 2>&1; then - cd samples/client/petstore/swift5/alamofireLibrary - xcodegen generate -fi - -if type "swiftlint" > /dev/null 2>&1; then - cd samples/client/petstore/swift5/alamofireLibrary - swiftlint autocorrect -fi \ No newline at end of file diff --git a/bin/swift5-petstore-all.sh b/bin/swift5-petstore-all.sh deleted file mode 100755 index c3f468af0312..000000000000 --- a/bin/swift5-petstore-all.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh - -./bin/swift5-petstore.sh -./bin/swift5-petstore-promisekit.sh -./bin/swift5-petstore-result.sh -./bin/swift5-petstore-rxswift.sh -./bin/swift5-petstore-objcCompatible.sh -./bin/swift5-petstore-nonPublicApi.sh -./bin/swift5-petstore-urlsession.sh -./bin/swift5-petstore-alamofire.sh -./bin/swift5-petstore-combine.sh -./bin/swift5-petstore-readonlyProperties.sh -./bin/swift5-petstore-deprecated.sh diff --git a/bin/swift5-petstore-combine.json b/bin/swift5-petstore-combine.json deleted file mode 100644 index ef420f56e2e3..000000000000 --- a/bin/swift5-petstore-combine.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "podSummary": "PetstoreClient", - "podHomepage": "https://github.com/openapitools/openapi-generator", - "podAuthors": "", - "projectName": "PetstoreClient", - "responseAs": "Combine" -} diff --git a/bin/swift5-petstore-combine.sh b/bin/swift5-petstore-combine.sh deleted file mode 100755 index 71ca667a9adc..000000000000 --- a/bin/swift5-petstore-combine.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/swift5 -i modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -g swift5 -c ./bin/swift5-petstore-combine.json -o samples/client/petstore/swift5/combineLibrary --generate-alias-as-model $@" - -java $JAVA_OPTS -jar $executable $ags - -if type "xcodegen" > /dev/null 2>&1; then - cd samples/client/petstore/swift5/combineLibrary - xcodegen generate -fi - -if type "swiftlint" > /dev/null 2>&1; then - cd samples/client/petstore/swift5/combineLibrary - swiftlint autocorrect -fi \ No newline at end of file diff --git a/bin/swift5-petstore-deprecated.json b/bin/swift5-petstore-deprecated.json deleted file mode 100644 index 59bd94f43efb..000000000000 --- a/bin/swift5-petstore-deprecated.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "podSummary": "PetstoreClient", - "podHomepage": "https://github.com/openapitools/openapi-generator", - "podAuthors": "", - "projectName": "PetstoreClient" -} diff --git a/bin/swift5-petstore-deprecated.sh b/bin/swift5-petstore-deprecated.sh deleted file mode 100755 index b26f1c430f80..000000000000 --- a/bin/swift5-petstore-deprecated.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/swift5 -i modules/openapi-generator/src/test/resources/3_0/petstore-with-depreacted-fields.yaml -g swift5 -c ./bin/swift5-petstore-deprecated.json -o samples/client/petstore/swift5/deprecated --generate-alias-as-model $@" - -java $JAVA_OPTS -jar $executable $ags - -if type "xcodegen" > /dev/null 2>&1; then - cd samples/client/petstore/swift5/deprecated - xcodegen generate -fi - -if type "swiftlint" > /dev/null 2>&1; then - cd samples/client/petstore/swift5/deprecated - swiftlint autocorrect -fi \ No newline at end of file diff --git a/bin/swift5-petstore-nonPublicApi.json b/bin/swift5-petstore-nonPublicApi.json deleted file mode 100644 index f20305dec059..000000000000 --- a/bin/swift5-petstore-nonPublicApi.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "podSummary": "PetstoreClient", - "podHomepage": "https://github.com/openapitools/openapi-generator", - "podAuthors": "", - "projectName": "PetstoreClient", - "nonPublicApi": true, - "sortParamsByRequiredFlag": false -} diff --git a/bin/swift5-petstore-nonPublicApi.sh b/bin/swift5-petstore-nonPublicApi.sh deleted file mode 100755 index fc4035bfca6d..000000000000 --- a/bin/swift5-petstore-nonPublicApi.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/swift5 -i modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -g swift5 -c ./bin/swift5-petstore-nonPublicApi.json -o samples/client/petstore/swift5/nonPublicApi --generate-alias-as-model $@" - -java $JAVA_OPTS -jar $executable $ags - -if type "xcodegen" > /dev/null 2>&1; then - cd samples/client/petstore/swift5/nonPublicApi - xcodegen generate -fi - -if type "swiftlint" > /dev/null 2>&1; then - cd samples/client/petstore/swift5/nonPublicApi - swiftlint autocorrect -fi \ No newline at end of file diff --git a/bin/swift5-petstore-objcCompatible.json b/bin/swift5-petstore-objcCompatible.json deleted file mode 100644 index c24c7abf69c4..000000000000 --- a/bin/swift5-petstore-objcCompatible.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "podSummary": "PetstoreClient", - "podHomepage": "https://github.com/openapitools/openapi-generator", - "podAuthors": "", - "projectName": "PetstoreClient", - "objcCompatible": true -} diff --git a/bin/swift5-petstore-objcCompatible.sh b/bin/swift5-petstore-objcCompatible.sh deleted file mode 100755 index 39d53ff8e653..000000000000 --- a/bin/swift5-petstore-objcCompatible.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/swift5 -i modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -g swift5 -c ./bin/swift5-petstore-objcCompatible.json -o samples/client/petstore/swift5/objcCompatible --generate-alias-as-model $@" - -java $JAVA_OPTS -jar $executable $ags - -if type "xcodegen" > /dev/null 2>&1; then - cd samples/client/petstore/swift5/objcCompatible - xcodegen generate -fi - -if type "swiftlint" > /dev/null 2>&1; then - cd samples/client/petstore/swift5/objcCompatible - swiftlint autocorrect -fi \ No newline at end of file diff --git a/bin/swift5-petstore-promisekit.json b/bin/swift5-petstore-promisekit.json deleted file mode 100644 index 48137f1f2800..000000000000 --- a/bin/swift5-petstore-promisekit.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "podSummary": "PetstoreClient", - "podHomepage": "https://github.com/openapitools/openapi-generator", - "podAuthors": "", - "projectName": "PetstoreClient", - "responseAs": "PromiseKit" -} diff --git a/bin/swift5-petstore-promisekit.sh b/bin/swift5-petstore-promisekit.sh deleted file mode 100755 index f864088e9b2d..000000000000 --- a/bin/swift5-petstore-promisekit.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/swift5 -i modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -g swift5 -c ./bin/swift5-petstore-promisekit.json -o samples/client/petstore/swift5/promisekitLibrary --generate-alias-as-model $@" - -java $JAVA_OPTS -jar $executable $ags - -if type "xcodegen" > /dev/null 2>&1; then - cd samples/client/petstore/swift5/promisekitLibrary - xcodegen generate -fi - -if type "swiftlint" > /dev/null 2>&1; then - cd samples/client/petstore/swift5/promisekitLibrary - swiftlint autocorrect -fi \ No newline at end of file diff --git a/bin/swift5-petstore-readOnlyProperties.sh b/bin/swift5-petstore-readOnlyProperties.sh deleted file mode 100755 index fe838af1d3c6..000000000000 --- a/bin/swift5-petstore-readOnlyProperties.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/swift5 -i modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -g swift5 -c ./bin/swift5-petstore-readonlyProperties.json -o samples/client/petstore/swift5/readonlyProperties --generate-alias-as-model $@" - -java $JAVA_OPTS -jar $executable $ags - -if type "xcodegen" > /dev/null 2>&1; then - cd samples/client/petstore/swift5/readonlyProperties - xcodegen generate -fi - -if type "swiftlint" > /dev/null 2>&1; then - cd samples/client/petstore/swift5/readonlyProperties - swiftlint autocorrect -fi \ No newline at end of file diff --git a/bin/swift5-petstore-readonlyProperties.json b/bin/swift5-petstore-readonlyProperties.json deleted file mode 100644 index 3993a3c26aab..000000000000 --- a/bin/swift5-petstore-readonlyProperties.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "podSummary": "PetstoreClient", - "podHomepage": "https://github.com/openapitools/openapi-generator", - "podAuthors": "", - "projectName": "PetstoreClient", - "readonlyProperties": true -} diff --git a/bin/swift5-petstore-result.json b/bin/swift5-petstore-result.json deleted file mode 100644 index 315433867862..000000000000 --- a/bin/swift5-petstore-result.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "podSummary": "PetstoreClient", - "podHomepage": "https://github.com/openapitools/openapi-generator", - "podAuthors": "", - "projectName": "PetstoreClient", - "responseAs": "Result" -} diff --git a/bin/swift5-petstore-result.sh b/bin/swift5-petstore-result.sh deleted file mode 100755 index 803c79a4f7c5..000000000000 --- a/bin/swift5-petstore-result.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/swift5 -i modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -g swift5 -c ./bin/swift5-petstore-result.json -o samples/client/petstore/swift5/resultLibrary --generate-alias-as-model $@" - -java $JAVA_OPTS -jar $executable $ags - -if type "xcodegen" > /dev/null 2>&1; then - cd samples/client/petstore/swift5/resultLibrary - xcodegen generate -fi - -if type "swiftlint" > /dev/null 2>&1; then - cd samples/client/petstore/swift5/resultLibrary - swiftlint autocorrect -fi \ No newline at end of file diff --git a/bin/swift5-petstore-rxswift.json b/bin/swift5-petstore-rxswift.json deleted file mode 100644 index eb8b11dde559..000000000000 --- a/bin/swift5-petstore-rxswift.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "podSummary": "PetstoreClient", - "podHomepage": "https://github.com/openapitools/openapi-generator", - "podAuthors": "", - "projectName": "PetstoreClient", - "responseAs": "RxSwift" -} diff --git a/bin/swift5-petstore-rxswift.sh b/bin/swift5-petstore-rxswift.sh deleted file mode 100755 index 9c8398248ebd..000000000000 --- a/bin/swift5-petstore-rxswift.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/swift5 -i modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -g swift5 -c ./bin/swift5-petstore-rxswift.json -o samples/client/petstore/swift5/rxswiftLibrary --generate-alias-as-model $@" - -java $JAVA_OPTS -jar $executable $ags - -if type "xcodegen" > /dev/null 2>&1; then - cd samples/client/petstore/swift5/rxswiftLibrary - xcodegen generate -fi - -if type "swiftlint" > /dev/null 2>&1; then - cd samples/client/petstore/swift5/rxswiftLibrary - swiftlint autocorrect -fi \ No newline at end of file diff --git a/bin/swift5-petstore-urlsession.json b/bin/swift5-petstore-urlsession.json deleted file mode 100644 index db0f6c9fbfb3..000000000000 --- a/bin/swift5-petstore-urlsession.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "podSummary": "PetstoreClient", - "podHomepage": "https://github.com/openapitools/openapi-generator", - "podAuthors": "", - "projectName": "PetstoreClient", - "library": "urlsession" -} diff --git a/bin/swift5-petstore-urlsession.sh b/bin/swift5-petstore-urlsession.sh deleted file mode 100755 index 76a674d4315c..000000000000 --- a/bin/swift5-petstore-urlsession.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/swift5 -i modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -g swift5 -c ./bin/swift5-petstore-urlsession.json -o samples/client/petstore/swift5/urlsessionLibrary --generate-alias-as-model $@" - -java $JAVA_OPTS -jar $executable $ags - -if type "xcodegen" > /dev/null 2>&1; then - cd samples/client/petstore/swift5/urlsessionLibrary - xcodegen generate -fi - -if type "swiftlint" > /dev/null 2>&1; then - cd samples/client/petstore/swift5/urlsessionLibrary - swiftlint autocorrect -fi \ No newline at end of file diff --git a/bin/swift5-petstore.json b/bin/swift5-petstore.json deleted file mode 100644 index 59bd94f43efb..000000000000 --- a/bin/swift5-petstore.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "podSummary": "PetstoreClient", - "podHomepage": "https://github.com/openapitools/openapi-generator", - "podAuthors": "", - "projectName": "PetstoreClient" -} diff --git a/bin/swift5-petstore.sh b/bin/swift5-petstore.sh deleted file mode 100755 index f2752acc1a07..000000000000 --- a/bin/swift5-petstore.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/swift5 -i modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -g swift5 -c ./bin/swift5-petstore.json -o samples/client/petstore/swift5/default --generate-alias-as-model $@" - -java $JAVA_OPTS -jar $executable $ags - -if type "xcodegen" > /dev/null 2>&1; then - cd samples/client/petstore/swift5/default - xcodegen generate -fi - -if type "swiftlint" > /dev/null 2>&1; then - cd samples/client/petstore/swift5/default - swiftlint autocorrect -fi diff --git a/bin/swift5-test.json b/bin/swift5-test.json deleted file mode 100644 index 9341b740a2a6..000000000000 --- a/bin/swift5-test.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "podSummary": "TestClient", - "podHomepage": "https://github.com/openapitools/openapi-generator", - "podAuthors": "", - "projectName": "TestClient" -} diff --git a/bin/swift5-test.sh b/bin/swift5-test.sh deleted file mode 100755 index 1620ea6e270a..000000000000 --- a/bin/swift5-test.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/swift5 -i modules/openapi-generator/src/test/resources/2_0/swift5Test.json -g swift5 -c ./bin/swift5-test.json -o samples/client/test/swift5/default --generate-alias-as-model $@" - -java $JAVA_OPTS -jar $executable $ags - -if type "xcodegen" > /dev/null 2>&1; then - cd samples/client/test/swift5/default - xcodegen generate -fi - -if type "swiftlint" > /dev/null 2>&1; then - cd samples/client/test/swift5/default - swiftlint autocorrect -fi diff --git a/bin/typescript-angular-petstore-all.sh b/bin/typescript-angular-petstore-all.sh deleted file mode 100755 index 55ed856f34e9..000000000000 --- a/bin/typescript-angular-petstore-all.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh - -./bin/typescript-angular-v6-petstore-not-provided-in-root.sh -./bin/typescript-angular-v6-petstore-not-provided-in-root-with-npm.sh -./bin/typescript-angular-v6-petstore-provided-in-root.sh -./bin/typescript-angular-v6-petstore-provided-in-root-with-npm.sh -./bin/typescript-angular-v7-petstore-not-provided-in-root.sh -./bin/typescript-angular-v7-petstore-not-provided-in-root-with-npm.sh -./bin/typescript-angular-v7-petstore-provided-in-root.sh -./bin/typescript-angular-v7-petstore-provided-in-root-with-npm.sh -./bin/typescript-angular-v8-petstore-provided-in-root-with-npm.sh -./bin/typescript-angular-v8-petstore-provided-in-root-with-prefixed-module-name.sh -./bin/typescript-angular-v8-petstore-single-request-parameter.sh diff --git a/bin/typescript-angular-v6-petstore-not-provided-in-root-with-npm.json b/bin/typescript-angular-v6-petstore-not-provided-in-root-with-npm.json deleted file mode 100644 index 535bffbd45e4..000000000000 --- a/bin/typescript-angular-v6-petstore-not-provided-in-root-with-npm.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "npmName": "@openapitools/typescript-angular-petstore", - "npmVersion": "1.0.0", - "npmRepository" : "https://skimdb.npmjs.com/registry", - "snapshot" : false -} 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 deleted file mode 100755 index 981e55dbc28a..000000000000 --- a/bin/typescript-angular-v6-petstore-not-provided-in-root-with-npm.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -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 --additional-properties ngVersion=6.0.0,providedInRoot=false $@" - -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 deleted file mode 100755 index f00826e050f7..000000000000 --- a/bin/typescript-angular-v6-petstore-not-provided-in-root.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -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 --additional-properties ngVersion=6.0.0,providedInRoot=false $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/typescript-angular-v6-petstore-provided-in-root-with-npm.json b/bin/typescript-angular-v6-petstore-provided-in-root-with-npm.json deleted file mode 100644 index 535bffbd45e4..000000000000 --- a/bin/typescript-angular-v6-petstore-provided-in-root-with-npm.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "npmName": "@openapitools/typescript-angular-petstore", - "npmVersion": "1.0.0", - "npmRepository" : "https://skimdb.npmjs.com/registry", - "snapshot" : false -} diff --git a/bin/typescript-angular-v6-petstore-provided-in-root-with-npm.sh b/bin/typescript-angular-v6-petstore-provided-in-root-with-npm.sh deleted file mode 100755 index e1da8eba2882..000000000000 --- a/bin/typescript-angular-v6-petstore-provided-in-root-with-npm.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -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-provided-in-root-with-npm.json -o samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm --additional-properties ngVersion=6.0.0 $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/typescript-angular-v6-petstore-provided-in-root.sh b/bin/typescript-angular-v6-petstore-provided-in-root.sh deleted file mode 100755 index 7ef2f7215288..000000000000 --- a/bin/typescript-angular-v6-petstore-provided-in-root.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -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-provided-in-root/builds/default --additional-properties ngVersion=6.0.0 $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/typescript-angular-v7-petstore-not-provided-in-root-with-npm.json b/bin/typescript-angular-v7-petstore-not-provided-in-root-with-npm.json deleted file mode 100644 index 9c939c67ae47..000000000000 --- a/bin/typescript-angular-v7-petstore-not-provided-in-root-with-npm.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "npmName": "@openapitools/typescript-angular-petstore", - "npmVersion": "1.0.0", - "stringEnums": true, - "npmRepository": "https://skimdb.npmjs.com/registry", - "snapshot": false -} diff --git a/bin/typescript-angular-v7-petstore-not-provided-in-root-with-npm.sh b/bin/typescript-angular-v7-petstore-not-provided-in-root-with-npm.sh deleted file mode 100755 index f74cb16b02a8..000000000000 --- a/bin/typescript-angular-v7-petstore-not-provided-in-root-with-npm.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -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-v7-petstore-not-provided-in-root-with-npm.json -o samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm --additional-properties ngVersion=7.0.0,providedInRoot=false $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/typescript-angular-v7-petstore-not-provided-in-root.sh b/bin/typescript-angular-v7-petstore-not-provided-in-root.sh deleted file mode 100755 index 46eb22cbc4d8..000000000000 --- a/bin/typescript-angular-v7-petstore-not-provided-in-root.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -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-v7-not-provided-in-root/builds/default --additional-properties ngVersion=7.0.0,providedInRoot=false $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/typescript-angular-v7-petstore-provided-in-root-with-npm.json b/bin/typescript-angular-v7-petstore-provided-in-root-with-npm.json deleted file mode 100644 index 535bffbd45e4..000000000000 --- a/bin/typescript-angular-v7-petstore-provided-in-root-with-npm.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "npmName": "@openapitools/typescript-angular-petstore", - "npmVersion": "1.0.0", - "npmRepository" : "https://skimdb.npmjs.com/registry", - "snapshot" : false -} diff --git a/bin/typescript-angular-v7-petstore-provided-in-root-with-npm.sh b/bin/typescript-angular-v7-petstore-provided-in-root-with-npm.sh deleted file mode 100755 index 5d9f0d738e51..000000000000 --- a/bin/typescript-angular-v7-petstore-provided-in-root-with-npm.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -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-v7-petstore-provided-in-root-with-npm.json -o samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm --additional-properties ngVersion=7.0.0 $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/typescript-angular-v7-petstore-provided-in-root.sh b/bin/typescript-angular-v7-petstore-provided-in-root.sh deleted file mode 100755 index 222f35fd98af..000000000000 --- a/bin/typescript-angular-v7-petstore-provided-in-root.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -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-v7-provided-in-root/builds/default --additional-properties ngVersion=7.0.0 $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/typescript-angular-v8-petstore-provided-in-root-with-npm.json b/bin/typescript-angular-v8-petstore-provided-in-root-with-npm.json deleted file mode 100644 index 11141667cfe4..000000000000 --- a/bin/typescript-angular-v8-petstore-provided-in-root-with-npm.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "npmName": "@openapitools/typescript-angular-petstore", - "npmVersion": "1.0.0", - "npmRepository" : "https://skimdb.npmjs.com/registry", - "snapshot" : false, - "ngVersion": "8.0.0" -} diff --git a/bin/typescript-angular-v8-petstore-provided-in-root-with-npm.sh b/bin/typescript-angular-v8-petstore-provided-in-root-with-npm.sh deleted file mode 100755 index c34db65d2d05..000000000000 --- a/bin/typescript-angular-v8-petstore-provided-in-root-with-npm.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -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-v8-petstore-provided-in-root-with-npm.json -o samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm --additional-properties ngVersion=8.0.0 $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/typescript-angular-v8-petstore-provided-in-root-with-prefixed-module-name.sh b/bin/typescript-angular-v8-petstore-provided-in-root-with-prefixed-module-name.sh deleted file mode 100755 index 993a143da6db..000000000000 --- a/bin/typescript-angular-v8-petstore-provided-in-root-with-prefixed-module-name.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -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-v8-petstore-provided-in-root-with-npm.json -o samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name --additional-properties ngVersion=8.0.0,apiModulePrefix=PetStore $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/typescript-angular-v8-petstore-single-request-parameter.sh b/bin/typescript-angular-v8-petstore-single-request-parameter.sh deleted file mode 100755 index 9f25d467d217..000000000000 --- a/bin/typescript-angular-v8-petstore-single-request-parameter.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -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-v8-petstore-provided-in-root-with-npm.json -o samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter --additional-properties ngVersion=8.0.0,useSingleRequestParameter=true $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/typescript-angularjs-petstore.sh b/bin/typescript-angularjs-petstore.sh deleted file mode 100755 index 72c8aac266db..000000000000 --- a/bin/typescript-angularjs-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript-angularjs -o samples/client/petstore/typescript-angularjs $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/typescript-aurelia-petstore.sh b/bin/typescript-aurelia-petstore.sh deleted file mode 100755 index a9f40e6f76ec..000000000000 --- a/bin/typescript-aurelia-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript-aurelia -o samples/client/petstore/typescript-aurelia/default $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/typescript-axios-petstore-all.sh b/bin/typescript-axios-petstore-all.sh deleted file mode 100755 index c66b3eba3074..000000000000 --- a/bin/typescript-axios-petstore-all.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -./bin/typescript-axios-petstore-target-es6.sh -./bin/typescript-axios-petstore-with-npm-version.sh -./bin/typescript-axios-petstore-with-npm-version-and-separate-models-and-api.sh -./bin/typescript-axios-petstore-with-complex-headers.sh -./bin/typescript-axios-petstore-with-single-request-parameters.sh -./bin/typescript-axios-petstore-interfaces.sh -./bin/typescript-axios-petstore-composed-schemas.sh -./bin/typescript-axios-petstore.sh diff --git a/bin/typescript-axios-petstore-composed-schemas.sh b/bin/typescript-axios-petstore-composed-schemas.sh deleted file mode 100755 index 8ed378b6f34f..000000000000 --- a/bin/typescript-axios-petstore-composed-schemas.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/3_0/composed-schemas.yaml -g typescript-axios -o samples/client/petstore/typescript-axios/builds/composed-schemas $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/typescript-axios-petstore-interfaces.sh b/bin/typescript-axios-petstore-interfaces.sh deleted file mode 100755 index 84a65e0aba3b..000000000000 --- a/bin/typescript-axios-petstore-interfaces.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript-axios -o samples/client/petstore/typescript-axios/builds/with-interfaces --additional-properties withInterfaces=true $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/typescript-axios-petstore-target-es6.json b/bin/typescript-axios-petstore-target-es6.json deleted file mode 100755 index 9d429900bfe8..000000000000 --- a/bin/typescript-axios-petstore-target-es6.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "npmName": "@openapitools/typescript-axios-petstore", - "npmVersion": "1.0.0", - "npmRepository": "https://skimdb.npmjs.com/registry", - "snapshot": false, - "supportsES6": true -} diff --git a/bin/typescript-axios-petstore-target-es6.sh b/bin/typescript-axios-petstore-target-es6.sh deleted file mode 100755 index fc5ec66aead5..000000000000 --- a/bin/typescript-axios-petstore-target-es6.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript-axios -c bin/typescript-axios-petstore-target-es6.json -o samples/client/petstore/typescript-axios/builds/es6-target $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/typescript-axios-petstore-with-complex-headers.sh b/bin/typescript-axios-petstore-with-complex-headers.sh deleted file mode 100755 index 385f9684c1a0..000000000000 --- a/bin/typescript-axios-petstore-with-complex-headers.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -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/3_0/petstore-with-complex-headers.yaml -g typescript-axios -o samples/client/petstore/typescript-axios/builds/with-complex-headers $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/typescript-axios-petstore-with-npm-version-and-separate-models-and-api.json b/bin/typescript-axios-petstore-with-npm-version-and-separate-models-and-api.json deleted file mode 100755 index db558308ab78..000000000000 --- a/bin/typescript-axios-petstore-with-npm-version-and-separate-models-and-api.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "npmName": "@openapitools/typescript-axios-petstore", - "npmVersion": "1.0.0", - "npmRepository": "https://skimdb.npmjs.com/registry", - "snapshot": false, - "withSeparateModelsAndApi": true, - "modelPackage": "model.some.levels.deep", - "apiPackage": "api.another.level" -} diff --git a/bin/typescript-axios-petstore-with-npm-version-and-separate-models-and-api.sh b/bin/typescript-axios-petstore-with-npm-version-and-separate-models-and-api.sh deleted file mode 100755 index 12337bf74335..000000000000 --- a/bin/typescript-axios-petstore-with-npm-version-and-separate-models-and-api.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript-axios -c bin/typescript-axios-petstore-with-npm-version-and-separate-models-and-api.json -o samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/typescript-axios-petstore-with-npm-version.json b/bin/typescript-axios-petstore-with-npm-version.json deleted file mode 100755 index f3ad549beee1..000000000000 --- a/bin/typescript-axios-petstore-with-npm-version.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "npmName": "@openapitools/typescript-axios-petstore", - "npmVersion": "1.0.0", - "npmRepository": "https://skimdb.npmjs.com/registry", - "snapshot": false -} diff --git a/bin/typescript-axios-petstore-with-npm-version.sh b/bin/typescript-axios-petstore-with-npm-version.sh deleted file mode 100755 index c836c3159f4e..000000000000 --- a/bin/typescript-axios-petstore-with-npm-version.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript-axios -c bin/typescript-axios-petstore-with-npm-version.json -o samples/client/petstore/typescript-axios/builds/with-npm-version $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/typescript-axios-petstore-with-single-request-parameters.sh b/bin/typescript-axios-petstore-with-single-request-parameters.sh deleted file mode 100755 index 25a7a60ce29c..000000000000 --- a/bin/typescript-axios-petstore-with-single-request-parameters.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore-with-operations-without-required-params.yaml -g typescript-axios -o samples/client/petstore/typescript-axios/builds/with-single-request-parameters --additional-properties useSingleRequestParameter=true $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/typescript-axios-petstore.sh b/bin/typescript-axios-petstore.sh deleted file mode 100755 index 10071fb50c67..000000000000 --- a/bin/typescript-axios-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript-axios -o samples/client/petstore/typescript-axios/builds/default $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/typescript-fetch-petstore-all.sh b/bin/typescript-fetch-petstore-all.sh deleted file mode 100755 index 7258b830a72d..000000000000 --- a/bin/typescript-fetch-petstore-all.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -./bin/typescript-fetch-petstore-target-es6.sh -./bin/typescript-fetch-petstore-with-npm-version.sh -./bin/typescript-fetch-petstore-interfaces.sh -./bin/typescript-fetch-petstore.sh -./bin/typescript-fetch-petstore-multiple-parameters.sh -./bin/typescript-fetch-petstore-prefix-parameter-interfaces.sh -./bin/typescript-fetch-petstore-typescript-three-plus.sh diff --git a/bin/typescript-fetch-petstore-interfaces.sh b/bin/typescript-fetch-petstore-interfaces.sh deleted file mode 100755 index 412d778b4f9c..000000000000 --- a/bin/typescript-fetch-petstore-interfaces.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript-fetch -o samples/client/petstore/typescript-fetch/builds/with-interfaces --additional-properties withInterfaces=true $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/typescript-fetch-petstore-multiple-parameters.json b/bin/typescript-fetch-petstore-multiple-parameters.json deleted file mode 100644 index c165a82a503e..000000000000 --- a/bin/typescript-fetch-petstore-multiple-parameters.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "snapshot" : false, - "useSingleRequestParameter": false -} \ No newline at end of file diff --git a/bin/typescript-fetch-petstore-multiple-parameters.sh b/bin/typescript-fetch-petstore-multiple-parameters.sh deleted file mode 100755 index 6dfa018ef377..000000000000 --- a/bin/typescript-fetch-petstore-multiple-parameters.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript-fetch -c bin/typescript-fetch-petstore-multiple-parameters.json -o samples/client/petstore/typescript-fetch/builds/multiple-parameters $@" - -java $JAVA_OPTS -jar $executable $ags -cp CI/samples.ci/client/petstore/typescript-fetch/builds/multiple-parameters/pom.xml samples/client/petstore/typescript-fetch/builds/multiple-parameters/pom.xml -cp CI/samples.ci/client/petstore/typescript-fetch/tests/default/pom.xml samples/client/petstore/typescript-fetch/tests/default/pom.xml \ No newline at end of file diff --git a/bin/typescript-fetch-petstore-prefix-parameter-interfaces.json b/bin/typescript-fetch-petstore-prefix-parameter-interfaces.json deleted file mode 100644 index 5694785550cc..000000000000 --- a/bin/typescript-fetch-petstore-prefix-parameter-interfaces.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "npmName": "@openapitools/typescript-fetch-petstore", - "npmVersion": "1.0.0", - "npmRepository" : "https://skimdb.npmjs.com/registry", - "snapshot" : false, - "prefixParameterInterfaces": true -} diff --git a/bin/typescript-fetch-petstore-prefix-parameter-interfaces.sh b/bin/typescript-fetch-petstore-prefix-parameter-interfaces.sh deleted file mode 100755 index 9ba84b2cc47d..000000000000 --- a/bin/typescript-fetch-petstore-prefix-parameter-interfaces.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript-fetch -c bin/typescript-fetch-petstore-prefix-parameter-interfaces.json -o samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces $@" - -java $JAVA_OPTS -jar $executable $ags - -cp CI/samples.ci/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/pom.xml samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/pom.xml diff --git a/bin/typescript-fetch-petstore-target-es6.json b/bin/typescript-fetch-petstore-target-es6.json deleted file mode 100644 index 4eefe39000af..000000000000 --- a/bin/typescript-fetch-petstore-target-es6.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "npmName": "@openapitools/typescript-fetch-petstore", - "npmVersion": "1.0.0", - "npmRepository" : "https://skimdb.npmjs.com/registry", - "snapshot" : false, - "supportsES6": true -} diff --git a/bin/typescript-fetch-petstore-target-es6.sh b/bin/typescript-fetch-petstore-target-es6.sh deleted file mode 100755 index 9edd6f2e257a..000000000000 --- a/bin/typescript-fetch-petstore-target-es6.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript-fetch -c bin/typescript-fetch-petstore-target-es6.json -o samples/client/petstore/typescript-fetch/builds/es6-target $@" - -java $JAVA_OPTS -jar $executable $ags -cp CI/samples.ci/client/petstore/typescript-fetch/builds/es6-target/pom.xml samples/client/petstore/typescript-fetch/builds/es6-target/pom.xml -cp CI/samples.ci/client/petstore/typescript-fetch/tests/default/pom.xml samples/client/petstore/typescript-fetch/tests/default/pom.xml \ No newline at end of file diff --git a/bin/typescript-fetch-petstore-typescript-three-plus.json b/bin/typescript-fetch-petstore-typescript-three-plus.json deleted file mode 100644 index b8952aa6e8bb..000000000000 --- a/bin/typescript-fetch-petstore-typescript-three-plus.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "npmName": "@openapitools/typescript-fetch-petstore", - "npmVersion": "1.0.0", - "npmRepository" : "https://skimdb.npmjs.com/registry", - "snapshot" : false, - "typescriptThreePlus": true -} diff --git a/bin/typescript-fetch-petstore-typescript-three-plus.sh b/bin/typescript-fetch-petstore-typescript-three-plus.sh deleted file mode 100755 index 91776dd94f09..000000000000 --- a/bin/typescript-fetch-petstore-typescript-three-plus.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript-fetch -c bin/typescript-fetch-petstore-typescript-three-plus.json -o samples/client/petstore/typescript-fetch/builds/typescript-three-plus $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/typescript-fetch-petstore-with-npm-version.json b/bin/typescript-fetch-petstore-with-npm-version.json deleted file mode 100644 index 1e64bb7ff3ed..000000000000 --- a/bin/typescript-fetch-petstore-with-npm-version.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "npmName": "@openapitools/typescript-fetch-petstore", - "npmVersion": "1.0.0", - "npmRepository" : "https://skimdb.npmjs.com/registry", - "snapshot" : false -} diff --git a/bin/typescript-fetch-petstore-with-npm-version.sh b/bin/typescript-fetch-petstore-with-npm-version.sh deleted file mode 100755 index 16d60e5f465c..000000000000 --- a/bin/typescript-fetch-petstore-with-npm-version.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript-fetch -c bin/typescript-fetch-petstore-with-npm-version.json -o samples/client/petstore/typescript-fetch/builds/with-npm-version $@" - -java $JAVA_OPTS -jar $executable $ags -cp CI/samples.ci/client/petstore/typescript-fetch/builds/with-npm-version/pom.xml samples/client/petstore/typescript-fetch/builds/with-npm-version/pom.xml -cp CI/samples.ci/client/petstore/typescript-fetch/tests/default/pom.xml samples/client/petstore/typescript-fetch/tests/default/pom.xml \ No newline at end of file diff --git a/bin/typescript-fetch-petstore.sh b/bin/typescript-fetch-petstore.sh deleted file mode 100755 index 2b3f34a20f20..000000000000 --- a/bin/typescript-fetch-petstore.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript-fetch -o samples/client/petstore/typescript-fetch/builds/default $@" - -java $JAVA_OPTS -jar $executable $ags -cp CI/samples.ci/client/petstore/typescript-fetch/builds/default/pom.xml samples/client/petstore/typescript-fetch/builds/default/pom.xml -cp CI/samples.ci/client/petstore/typescript-fetch/tests/default/pom.xml samples/client/petstore/typescript-fetch/tests/default/pom.xml \ No newline at end of file diff --git a/bin/typescript-inversify-petstore.sh b/bin/typescript-inversify-petstore.sh deleted file mode 100755 index f79dbaf0de98..000000000000 --- a/bin/typescript-inversify-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript-inversify -o samples/client/petstore/typescript-inversify $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/typescript-jquery-petstore-all.sh b/bin/typescript-jquery-petstore-all.sh deleted file mode 100755 index 16b8a70dd3a6..000000000000 --- a/bin/typescript-jquery-petstore-all.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -./bin/typescript-jquery-petstore.sh -./bin/typescript-jquery-petstore-with-npm.sh diff --git a/bin/typescript-jquery-petstore-npm.json b/bin/typescript-jquery-petstore-npm.json deleted file mode 100644 index 846a80ad4798..000000000000 --- a/bin/typescript-jquery-petstore-npm.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "npmName": "@openapitools/jquery-typescript-petstore", - "npmVersion": "0.0.1", - "npmRepository" : "https://skimdb.npmjs.com/registry", - "snapshot" : false -} diff --git a/bin/typescript-jquery-petstore-with-npm.sh b/bin/typescript-jquery-petstore-with-npm.sh deleted file mode 100755 index 0bb443c6ee29..000000000000 --- a/bin/typescript-jquery-petstore-with-npm.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript-jquery -c bin/typescript-jquery-petstore-npm.json -o samples/client/petstore/typescript-jquery/npm $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/typescript-jquery-petstore.sh b/bin/typescript-jquery-petstore.sh deleted file mode 100755 index d45e06275ac6..000000000000 --- a/bin/typescript-jquery-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript-jquery -o samples/client/petstore/typescript-jquery/default $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/typescript-node-petstore-all.sh b/bin/typescript-node-petstore-all.sh deleted file mode 100755 index 08ba781a00e2..000000000000 --- a/bin/typescript-node-petstore-all.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -./bin/typescript-node-petstore-with-npm.sh -./bin/typescript-node-petstore.sh diff --git a/bin/typescript-node-petstore-npm.json b/bin/typescript-node-petstore-npm.json deleted file mode 100644 index 773813fb41b4..000000000000 --- a/bin/typescript-node-petstore-npm.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "npmName": "@openapitools/node-typescript-petstore", - "npmVersion": "0.0.1", - "npmRepository": "https://skimdb.npmjs.com/registry", - "snapshot": false -} diff --git a/bin/typescript-node-petstore-with-npm.sh b/bin/typescript-node-petstore-with-npm.sh deleted file mode 100755 index c494752f5e5b..000000000000 --- a/bin/typescript-node-petstore-with-npm.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript-node -c bin/typescript-node-petstore-npm.json -o samples/client/petstore/typescript-node/npm $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/typescript-node-petstore.sh b/bin/typescript-node-petstore.sh deleted file mode 100755 index 4554636e4825..000000000000 --- a/bin/typescript-node-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript-node -o samples/client/petstore/typescript-node/default $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/typescript-petstore-npm.json b/bin/typescript-petstore-npm.json deleted file mode 100644 index 2f5bf810ecc0..000000000000 --- a/bin/typescript-petstore-npm.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "npmName": "@openapitools/angular2-typescript-petstore", - "npmVersion": "0.0.1", - "npmRepository" : "https://skimdb.npmjs.com/registry", - "snapshot" : false -} diff --git a/bin/typescript-redux-query-petstore-with-npm-version.json b/bin/typescript-redux-query-petstore-with-npm-version.json deleted file mode 100644 index fd8e859f3521..000000000000 --- a/bin/typescript-redux-query-petstore-with-npm-version.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "npmName": "@openapitools/typescript-redux-query-petstore", - "npmVersion": "1.0.0", - "npmRepository" : "https://skimdb.npmjs.com/registry", - "snapshot" : false -} diff --git a/bin/typescript-redux-query-petstore-with-npm-version.sh b/bin/typescript-redux-query-petstore-with-npm-version.sh deleted file mode 100755 index 262e4b69c1a1..000000000000 --- a/bin/typescript-redux-query-petstore-with-npm-version.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/typescript-redux-query -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript-redux-query -c bin/typescript-redux-query-petstore-with-npm-version.json -o samples/client/petstore/typescript-redux-query/builds/with-npm-version $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/typescript-redux-query-petstore.sh b/bin/typescript-redux-query-petstore.sh deleted file mode 100755 index 4b8d347849a0..000000000000 --- a/bin/typescript-redux-query-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/typescript-redux-query -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript-redux-query -o samples/client/petstore/typescript-redux-query/builds/default $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/typescript-rxjs-petstore-all.sh b/bin/typescript-rxjs-petstore-all.sh deleted file mode 100755 index 2391a66637bd..000000000000 --- a/bin/typescript-rxjs-petstore-all.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -./bin/typescript-rxjs-petstore-target-es6.sh -./bin/typescript-rxjs-petstore-with-npm-version.sh -./bin/typescript-rxjs-petstore-interfaces.sh -./bin/typescript-rxjs-petstore.sh diff --git a/bin/typescript-rxjs-petstore-interfaces.sh b/bin/typescript-rxjs-petstore-interfaces.sh deleted file mode 100755 index c7b52aca5265..000000000000 --- a/bin/typescript-rxjs-petstore-interfaces.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript-rxjs -o samples/client/petstore/typescript-rxjs/builds/with-interfaces --additional-properties withInterfaces=true $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/typescript-rxjs-petstore-target-es6.json b/bin/typescript-rxjs-petstore-target-es6.json deleted file mode 100644 index f9537dc8c596..000000000000 --- a/bin/typescript-rxjs-petstore-target-es6.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "npmName": "@openapitools/typescript-rxjs-petstore", - "npmVersion": "1.0.0", - "npmRepository" : "https://skimdb.npmjs.com/registry", - "snapshot" : false, - "supportsES6": true -} diff --git a/bin/typescript-rxjs-petstore-target-es6.sh b/bin/typescript-rxjs-petstore-target-es6.sh deleted file mode 100755 index 1a5f9e1b0058..000000000000 --- a/bin/typescript-rxjs-petstore-target-es6.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript-rxjs -c bin/typescript-rxjs-petstore-target-es6.json -o samples/client/petstore/typescript-rxjs/builds/es6-target $@" - -java $JAVA_OPTS -jar $executable $ags \ No newline at end of file diff --git a/bin/typescript-rxjs-petstore-with-npm-version.json b/bin/typescript-rxjs-petstore-with-npm-version.json deleted file mode 100644 index 08ff54292bc5..000000000000 --- a/bin/typescript-rxjs-petstore-with-npm-version.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "npmName": "@openapitools/typescript-rxjs-petstore", - "npmVersion": "1.0.0", - "npmRepository" : "https://skimdb.npmjs.com/registry", - "snapshot" : false -} diff --git a/bin/typescript-rxjs-petstore-with-npm-version.sh b/bin/typescript-rxjs-petstore-with-npm-version.sh deleted file mode 100755 index 1026bbcf6515..000000000000 --- a/bin/typescript-rxjs-petstore-with-npm-version.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript-rxjs -c bin/typescript-rxjs-petstore-with-npm-version.json -o samples/client/petstore/typescript-rxjs/builds/with-npm-version $@" - -java $JAVA_OPTS -jar $executable $ags \ No newline at end of file diff --git a/bin/typescript-rxjs-petstore.sh b/bin/typescript-rxjs-petstore.sh deleted file mode 100755 index f0e7865d6504..000000000000 --- a/bin/typescript-rxjs-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript-rxjs -o samples/client/petstore/typescript-rxjs/builds/default $@" - -java $JAVA_OPTS -jar $executable $ags \ No newline at end of file diff --git a/bin/utils/ensure-up-to-date b/bin/utils/ensure-up-to-date index 3493cbbbf5b7..efe99bd76a59 100755 --- a/bin/utils/ensure-up-to-date +++ b/bin/utils/ensure-up-to-date @@ -6,88 +6,21 @@ declare cwd="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" declare root="$(cd "$cwd" && cd ../../ && pwd)" declare executable="${root}/modules/openapi-generator-cli/target/openapi-generator-cli.jar" -declare batch_mode="false" echo "# START SCRIPT: $0" echo "IMPORTANT: this script should be run by the CI (e.g. Shippable) to ensure that the 'samples/' folder is up to date." -if [ "--batch" = "$1" ]; then - batch_mode="true" - echo "Running in 'batch mode' (single JVM, mutliple threads)." -else - echo "When running locally execute with argument --batch." -fi echo "Please press CTRL+C to stop or the script will continue in 5 seconds." sleep 5 -declare -a samples=( -"${root}/bin/ruby-client-petstore.sh" -"${root}/bin/ruby-client-petstore-faraday.sh" -"${root}/bin/java-petstore-all.sh" -"${root}/bin/java-jaxrs-petstore-server-all.sh" -"${root}/bin/java-msf4j-petstore-server.sh" -"${root}/bin/openapi3/jaxrs-jersey-petstore.sh" -"${root}/bin/spring-all-petstore.sh" -"${root}/bin/javascript-petstore-all.sh" -"${root}/bin/kotlin-client-all.sh" -"${root}/bin/kotlin-server-petstore.sh" -"${root}/bin/kotlin-springboot-petstore-server.sh" -"${root}/bin/kotlin-springboot-petstore-server-reactive.sh" -"${root}/bin/mysql-schema-petstore.sh" -"${root}/bin/nim-client-petstore.sh" -"${root}/bin/python-petstore-all.sh" -"${root}/bin/python-server-all.sh" -"${root}/bin/openapi3/python-petstore.sh" -"${root}/bin/openapi3/python-experimental-petstore.sh" -#"${root}/bin/openapi3/java-petstore-jersey2-java8.sh" -"${root}/bin/php-petstore.sh" -"${root}/bin/php-silex-petstore-server.sh" -"${root}/bin/php-symfony-petstore.sh" -"${root}/bin/php-lumen-petstore-server.sh" -"${root}/bin/php-slim-server-petstore.sh" -#"${root}/bin/php-slim4-server-petstore.sh" -"${root}/bin/php-ze-ph-petstore-server.sh" -"${root}/bin/openapi3/php-petstore.sh" -"${root}/bin/typescript-angularjs-petstore.sh" -"${root}/bin/typescript-angular-petstore-all.sh" -"${root}/bin/typescript-aurelia-petstore.sh" -"${root}/bin/typescript-axios-petstore-all.sh" -"${root}/bin/typescript-fetch-petstore-all.sh" -"${root}/bin/typescript-inversify-petstore.sh" -"${root}/bin/typescript-jquery-petstore-all.sh" -"${root}/bin/typescript-node-petstore-all.sh" -"${root}/bin/typescript-rxjs-petstore-all.sh" -"${root}/bin/rust-server-petstore.sh" -"${root}/bin/r-petstore.sh" -"${root}/bin/haskell-http-client-petstore.sh" -"${root}/bin/csharp-petstore.sh" -"${root}/bin/csharp-netcore-petstore-all.sh" -"${root}/bin/elixir-petstore.sh" -"${root}/bin/openapi3/go-petstore.sh" -"${root}/bin/openapi3/go-experimental-petstore.sh" -"${root}/bin/go-experimental-petstore.sh" -"${root}/bin/go-petstore.sh" -"${root}/bin/go-petstore-withxml.sh" -"${root}/bin/go-petstore-server.sh" -"${root}/bin/go-gin-petstore-server.sh" -"${root}/bin/groovy-petstore.sh" -"${root}/bin/apex-petstore.sh" -"${root}/bin/perl-petstore-all.sh" -"${root}/bin/dart-jaguar-petstore.sh" -#"${root}/bin/dart-dio-petstore.sh" -"${root}/bin/dart-petstore.sh" -"${root}/bin/dart2-petstore.sh" -"${root}/bin/java-play-framework-petstore-server-all.sh" -"${root}/bin/openapi3/elm.sh" -"${root}/bin/typescript-redux-query-petstore-with-npm-version.sh" -"${root}/bin/cpp-restsdk-petstore.sh" -"${root}/bin/cpp-qt5-qhttpengine-server-petstore.sh" -#"${root}/bin/openapi3/powershell-experimental-petstore.sh" -"${root}/bin/scala-akka-petstore.sh" -"${root}/bin/scala-sttp-petstore.sh" -"${root}/bin/lua-petstore.sh" -) +"${root}/bin/generate-samples.sh" + +status=$? +if [ $status -ne 0 ]; then + echo "ERROR: One or more generators failed to generate. Halting ensure-up-to-date scripts." >&2 + exit $status +fi # Some special case generators may expect to be run as a stanalone process (e.g. modifying classpath) # Docs should always be run, regardless of batch or operation. @@ -98,27 +31,9 @@ declare -a always_iterate=( "${root}/bin/utils/export_generators_readme.sh" ) -export JAVA_OPTS="${JAVA_OPTS} -Djava.awt.headless=true -Dorg.slf4j.simpleLogger.defaultLogLevel=warn" -if [ "true" = "$batch_mode" ]; then - if [ ! -f "$executable" ]; then - (cd "${root}" && mvn -B --no-snapshot-updates clean package -DskipTests=true -Dmaven.javadoc.skip=true) - fi - - # shellcheck disable=SC2086 - java $JAVA_OPTS -jar "$executable" batch --includes-base-dir "${root}" --fail-fast -- "${root}"/bin/ci/* -else - for script in "${samples[@]}"; do - if eval "$script" > /dev/null 2>&1; then - echo "Executed $script successfully!" - else - echo "ERROR: Failed to run $script" - exit 1 - fi - done -fi - for i in "${always_iterate[@]}"; do - if eval "$i" > /dev/null 2>&1; then + echo "Starting $i ..." + if eval "$i"; then echo "Executed $i successfully!" else echo "ERROR: Failed to run $i" diff --git a/bin/windows/android-petstore-all.bat b/bin/windows/android-petstore-all.bat deleted file mode 100755 index 65862f5f0b2a..000000000000 --- a/bin/windows/android-petstore-all.bat +++ /dev/null @@ -1,2 +0,0 @@ -call .\bin\windows\android-petstore-volley.bat -call .\bin\windows\android-petstore-httpclient.bat diff --git a/bin/windows/android-petstore-httpclient.bat b/bin/windows/android-petstore-httpclient.bat deleted file mode 100755 index 602d885e90ea..000000000000 --- a/bin/windows/android-petstore-httpclient.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g android -o samples\client\petstore\android\httpclient --additional-properties library=httpclient - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/android-petstore-volley.bat b/bin/windows/android-petstore-volley.bat deleted file mode 100755 index c4d2e4ac988e..000000000000 --- a/bin/windows/android-petstore-volley.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g android -o samples\client\petstore\android\volley - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/android-petstore.bat b/bin/windows/android-petstore.bat deleted file mode 100755 index b2183d8459bc..000000000000 --- a/bin/windows/android-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g android -o samples\client\petstore\android\default - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/apache2-petstore-config.bat b/bin/windows/apache2-petstore-config.bat deleted file mode 100644 index 135ddabc5733..000000000000 --- a/bin/windows/apache2-petstore-config.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate -t modules\openapi-generator\src\main\resources\apache2\ -i modules\openapi-generator\src\test\resources\3_0\petstore.yaml -g apache2 -o samples\config\petstore\apache2\ - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/apex-petstore.bat b/bin/windows/apex-petstore.bat deleted file mode 100755 index fb23607cb8ce..000000000000 --- a/bin/windows/apex-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g apex -o samples\client\petstore\apex - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/asciidoc-documentation-petstore.bat b/bin/windows/asciidoc-documentation-petstore.bat deleted file mode 100644 index 476fcb2bc935..000000000000 --- a/bin/windows/asciidoc-documentation-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate --artifact-id "asciidoc-petstore-documentation" -t modules\openapi-generator\src\main\resources\asciidoc-documentation --additional-properties=specDir=modules\openapi-generator\src\main\resources\asciidoc-documentation,snippetDir=. -i modules\openapi-generator\src\test\resources\3_0\petstore.yaml -g asciidoc -o samples\documentation\asciidoc - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/aspnetcore-petstore-server.bat b/bin/windows/aspnetcore-petstore-server.bat deleted file mode 100755 index ee7f8b0f3473..000000000000 --- a/bin/windows/aspnetcore-petstore-server.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g aspnetcore -o samples\server\petstore\aspnetcore\ --additional-properties packageGuid={3C799344-F285-4669-8FD5-7ED9B795D5C5} - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/aspnetcore3-petstore-server.bat b/bin/windows/aspnetcore3-petstore-server.bat deleted file mode 100644 index 8e5e78ad4002..000000000000 --- a/bin/windows/aspnetcore3-petstore-server.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g aspnetcore -o samples\server\petstore\aspnetcore3\ --additional-properties packageGuid={3C799344-F285-4669-8FD5-7ED9B795D5C5} --additional-properties aspnetCoreVersion=3.0 - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/c-petstore.bat b/bin/windows/c-petstore.bat deleted file mode 100755 index a3928e7c404d..000000000000 --- a/bin/windows/c-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g c -o samples\client\petstore\c - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/clojure-petstore.bat b/bin/windows/clojure-petstore.bat deleted file mode 100755 index bddf851b5f39..000000000000 --- a/bin/windows/clojure-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.json -g clojure -o samples\client\petstore\clojure - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/cpp-pistache-server-petstore.bat b/bin/windows/cpp-pistache-server-petstore.bat deleted file mode 100644 index 3f9e53029b53..000000000000 --- a/bin/windows/cpp-pistache-server-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g cpp-pistache-server -o samples\server\petstore\cpp-pistache\ - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/cpp-qt5-petstore.bat b/bin/windows/cpp-qt5-petstore.bat deleted file mode 100755 index eb49309ca8da..000000000000 --- a/bin/windows/cpp-qt5-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g cpp-qt5-client -o samples\client\petstore\cpp-qt5 - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/cpp-qt5-qhttpengine-server-petstore.bat b/bin/windows/cpp-qt5-qhttpengine-server-petstore.bat deleted file mode 100644 index 3128febff60d..000000000000 --- a/bin/windows/cpp-qt5-qhttpengine-server-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g cpp-qt5-qhttpengine-server -o samples\server\petstore\cpp-qt5-qhttpengine-server - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/cpp-restbed-petstore-server.bat b/bin/windows/cpp-restbed-petstore-server.bat deleted file mode 100644 index e3a76db3f913..000000000000 --- a/bin/windows/cpp-restbed-petstore-server.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g cpp-restbed-server -o samples\server\petstore\cpp-restbed\ - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/cpp-restsdk-petstore.bat b/bin/windows/cpp-restsdk-petstore.bat deleted file mode 100755 index 074bef986684..000000000000 --- a/bin/windows/cpp-restsdk-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g cpp-restsdk -o samples\client\petstore\cpp-restsdk\client - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/cpp-tizen-petstore.bat b/bin/windows/cpp-tizen-petstore.bat deleted file mode 100755 index 969f87e6b1e6..000000000000 --- a/bin/windows/cpp-tizen-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g cpp-tizen -o samples\client\petstore\cpp-tizen - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/cpp-ue4-petstore.bat b/bin/windows/cpp-ue4-petstore.bat deleted file mode 100644 index 726c92dc1ac4..000000000000 --- a/bin/windows/cpp-ue4-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g cpp-ue4 -o samples\client\petstore\cpp-ue4 - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/csharp-dotnet2-petstore.bat b/bin/windows/csharp-dotnet2-petstore.bat deleted file mode 100755 index f5bc77332e65..000000000000 --- a/bin/windows/csharp-dotnet2-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g csharp-dotnet2 -t modules/openapi-generator/src/main/resources/csharp-dotnet2 -o samples/client/petstore/csharp-dotnet2/OpenApiClientTest/Lib/OpenApiClient --additional-properties hideGenerationTimestamp=true - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/csharp-netcore-petstore-all.bat b/bin/windows/csharp-netcore-petstore-all.bat deleted file mode 100644 index 5396937bafdf..000000000000 --- a/bin/windows/csharp-netcore-petstore-all.bat +++ /dev/null @@ -1,7 +0,0 @@ - -REM C# Petstore API client .NET Standard 2.0 -call .\bin\windows\csharp-netcore-petstore.bat - -REM C# Petstore API client .NET Core 2.0 -call .\bin\windows\csharp-netcore-petstore-netcore.bat - diff --git a/bin/windows/csharp-netcore-petstore-netcore.bat b/bin/windows/csharp-netcore-petstore-netcore.bat deleted file mode 100644 index 9130c2d8e245..000000000000 --- a/bin/windows/csharp-netcore-petstore-netcore.bat +++ /dev/null @@ -1,15 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g csharp-netcore -o samples\client\petstore\csharp-netcore\OpenAPIClientCore --additional-properties packageGuid={321C8C3F-0156-40C1-AE42-D59761FB9B6C},useCompareNetObjects=true,targetFramework=netcoreapp2.0 - -java %JAVA_OPTS% -jar %executable% %ags% - -REM restore csproj file -echo "restore csproject file: CI\samples.ci\client\petstore\csharp-netcore\OpenAPIClientCore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj" -copy /b/v/y CI\samples.ci\client\petstore\csharp-netcore\OpenAPIClientCore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj samples\client\petstore\csharp-netcore\OpenAPIClientCore\src\Org.OpenAPITools.Test\ - diff --git a/bin/windows/csharp-netcore-petstore.bat b/bin/windows/csharp-netcore-petstore.bat deleted file mode 100644 index b182ba341941..000000000000 --- a/bin/windows/csharp-netcore-petstore.bat +++ /dev/null @@ -1,15 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g csharp-netcore -o samples\client\petstore\csharp-netcore\OpenAPIClient --additional-properties packageGuid={321C8C3F-0156-40C1-AE42-D59761FB9B6C},useCompareNetObjects=true - -java %JAVA_OPTS% -jar %executable% %ags% - -REM restore csproj file -echo "restore csproject file: CI\samples.ci\client\petstore\csharp-netcore\OpenAPIClient\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj" -copy /b/v/y CI\samples.ci\client\petstore\csharp-netcore\OpenAPIClient\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj samples\client\petstore\csharp-netcore\OpenAPIClient\src\Org.OpenAPITools.Test\ - diff --git a/bin/windows/csharp-petstore-all.bat b/bin/windows/csharp-petstore-all.bat deleted file mode 100755 index 46a7bc791655..000000000000 --- a/bin/windows/csharp-petstore-all.bat +++ /dev/null @@ -1,18 +0,0 @@ -REM C# Petstore API client -call .\bin\windows\csharp-petstore.bat - -REM C# Petstore API client with PropertyChanged -call .\bin\windows\csharp-property-changed-petstore.bat - -REM C# Petstore API client (.net standarnd 1.3+) -call .\bin\windows\csharp-petstore-netstandard.bat - -call .\bin\windows\csharp-dotnet2-petstore.bat - -call .\bin\windows\csharp-petstore-netcore-project.bat - -call .\bin\windows\csharp-property-changed-petstore.bat - -call .\bin\windows\csharp-petstore-net-40.bat - -call .\bin\windows\csharp-petstore-net-35.bat diff --git a/bin/windows/csharp-petstore-net-35.bat b/bin/windows/csharp-petstore-net-35.bat deleted file mode 100644 index 555ff79cc358..000000000000 --- a/bin/windows/csharp-petstore-net-35.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g csharp -o samples/client/petstore/csharp/OpenApiClientNet35 --additional-properties packageGuid={321C8C3F-0156-40C1-AE42-D59761FB9B6C} -c ./bin/csharp-petstore-net-35.json - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/csharp-petstore-net-40.bat b/bin/windows/csharp-petstore-net-40.bat deleted file mode 100644 index 08f49c4c7669..000000000000 --- a/bin/windows/csharp-petstore-net-40.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g csharp -o samples\client\petstore\csharp\OpenApiClientNet40 --additional-properties packageGuid={321C8C3F-0156-40C1-AE42-D59761FB9B6C} -c .\bin\csharp-petstore-net-40.json - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/csharp-petstore-netcore-project.bat b/bin/windows/csharp-petstore-netcore-project.bat deleted file mode 100644 index b192df87350c..000000000000 --- a/bin/windows/csharp-petstore-netcore-project.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g csharp -o samples\client\petstore\csharp\OpenApiClientNetCoreProject --additional-properties targetFramework=netstandard1.3,packageGuid={67035b31-f8e5-41a4-9673-954035084f7d},netCoreProjectFile=true - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/csharp-petstore-netstandard.bat b/bin/windows/csharp-petstore-netstandard.bat deleted file mode 100644 index 3b058f902bcd..000000000000 --- a/bin/windows/csharp-petstore-netstandard.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g csharp -o samples\client\petstore\csharp\OpenApiClientNetStandard --additional-properties targetFramework=netstandard1.3,packageGuid={3AB1F259-1769-484B-9411-84505FCCBD55} - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/csharp-petstore.bat b/bin/windows/csharp-petstore.bat deleted file mode 100755 index f231c5848c5f..000000000000 --- a/bin/windows/csharp-petstore.bat +++ /dev/null @@ -1,15 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test/resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g csharp -o samples\client\petstore\csharp\OpenAPIClient --additional-properties packageGuid={321C8C3F-0156-40C1-AE42-D59761FB9B6C} - -java %JAVA_OPTS% -jar %executable% %ags% - -REM restore csproj file -echo "restore csproject file: CI\samples.ci\client\petstore\csharp\OpenAPIClient\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj" -copy /b/v/y CI\samples.ci\client\petstore\csharp\OpenAPIClient\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj samples\client\petstore\csharp\OpenAPIClient\src\Org.OpenAPITools.Test\ - diff --git a/bin/windows/csharp-property-changed-petstore.bat b/bin/windows/csharp-property-changed-petstore.bat deleted file mode 100644 index 48cdf749f01e..000000000000 --- a/bin/windows/csharp-property-changed-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g csharp -o samples\client\petstore\csharp\OpenApiClientWithPropertyChanged --additional-properties=generatePropertyChanged=true,optionalEmitDefaultValues=true,packageGuid={5CD900DE-8266-412F-A758-28E1F9C623D5} - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/dart-client-petstore.bat b/bin/windows/dart-client-petstore.bat deleted file mode 100755 index c7a062603f71..000000000000 --- a/bin/windows/dart-client-petstore.bat +++ /dev/null @@ -1,12 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g dart-jaguar -o samples\client\petstore\dart-jaguar\openapi --additional-properties hideGenerationTimestamp=true,browserClient=false -java %JAVA_OPTS% -jar %executable% %ags% - -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g dart-jaguar -o samples\client\petstore\dart-jaguar\flutter_petstore\openapi --additional-properties hideGenerationTimestamp=true -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/dart-dio-petstore.bat b/bin/windows/dart-dio-petstore.bat deleted file mode 100755 index 6905d6554687..000000000000 --- a/bin/windows/dart-dio-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g dart-dio -o samples\client\petstore\dart-dio --additional-properties hideGenerationTimestamp=true -java %JAVA_OPTS% -jar %executable% %ags% - diff --git a/bin/windows/dart-petstore.bat b/bin/windows/dart-petstore.bat deleted file mode 100755 index bda54a28195c..000000000000 --- a/bin/windows/dart-petstore.bat +++ /dev/null @@ -1,15 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g dart -o samples\client\petstore\dart\openapi --additional-properties hideGenerationTimestamp=true,browserClient=false -java %JAVA_OPTS% -jar %executable% %ags% - -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g dart -o samples\client\petstore\dart\openapi-browser-client --additional-properties hideGenerationTimestamp=true,browserClient=true -java %JAVA_OPTS% -jar %executable% %ags% - -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g dart -o samples\client\petstore\dart\flutter_petstore\openapi --additional-properties hideGenerationTimestamp=true,browserClient=false -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/dynamic-html-petstore.bat b/bin/windows/dynamic-html-petstore.bat deleted file mode 100755 index 885308fdb8a2..000000000000 --- a/bin/windows/dynamic-html-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate -i modules\openapi-generator\src\test\resources\3_0\petstore.yaml -g dynamic-html -o samples\client\petstore\dynamic-html - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/eiffel-petstore.bat b/bin/windows/eiffel-petstore.bat deleted file mode 100644 index 707ad13b3fad..000000000000 --- a/bin/windows/eiffel-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g eiffel -o samples\client\petstore\eiffel - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/elm-petstore.bat b/bin/windows/elm-petstore.bat deleted file mode 100755 index d881f60bba89..000000000000 --- a/bin/windows/elm-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g elm -o samples\client\petstore\elm - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/erlang-petstore-client.bat b/bin/windows/erlang-petstore-client.bat deleted file mode 100755 index 88d0c61506dd..000000000000 --- a/bin/windows/erlang-petstore-client.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -t modules\openapi-generator\src\main\resources\erlang-client -i modules\openapi-generator\src\test\resources\3_0\petstore.yaml -g erlang-client -o samples\client\petstore\erlang-client - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/erlang-petstore-server.bat b/bin/windows/erlang-petstore-server.bat deleted file mode 100755 index 9b53c9f606c1..000000000000 --- a/bin/windows/erlang-petstore-server.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -t modules\openapi-generator\src\main\resources\erlang-server -i modules\openapi-generator\src\test\resources\3_0\petstore.yaml -g erlang-server -o samples\server\petstore\erlang-server - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/flash-petstore.bat b/bin/windows/flash-petstore.bat deleted file mode 100755 index 67b04a732edc..000000000000 --- a/bin/windows/flash-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g flash -o samples\client\petstore\flash -c bin\flash-petstore.json - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/fsharp-functions-server-petstore.bat b/bin/windows/fsharp-functions-server-petstore.bat deleted file mode 100644 index 560697ffe1bf..000000000000 --- a/bin/windows/fsharp-functions-server-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate --artifact-id "fsharp-functions-petstore-server" -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g fsharp-functions -o samples\server\petstore\fsharp-functions - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/fsharp-giraffe-server-petstore.bat b/bin/windows/fsharp-giraffe-server-petstore.bat deleted file mode 100644 index 98b516e11aab..000000000000 --- a/bin/windows/fsharp-giraffe-server-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate --artifact-id "fsharp-giraffe-petstore-server" -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g fsharp-giraffe-server -o samples\server\petstore\fsharp-giraffe - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/go-experimental-petstore.bat b/bin/windows/go-experimental-petstore.bat deleted file mode 100755 index d4c7d1c23a5c..000000000000 --- a/bin/windows/go-experimental-petstore.bat +++ /dev/null @@ -1,21 +0,0 @@ -setlocal - -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -set SPEC=modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -set GENERATOR=go-experimental -set STUB_DIR=samples\client\petstore\go-experimental\go-petstore - -echo Removing files and folders under %STUB_DIR% -del /F /S /Q %STUB_DIR% - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate -t modules\openapi-generator\src\main\resources\%GENERATOR% -i %SPEC% -g %GENERATOR% -o %STUB_DIR% --additional-properties packageName=petstore - -java %JAVA_OPTS% -jar %executable% %ags% - -endlocal diff --git a/bin/windows/go-gin-petstore-server.bat b/bin/windows/go-gin-petstore-server.bat deleted file mode 100644 index 1085b4e94188..000000000000 --- a/bin/windows/go-gin-petstore-server.bat +++ /dev/null @@ -1,21 +0,0 @@ -setlocal - -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -set SPEC=modules\openapi-generator\src\test\resources\3_0\petstore.yaml -set GENERATOR=go-gin-server -set STUB_DIR=samples\server\petstore\go-gin-api-server - -echo Removing files and folders under %STUB_DIR% -del /F /S /Q %STUB_DIR%\go - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate -i %SPEC% -g %GENERATOR% -o %STUB_DIR% --additional-properties packageName=petstoreserver - -java %JAVA_OPTS% -jar %executable% %ags% - -endlocal diff --git a/bin/windows/go-petstore-server.bat b/bin/windows/go-petstore-server.bat deleted file mode 100644 index 32ab6977d2f2..000000000000 --- a/bin/windows/go-petstore-server.bat +++ /dev/null @@ -1,21 +0,0 @@ -setlocal - -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -set SPEC=modules\openapi-generator\src\test\resources\3_0\petstore.yaml -set GENERATOR=go-server -set STUB_DIR=samples\server\petstore\go-api-server - -echo Removing files and folders under %STUB_DIR% -del /F /S /Q %STUB_DIR%\go - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate -i %SPEC% -g %GENERATOR% -o %STUB_DIR% --additional-properties packageName=petstoreserver - -java %JAVA_OPTS% -jar %executable% %ags% - -endlocal diff --git a/bin/windows/go-petstore-withxml.bat b/bin/windows/go-petstore-withxml.bat deleted file mode 100644 index e24f3798f8f9..000000000000 --- a/bin/windows/go-petstore-withxml.bat +++ /dev/null @@ -1,21 +0,0 @@ -setlocal - -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -set SPEC=modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -set GENERATOR=go -set STUB_DIR=samples\client\petstore\go\go-petstore-withXml - -echo Removing files and folders under %STUB_DIR% -del /F /S /Q %STUB_DIR% - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate -t modules\openapi-generator\src\main\resources\go -i %SPEC% -g %GENERATOR% -o %STUB_DIR% --additional-properties packageName=petstore,withXml=true - -java %JAVA_OPTS% -jar %executable% %ags% - -endlocal \ No newline at end of file diff --git a/bin/windows/go-petstore.bat b/bin/windows/go-petstore.bat deleted file mode 100755 index 8f00f7070a17..000000000000 --- a/bin/windows/go-petstore.bat +++ /dev/null @@ -1,21 +0,0 @@ -setlocal - -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -set SPEC=modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -set GENERATOR=go -set STUB_DIR=samples\client\petstore\go\go-petstore - -echo Removing files and folders under %STUB_DIR% -del /F /S /Q %STUB_DIR% - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate -t modules\openapi-generator\src\main\resources\go -i %SPEC% -g %GENERATOR% -o %STUB_DIR% --additional-properties packageName=petstore - -java %JAVA_OPTS% -jar %executable% %ags% - -endlocal \ No newline at end of file diff --git a/bin/windows/graphql-nodejs-express-petstore-server.bat b/bin/windows/graphql-nodejs-express-petstore-server.bat deleted file mode 100755 index 1cb7b3a8e735..000000000000 --- a/bin/windows/graphql-nodejs-express-petstore-server.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -t modules\openapi-generator\src\main\resources\graphql-nodejs-express-server -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g graphql-nodejs-express-server -o samples\server\petstore\graphql-nodejs-express-server - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/graphql-schema-petstore.bat b/bin/windows/graphql-schema-petstore.bat deleted file mode 100755 index ad9d5c5fde94..000000000000 --- a/bin/windows/graphql-schema-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -t modules\openapi-generator\src\main\resources\graphql-schema -i modules\openapi-generator\src\test\resources\3_0\petstore.yaml -g graphql-schema -o samples\config\petstore\graphql-schema - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/groovy-petstore.bat b/bin/windows/groovy-petstore.bat deleted file mode 100644 index 67be72e61342..000000000000 --- a/bin/windows/groovy-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate --artifact-id "groovy-petstore-client" -i modules\openapi-generator\src\test\resources\3_0\petstore.yaml -g groovy -o samples\client\petstore\nim - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/haskell-http-client-petstore.bat b/bin/windows/haskell-http-client-petstore.bat deleted file mode 100755 index 5bce7b5e8c03..000000000000 --- a/bin/windows/haskell-http-client-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g haskell-http-client -o samples\client\petstore\haskell-http-client - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/html-petstore.bat b/bin/windows/html-petstore.bat deleted file mode 100755 index c6720eb10b8f..000000000000 --- a/bin/windows/html-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate -i modules\openapi-generator\src\test\resources\3_0\petstore.yaml -g html -o samples\documentation\html - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/html2-petstore.bat b/bin/windows/html2-petstore.bat deleted file mode 100644 index bc278013c6e9..000000000000 --- a/bin/windows/html2-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate -i modules\openapi-generator\src\test\resources\3_0\petstore.yaml -g html2 -o samples\documentation\html2 - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/java-petstore-all.bat b/bin/windows/java-petstore-all.bat deleted file mode 100644 index bb661a9fa1c1..000000000000 --- a/bin/windows/java-petstore-all.bat +++ /dev/null @@ -1,20 +0,0 @@ -call .\bin\windows\java-petstore-feign-10x.bat -call .\bin\windows\java-petstore-google-api-client.bat -call .\bin\windows\java-petstore-jersey1.bat -call .\bin\windows\java-petstore-jersey2-java8.bat -call .\bin\windows\java-petstore-native.bat -call .\bin\windows\java-petstore-okhttp-gson-parcelable.bat -call .\bin\windows\java-petstore-okhttp-gson.bat -call .\bin\windows\java-petstore-rest-assured.bat -call .\bin\windows\java-petstore-rest-assured-jackson.bat -call .\bin\windows\java-petstore-resteasy.bat -call .\bin\windows\java-petstore-resttemplate-withxml.bat -call .\bin\windows\java-petstore-resttemplate.bat -call .\bin\windows\java-petstore-retrofit2-play24.bat -call .\bin\windows\java-petstore-retrofit2-play25.bat -call .\bin\windows\java-petstore-retrofit2-play26.bat -call .\bin\windows\java-petstore-retrofit2.bat -call .\bin\windows\java-petstore-retrofit2rx.bat -call .\bin\windows\java-petstore-retrofit2rx2.bat -call .\bin\windows\java-petstore-vertx.bat -call .\bin\windows\java-petstore-webclient.bat diff --git a/bin/windows/java-petstore-feign-10x.bat b/bin/windows/java-petstore-feign-10x.bat deleted file mode 100644 index 68fda6d02362..000000000000 --- a/bin/windows/java-petstore-feign-10x.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -t modules\openapi-generator\src\main\resources\Java -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin\java-petstore-feign-10x.json -o samples\client\petstore\java\feign10x --additional-properties hideGenerationTimestamp=true,booleanGetterPrefix=is - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/java-petstore-google-api-client.bat b/bin/windows/java-petstore-google-api-client.bat deleted file mode 100644 index ae005af5c94e..000000000000 --- a/bin/windows/java-petstore-google-api-client.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -t modules\openapi-generator\src\main\resources\Java -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin\java-petstore-google-api-client.json -o samples\client\petstore\java\google-api-client --additional-properties hideGenerationTimestamp=true - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/java-petstore-jersey1.bat b/bin/windows/java-petstore-jersey1.bat deleted file mode 100644 index b862cb16d9f5..000000000000 --- a/bin/windows/java-petstore-jersey1.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate --artifact-id petstore-java-client-jersey1 -t modules\openapi-generator\src\main\resources\Java -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g java -o samples\client\petstore\java\jersey1 --additional-properties hideGenerationTimestamp=true --library=jersey1 - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/java-petstore-jersey2-java8.bat b/bin/windows/java-petstore-jersey2-java8.bat deleted file mode 100644 index 5880a6554f30..000000000000 --- a/bin/windows/java-petstore-jersey2-java8.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin\java-petstore-jersey2-java8.json -o samples\client\petstore\java\jersey2-java8 --additional-properties hideGenerationTimestamp=true - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/java-petstore-microprofile.bat b/bin/windows/java-petstore-microprofile.bat deleted file mode 100755 index 4367768ea1b9..000000000000 --- a/bin/windows/java-petstore-microprofile.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate --artifact-id "microprofile-rest-client" -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g java --library microprofile -o samples\client\petstore\java\microprofile-rest-client - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/java-petstore-native.bat b/bin/windows/java-petstore-native.bat deleted file mode 100644 index 8980399c8156..000000000000 --- a/bin/windows/java-petstore-native.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -t modules\openapi-generator\src\main\resources\Java -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin\java-petstore-native.json -o samples\client\petstore\java\native --additional-properties hideGenerationTimestamp=true - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/java-petstore-okhttp-gson-parcelable.bat b/bin/windows/java-petstore-okhttp-gson-parcelable.bat deleted file mode 100644 index fb88907214eb..000000000000 --- a/bin/windows/java-petstore-okhttp-gson-parcelable.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate --artifact-id petstore-okhttp-gson-parcelableModel -t modules\openapi-generator\src\main\resources\Java -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin\java-petstore-okhttp-gson.json -o samples\client\petstore\java\okhttp-gson-parcelableModel --additional-properties hideGenerationTimestamp=true,parcelableModel=true - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/java-petstore-okhttp-gson.bat b/bin/windows/java-petstore-okhttp-gson.bat deleted file mode 100755 index 0965f6a6ae50..000000000000 --- a/bin/windows/java-petstore-okhttp-gson.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -t modules\openapi-generator\src\main\resources\Java -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin\java-petstore-okhttp-gson.json -o samples\client\petstore\java\okhttp-gson --additional-properties hideGenerationTimestamp=true - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/java-petstore-rest-assured-jackson.bat b/bin/windows/java-petstore-rest-assured-jackson.bat deleted file mode 100644 index 070156e2f4e1..000000000000 --- a/bin/windows/java-petstore-rest-assured-jackson.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -t modules\openapi-generator\src\main\resources\Java -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin\java-petstore-rest-assured-jackson.json -o samples\client\petstore\java\rest-assured-jackson --additional-properties hideGenerationTimestamp=true,booleanGetterPrefix=is,java8=true,dateLibrary=java8,serializationLibrary=jackson,useBeanValidation=true,performBeanValidation=true, - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/java-petstore-rest-assured.bat b/bin/windows/java-petstore-rest-assured.bat deleted file mode 100644 index d83f8c428987..000000000000 --- a/bin/windows/java-petstore-rest-assured.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -t modules\openapi-generator\src\main\resources\Java -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin\java-petstore-rest-assured.json -o samples\client\petstore\java\rest-assured --additional-properties hideGenerationTimestamp=true --additional-properties useBeanValidation=true --additional-properties performBeanValidation=true --additional-properties booleanGetterPrefix=is - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/java-petstore-resttemplate-resteasy.bat b/bin/windows/java-petstore-resttemplate-resteasy.bat deleted file mode 100644 index 9cf81f4e1098..000000000000 --- a/bin/windows/java-petstore-resttemplate-resteasy.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin\java-petstore-resteasy.json -o samples\client\petstore\java\resteasy --additional-properties hideGenerationTimestamp=true - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/java-petstore-resttemplate-webclient.bat b/bin/windows/java-petstore-resttemplate-webclient.bat deleted file mode 100644 index 3330fc590abc..000000000000 --- a/bin/windows/java-petstore-resttemplate-webclient.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin\java-petstore-webclient.json -o samples\client\petstore\java\webclient --additional-properties hideGenerationTimestamp=true - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/java-petstore-resttemplate-withxml.bat b/bin/windows/java-petstore-resttemplate-withxml.bat deleted file mode 100644 index ee67b4cd43f5..000000000000 --- a/bin/windows/java-petstore-resttemplate-withxml.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate --artifact-id petstore-resttemplate-withxml -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin\java-petstore-resttemplate.json -o samples\client\petstore\java\resttemplate-withXml --additional-properties hideGenerationTimestamp=true,withXml=true - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/java-petstore-resttemplate.bat b/bin/windows/java-petstore-resttemplate.bat deleted file mode 100644 index 50de951c1293..000000000000 --- a/bin/windows/java-petstore-resttemplate.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin\java-petstore-resttemplate.json -o samples\client\petstore\java\resttemplate --additional-properties hideGenerationTimestamp=true - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/java-petstore-retrofit2-all.bat b/bin/windows/java-petstore-retrofit2-all.bat deleted file mode 100644 index bb6d0dee4dae..000000000000 --- a/bin/windows/java-petstore-retrofit2-all.bat +++ /dev/null @@ -1,6 +0,0 @@ -call .\bin\windows\java-petstore-retrofit2-play24.bat -call .\bin\windows\java-petstore-retrofit2-play25.bat -call .\bin\windows\java-petstore-retrofit2-play26.bat -call .\bin\windows\java-petstore-retrofit2.bat -call .\bin\windows\java-petstore-retrofit2rx.bat -call .\bin\windows\java-petstore-retrofit2rx2.bat diff --git a/bin/windows/java-petstore-retrofit2-play24.bat b/bin/windows/java-petstore-retrofit2-play24.bat deleted file mode 100644 index bfb57e1bb6f6..000000000000 --- a/bin/windows/java-petstore-retrofit2-play24.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate --artifact-id petstore-java-client-retrofit2-play24 -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin\java-petstore-retrofit2-play24.json -o samples\client\petstore\java\retrofit2-play24 --additional-properties hideGenerationTimestamp=true - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/java-petstore-retrofit2-play25.bat b/bin/windows/java-petstore-retrofit2-play25.bat deleted file mode 100644 index d76bb00e1ea0..000000000000 --- a/bin/windows/java-petstore-retrofit2-play25.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate --artifact-id petstore-java-client-retrofit2-play25 -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin\java-petstore-retrofit2-play25.json -o samples\client\petstore\java\retrofit2-play25 --additional-properties hideGenerationTimestamp=true - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/java-petstore-retrofit2-play26.bat b/bin/windows/java-petstore-retrofit2-play26.bat deleted file mode 100644 index 2e740ac67d75..000000000000 --- a/bin/windows/java-petstore-retrofit2-play26.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate --artifact-id petstore-java-client-retrofit2-play26 -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin\java-petstore-retrofit2-play26.json -o samples\client\petstore\java\retrofit2-play26 --additional-properties hideGenerationTimestamp=true - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/java-petstore-retrofit2.bat b/bin/windows/java-petstore-retrofit2.bat deleted file mode 100644 index c21b2941a5f2..000000000000 --- a/bin/windows/java-petstore-retrofit2.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -t modules\openapi-generator\src\main\resources\Java -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin\java-petstore-retrofit2.json -o samples\client\petstore\java\retrofit2 --additional-properties hideGenerationTimestamp=true - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/java-petstore-retrofit2rx.bat b/bin/windows/java-petstore-retrofit2rx.bat deleted file mode 100644 index c62e07cf07f6..000000000000 --- a/bin/windows/java-petstore-retrofit2rx.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -t modules\openapi-generator\src\main\resources\Java -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin\java-petstore-retrofit2rx.json -o samples\client\petstore\java\retrofit2rx --additional-properties useRxJava=true,hideGenerationTimestamp=true - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/java-petstore-retrofit2rx2.bat b/bin/windows/java-petstore-retrofit2rx2.bat deleted file mode 100644 index a9521ef27c31..000000000000 --- a/bin/windows/java-petstore-retrofit2rx2.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -t modules\openapi-generator\src\main\resources\Java -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin\java-petstore-retrofit2rx2.json -o samples\client\petstore\java\retrofit2rx2 --additional-properties useRxJava2=true,hideGenerationTimestamp=true - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/java-petstore-vertx.bat b/bin/windows/java-petstore-vertx.bat deleted file mode 100644 index 133b8eb71734..000000000000 --- a/bin/windows/java-petstore-vertx.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -t modules\openapi-generator\src\main\resources\Java -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin\java-petstore-vertx.json -o samples\client\petstore\java\vertx --additional-properties hideGenerationTimestamp=true - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/java-petstore-webclient.bat b/bin/windows/java-petstore-webclient.bat deleted file mode 100644 index 17fb94b012a2..000000000000 --- a/bin/windows/java-petstore-webclient.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-webclient.json -o samples/client/petstore/java/webclient --additional-properties hideGenerationTimestamp=true - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/java-pkmst-petstore-server.bat b/bin/windows/java-pkmst-petstore-server.bat deleted file mode 100644 index ace44650ed40..000000000000 --- a/bin/windows/java-pkmst-petstore-server.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g java-pkmst -o samples\server\petstore\java-pkmst --additional-properties hideGenerationTimestamp=true - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/java-play-framework-petstore-server.bat b/bin/windows/java-play-framework-petstore-server.bat deleted file mode 100644 index 887fdd257097..000000000000 --- a/bin/windows/java-play-framework-petstore-server.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g java-play-framework -o samples\server\petstore\java-play-framework --additional-properties hideGenerationTimestamp=true - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/java-vertx-async-petstore-server.bat b/bin/windows/java-vertx-async-petstore-server.bat deleted file mode 100644 index 5200b705a5df..000000000000 --- a/bin/windows/java-vertx-async-petstore-server.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g java-vertx -o samples\server\petstore\java-vertx\async --additional-properties vertxSwaggerRouterVersion=1.2.0,hideGenerationTimestamp=true - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/java-vertx-rx-petstore-server.bat b/bin/windows/java-vertx-rx-petstore-server.bat deleted file mode 100644 index b107bd837e3e..000000000000 --- a/bin/windows/java-vertx-rx-petstore-server.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g java-vertx -o samples\server\petstore\java-vertx\rx --additional-properties vertxSwaggerRouterVersion=1.2.0,rxInterface=true - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/javascript-apollo-petstore.bat b/bin/windows/javascript-apollo-petstore.bat deleted file mode 100755 index 144ada50e46a..000000000000 --- a/bin/windows/javascript-apollo-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g javascript-apollo -o samples\client\petstore\javascript-apollo --additional-properties appName=PetstoreClient - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/javascript-es6-petstore.bat b/bin/windows/javascript-es6-petstore.bat deleted file mode 100644 index d7ef07a8400e..000000000000 --- a/bin/windows/javascript-es6-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\3_0\petstore-with-fake-endpoints-models-for-testing.yaml -g javascript -o samples\client\petstore\javascript-es6 - -java %JAVA_OPTS% -jar %executable% %ags% --additional-properties appName=PetstoreClient diff --git a/bin/windows/javascript-petstore-all.bat b/bin/windows/javascript-petstore-all.bat deleted file mode 100755 index 0775478ae9ec..000000000000 --- a/bin/windows/javascript-petstore-all.bat +++ /dev/null @@ -1,2 +0,0 @@ -call .\bin\windows\javascript-es6-petstore.bat -call .\bin\windows\javascript-promise-es6-petstore.bat diff --git a/bin/windows/javascript-promise-es6-petstore.bat b/bin/windows/javascript-promise-es6-petstore.bat deleted file mode 100644 index 86f71f55ce5d..000000000000 --- a/bin/windows/javascript-promise-es6-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\3_0\petstore-with-fake-endpoints-models-for-testing.yaml -g javascript -o samples\client\petstore\javascript-promise-es6 --additional-properties appName=PetstoreClient,usePromises=true - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/javascript-promise-petstore.bat b/bin/windows/javascript-promise-petstore.bat deleted file mode 100755 index 57756146e652..000000000000 --- a/bin/windows/javascript-promise-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g javascript -o samples\client\petstore\javascript-promise --additional-properties usePromises=true,useES6=false,appName=PetstoreClient - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/jaxrs-cxf-cdi-petstore-server.bat b/bin/windows/jaxrs-cxf-cdi-petstore-server.bat deleted file mode 100644 index 48aadc36fec3..000000000000 --- a/bin/windows/jaxrs-cxf-cdi-petstore-server.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf\log4j.properties -set ags=generate -t modules\openapi-generator\src\main\resources\JavaJaxRS\cxf-cdi -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g jaxrs-cxf-cdi -o samples\server\petstore\jaxrs-cxf-cdi --additional-properties hideGenerationTimestamp=true %* - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/jaxrs-cxf-client-petstore.bat b/bin/windows/jaxrs-cxf-client-petstore.bat deleted file mode 100755 index 2fb0ad0a8277..000000000000 --- a/bin/windows/jaxrs-cxf-client-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate --artifact-id "jaxrs-cxf-client-petstore-client" -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g jaxrs-cxf-client -o samples\client\petstore\jaxrs-cxf-client %* - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/jaxrs-cxf-petstore-server-annotated-base-path.bat b/bin/windows/jaxrs-cxf-petstore-server-annotated-base-path.bat deleted file mode 100644 index 6df7234a2397..000000000000 --- a/bin/windows/jaxrs-cxf-petstore-server-annotated-base-path.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate --artifact-id cxf-annotated-basepath -t modules\openapi-generator\src\main\resources\JavaJaxRS\cxf -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g jaxrs-cxf -o samples\server\petstore\jaxrs-cxf-annotated-base-path --additional-properties hideGenerationTimestamp=true,useAnnotatedBasePath=true,serverPort=8082 %* - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/jaxrs-cxf-petstore-server-non-spring-application.bat b/bin/windows/jaxrs-cxf-petstore-server-non-spring-application.bat deleted file mode 100644 index b239011963bf..000000000000 --- a/bin/windows/jaxrs-cxf-petstore-server-non-spring-application.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate --artifact-id cxf-server-non-spring -t modules\openapi-generator\src\main\resources\JavaJaxRS\cxf -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g jaxrs-cxf -o samples\server\petstore\jaxrs-cxf-non-spring-app --additional-properties hideGenerationTimestamp=true,generateNonSpringApplication=true,serverPort=8082 %* - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/jaxrs-cxf-petstore-server-test-data.bat b/bin/windows/jaxrs-cxf-petstore-server-test-data.bat deleted file mode 100644 index ac42b6c04741..000000000000 --- a/bin/windows/jaxrs-cxf-petstore-server-test-data.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate --artifact-id cxf-test-data -t modules\openapi-generator\src\main\resources\JavaJaxRS\cxf-ext -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g jaxrs-cxf-extended -o samples\server\petstore\jaxrs-cxf-test-data --additional-properties hideGenerationTimestamp=true,useAnnotatedBasePath=true --generate-alias-as-model --additional-properties java8=true,generateSpringApplication=true,generateSpringBootApplication=true,generateOperationBody=true,loadTestDataFromFile=true %* - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/jaxrs-cxf-petstore-server.bat b/bin/windows/jaxrs-cxf-petstore-server.bat deleted file mode 100644 index 82880f59590f..000000000000 --- a/bin/windows/jaxrs-cxf-petstore-server.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate -t modules\openapi-generator\src\main\resources\JavaJaxRS\cxf -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g jaxrs-cxf -o samples\server\petstore\jaxrs-cxf --additional-properties hideGenerationTimestamp=true %* - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/jaxrs-spec-petstore-server-interface.bat b/bin/windows/jaxrs-spec-petstore-server-interface.bat deleted file mode 100644 index 41c29d41cc4b..000000000000 --- a/bin/windows/jaxrs-spec-petstore-server-interface.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate --artifact-id "jaxrs-cxf-client-petstore-client" -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g jaxrs-spec -o samples\server\petstore\jaxrs-spec-interface --additional-properties hideGenerationTimestamp=true,serializableModel=true,interfaceOnly=true - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/jaxrs-spec-petstore-server.bat b/bin/windows/jaxrs-spec-petstore-server.bat deleted file mode 100644 index eeb11da17fa8..000000000000 --- a/bin/windows/jaxrs-spec-petstore-server.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate --artifact-id "jaxrs-cxf-client-petstore-client" -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g jaxrs-spec -o samples\server\petstore\jaxrs-spec --additional-properties hideGenerationTimestamp=true,serializableModel=true - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/k6-petstore.bat b/bin/windows/k6-petstore.bat deleted file mode 100755 index 098a050214ee..000000000000 --- a/bin/windows/k6-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g k6 -o samples\client\petstore\k6 - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/kotlin-client-all.bat b/bin/windows/kotlin-client-all.bat deleted file mode 100644 index d4dd27a9f642..000000000000 --- a/bin/windows/kotlin-client-all.bat +++ /dev/null @@ -1,11 +0,0 @@ -call powershell -command "& '%~dp0\kotlin-client-gson.bat'" -call powershell -command "& '%~dp0\kotlin-client-moshi-codegen.bat'" -call powershell -command "& '%~dp0\kotlin-client-nonpublic.bat'" -call powershell -command "& '%~dp0\kotlin-client-okhttp3.bat'" -call powershell -command "& '%~dp0\kotlin-client-petstore-multiplatform.bat'" -call powershell -command "& '%~dp0\kotlin-client-petstore.bat'" -call powershell -command "& '%~dp0\kotlin-client-string.bat'" -call powershell -command "& '%~dp0\kotlin-client-threetenbp.bat'" -call powershell -command "& '%~dp0\kotlin-client-nullable.bat'" -call powershell -command "& '%~dp0\kotlin-client-json-request-string.bat'" -call powershell -command "& '%~dp0\kotlin-client-retrofit2.bat'" \ No newline at end of file diff --git a/bin/windows/kotlin-client-gson.bat b/bin/windows/kotlin-client-gson.bat deleted file mode 100644 index 30eeaf423f7d..000000000000 --- a/bin/windows/kotlin-client-gson.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate --artifact-id "kotlin-petstore-gson" -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g kotlin --additional-properties serializationLibrary=gson -o samples\client\petstore\kotlin-gson - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/kotlin-client-json-request-string.bat b/bin/windows/kotlin-client-json-request-string.bat deleted file mode 100644 index 1b257af02027..000000000000 --- a/bin/windows/kotlin-client-json-request-string.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate --artifact-id "kotlin-petstore-json-request-string" -i modules\openapi-generator\src\test\resources\2_0\petstore-with-date-field.yaml -g kotlin --additional-properties requestDateConverter=toString -o samples\client\petstore\kotlin-json-request-string - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/kotlin-client-moshi-codegen.bat b/bin/windows/kotlin-client-moshi-codegen.bat deleted file mode 100644 index 5a2ff14ac755..000000000000 --- a/bin/windows/kotlin-client-moshi-codegen.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate --artifact-id "kotlin-petstore-moshi-codegen" -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g kotlin --additional-properties serializationLibrary=moshi,moshiCodeGen=true -o samples\client\petstore\kotlin-moshi-codegen - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/kotlin-client-nonpublic.bat b/bin/windows/kotlin-client-nonpublic.bat deleted file mode 100644 index 899d4318060d..000000000000 --- a/bin/windows/kotlin-client-nonpublic.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate --artifact-id "kotlin-petstore-nonpublic" -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g kotlin --additional-properties nonPublicApi=true -o samples\client\petstore\kotlin-nonpublic - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/kotlin-client-nullable.bat b/bin/windows/kotlin-client-nullable.bat deleted file mode 100644 index cdbfa49839c2..000000000000 --- a/bin/windows/kotlin-client-nullable.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g kotlin --artifact-id "kotlin-petstore-nullable" --additional-properties nullableReturnType=true,serializableModel=true -o samples\client\petstore\kotlin-nullable - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/kotlin-client-okhttp3.bat b/bin/windows/kotlin-client-okhttp3.bat deleted file mode 100644 index 8c16e37fe057..000000000000 --- a/bin/windows/kotlin-client-okhttp3.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate --artifact-id "kotlin-petstore-okhttp3" -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g kotlin --library jvm-okhttp3 -o samples\client\petstore\kotlin-okhttp3 - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/kotlin-client-petstore-multiplatform.bat b/bin/windows/kotlin-client-petstore-multiplatform.bat deleted file mode 100644 index 628170d6007b..000000000000 --- a/bin/windows/kotlin-client-petstore-multiplatform.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate --artifact-id "kotlin-client-petstore-multiplatform" -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g kotlin --library multiplatform -o samples\client\petstore\kotlin-multiplatform - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/kotlin-client-petstore.bat b/bin/windows/kotlin-client-petstore.bat deleted file mode 100644 index a193d7c6a3e1..000000000000 --- a/bin/windows/kotlin-client-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate --artifact-id "kotlin-petstore-client" -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g kotlin -o samples\client\petstore\kotlin --additional-properties dateLibrary=java8,serializableModel=true - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/kotlin-client-retrofit2.bat b/bin/windows/kotlin-client-retrofit2.bat deleted file mode 100644 index 123c8c28dc89..000000000000 --- a/bin/windows/kotlin-client-retrofit2.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate --artifact-id "kotlin-petstore-retrofit2" -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g kotlin --library jvm-retrofit2 -o samples\client\petstore\kotlin-retrofit2 - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/kotlin-client-string.bat b/bin/windows/kotlin-client-string.bat deleted file mode 100644 index 6e0310ecadf1..000000000000 --- a/bin/windows/kotlin-client-string.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g kotlin --artifact-id "kotlin-petstore-string" --additional-properties dateLibrary=string,serializableModel=true,sortParamsByRequiredFlag=false,sortModelPropertiesByRequiredFlag=false -o samples\client\petstore\kotlin-string - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/kotlin-client-threetenbp.bat b/bin/windows/kotlin-client-threetenbp.bat deleted file mode 100644 index adc5c68e01a5..000000000000 --- a/bin/windows/kotlin-client-threetenbp.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g kotlin --artifact-id "kotlin-petstore-threetenbp" --additional-properties dateLibrary=threetenbp -o samples\client\petstore\kotlin-threetenbp - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/kotlin-server-petstore.bat b/bin/windows/kotlin-server-petstore.bat deleted file mode 100644 index 7ed79a0448be..000000000000 --- a/bin/windows/kotlin-server-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate --artifact-id "kotlin-petstore-server" -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g kotlin-server --library=ktor -o samples\server\petstore\kotlin - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/kotlin-springboot-petstore-server.bat b/bin/windows/kotlin-springboot-petstore-server.bat deleted file mode 100644 index 4133a780d4a4..000000000000 --- a/bin/windows/kotlin-springboot-petstore-server.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g kotlin-spring -o samples\server\petstore\kotlin-springboot --additional-properties=library=spring-boot,beanValidations=true,swaggerAnnotations=true,serviceImplementation=true - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/kotlin-vertx-server-petstore.bat b/bin/windows/kotlin-vertx-server-petstore.bat deleted file mode 100644 index 6fd12f43d82c..000000000000 --- a/bin/windows/kotlin-vertx-server-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate --artifact-id "kotlin-vertx-petstore-server" -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g kotlin-vertx -o samples\server\petstore\kotlin\vertx - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/lua-petstore.bat b/bin/windows/lua-petstore.bat deleted file mode 100755 index fe06bd229a56..000000000000 --- a/bin/windows/lua-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate -i modules\openapi-generator\src\test\resources\3_0\petstore.yaml -g lua -o samples\client\petstore\lua - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/markdown-documentation-petstore.bat b/bin/windows/markdown-documentation-petstore.bat deleted file mode 100644 index 716ddb8fc462..000000000000 --- a/bin/windows/markdown-documentation-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate --artifact-id "markdown-petstore-documentation" -i modules\openapi-generator\src\test\resources\3_0\petstore.yaml -g markdown -o samples\documentation\petstore\markdown - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/mysql-schema-petstore.bat b/bin/windows/mysql-schema-petstore.bat deleted file mode 100755 index 7590d2c0a7e9..000000000000 --- a/bin/windows/mysql-schema-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\3_0\petstore-with-fake-endpoints-models-for-testing.yaml -g mysql-schema -o samples\schema\petstore\mysql - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/nancyfx-petstore-server.bat b/bin/windows/nancyfx-petstore-server.bat deleted file mode 100644 index 49460ca6c4d1..000000000000 --- a/bin/windows/nancyfx-petstore-server.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g csharp-nancyfx -o samples\server\petstore\nancyfx\ - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/nim-client-petstore.bat b/bin/windows/nim-client-petstore.bat deleted file mode 100644 index 875bff9fe8b8..000000000000 --- a/bin/windows/nim-client-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate --artifact-id "nim-petstore-client" -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml --additional-properties packageName=petstore -g nim -o samples\client\petstore\nim - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/objc-petstore.bat b/bin/windows/objc-petstore.bat deleted file mode 100755 index d5264e33c376..000000000000 --- a/bin/windows/objc-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g objc -o samples\client\petstore\objc\default --additional-properties appName=PetstoreClient - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/ocaml-petstore.bat b/bin/windows/ocaml-petstore.bat deleted file mode 100755 index 09c04a830160..000000000000 --- a/bin/windows/ocaml-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate -i modules\openapi-generator\src\test\resources\3_0\petstore.yaml -g ocaml -o samples\client\petstore\ocaml - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/perl-petstore.bat b/bin/windows/perl-petstore.bat deleted file mode 100755 index ce307bfee517..000000000000 --- a/bin/windows/perl-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g perl -o samples\client\petstore\perl - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/php-lumen-petstore-server.bat b/bin/windows/php-lumen-petstore-server.bat deleted file mode 100644 index d5aa42ba790a..000000000000 --- a/bin/windows/php-lumen-petstore-server.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g php-lumen -o samples\server\petstore\php-lumen - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/php-petstore.bat b/bin/windows/php-petstore.bat deleted file mode 100755 index ba088beade26..000000000000 --- a/bin/windows/php-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g php -o samples\client\petstore\php\OpenAPIClient-php - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/php-silex-petstore-server.bat b/bin/windows/php-silex-petstore-server.bat deleted file mode 100644 index fcacba12e37b..000000000000 --- a/bin/windows/php-silex-petstore-server.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g php-silex-deprecated -o samples\server\petstore\php-silex\OpenAPIServer - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/php-slim-server-petstore.bat b/bin/windows/php-slim-server-petstore.bat deleted file mode 100755 index 4e896f0184e1..000000000000 --- a/bin/windows/php-slim-server-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g php-slim-deprecated -o samples\server\petstore\php-slim - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/php-slim4-server-petstore.bat b/bin/windows/php-slim4-server-petstore.bat deleted file mode 100644 index c1ac0ef7325d..000000000000 --- a/bin/windows/php-slim4-server-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g php-slim4 -o samples\server\petstore\php-slim4 - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/php-symfony-petstore-server.bat b/bin/windows/php-symfony-petstore-server.bat deleted file mode 100644 index 5a7ce4f2184d..000000000000 --- a/bin/windows/php-symfony-petstore-server.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g php-symfony -o samples\server\petstore\php-symfony\SymfonyBundle-php - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/php-ze-ph-petstore-server.bat b/bin/windows/php-ze-ph-petstore-server.bat deleted file mode 100644 index da5eacc3639a..000000000000 --- a/bin/windows/php-ze-ph-petstore-server.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g php-ze-ph -o samples\server\petstore\php-ze-ph - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/plantuml-documentation-petstore.bat b/bin/windows/plantuml-documentation-petstore.bat deleted file mode 100644 index 4a0f9d611f25..000000000000 --- a/bin/windows/plantuml-documentation-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate -t modules\openapi-generator\src\main\resources\plantuml -i modules\openapi-generator\src\test\resources\3_0\petstore.yaml -g plantuml -o samples\documentation\petstore\plantuml - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/powershell-petstore.bat b/bin/windows/powershell-petstore.bat deleted file mode 100755 index f5ea2c5f9107..000000000000 --- a/bin/windows/powershell-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate -i modules\openapi-generator\src\test\resources\3_0\petstore.yaml -g powershell -o samples\client\petstorep\powershell --additional-properties powershellGalleryUrl=https://www.powershellgallery.com/packages/PSPetstore,packageGuid=a27b908d-2a20-467f-bc32-af6f3a654ac5,packageName=PSPetstore,apiNamePrefix=PS,packageVersion=0.1.2,commonVerbs=Delete=Remove:Patch=Update - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/protobuf-schema-petstore.bat b/bin/windows/protobuf-schema-petstore.bat deleted file mode 100755 index 089b714681e8..000000000000 --- a/bin/windows/protobuf-schema-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -t modules\openapi-generator\src\main\resources\protobuf-schema -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g protobuf-schema -o samples\config\petstore\protobuf-schema - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/python-experimental-petstore.bat b/bin/windows/python-experimental-petstore.bat deleted file mode 100644 index 2680649d00fd..000000000000 --- a/bin/windows/python-experimental-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\python-client-experimental\petstore-with-fake-endpoints-models-for-testing.yaml -g python-experimental -o samples\client\petstore\python-experimental --additional-properties packageName=petstore_api - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/python-petstore.bat b/bin/windows/python-petstore.bat deleted file mode 100755 index c09fd3a44b06..000000000000 --- a/bin/windows/python-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g python -o samples\client\petstore\python --additional-properties packageName=petstore_api - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/python2-flask-petstore.bat b/bin/windows/python2-flask-petstore.bat deleted file mode 100755 index 54189a7d1934..000000000000 --- a/bin/windows/python2-flask-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g python-flask -o samples\server\petstore\python-flask-python2 -c bin\supportPython2.json - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/python3-flask-petstore.bat b/bin/windows/python3-flask-petstore.bat deleted file mode 100755 index 56205cf151a9..000000000000 --- a/bin/windows/python3-flask-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g python-flask -o samples\server\petstore\python-flask - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/r-petstore.bat b/bin/windows/r-petstore.bat deleted file mode 100755 index b1799427f040..000000000000 --- a/bin/windows/r-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g r -o samples\client\petstore\R --additional-properties packageName=petstore,returnExceptionOnFailure=false,exceptionPackage=default - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/rails5-petstore-server.bat b/bin/windows/rails5-petstore-server.bat deleted file mode 100755 index 4f142b59c6a9..000000000000 --- a/bin/windows/rails5-petstore-server.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g ruby-on-rails -o samples\server\petstore\rails5\ - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/ruby-client-petstore.bat b/bin/windows/ruby-client-petstore.bat deleted file mode 100755 index aab6582f6885..000000000000 --- a/bin/windows/ruby-client-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g ruby -o samples\client\petstore\ruby - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/run-all-petstore.cmd b/bin/windows/run-all-petstore.cmd deleted file mode 100644 index 9a8bdab6821f..000000000000 --- a/bin/windows/run-all-petstore.cmd +++ /dev/null @@ -1,15 +0,0 @@ -REM this batch file will loop through all the .bat files under bin\windows\ -REM execute the script and check the error level to see if there's any error - -echo IMPORTANT: this script should be run by the CI (e.g. appveyor) only. There's no need to run this script to update Petstore samples for all generators. -echo Please press CTRL+C to stop or the script will continue in 10 seconds. - -timeout 10 - -for /f "delims=" %%i in ('dir /b ".\bin\windows\*.bat"') do ( - - CALL .\bin\windows\%%i - - IF ERRORLEVEL 1 IF NOT ERRORLEVEL 2 exit /b 1 - -) diff --git a/bin/windows/rust-petstore.bat b/bin/windows/rust-petstore.bat deleted file mode 100644 index 8a051c6b19f4..000000000000 --- a/bin/windows/rust-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g rust -o samples\client\petstore\rust - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/rust-server-petstore.bat b/bin/windows/rust-server-petstore.bat deleted file mode 100755 index 4654e0109138..000000000000 --- a/bin/windows/rust-server-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g rust-server -o samples\server\petstore\rust-server - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/scala-akka-http-server-petstore.bat b/bin/windows/scala-akka-http-server-petstore.bat deleted file mode 100644 index d59f6fb47b6b..000000000000 --- a/bin/windows/scala-akka-http-server-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate --artifact-id "scala-akka-http-petstore-server" -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g scala-akka-http-server -o samples\server\petstore\scala-akka-http-server - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/scala-akka-petstore.bat b/bin/windows/scala-akka-petstore.bat deleted file mode 100755 index 131859e4ec1c..000000000000 --- a/bin/windows/scala-akka-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate --artifact-id "scala-akka-petstore-client" -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g scala-akka -o samples\client\petstore\scala-akka - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/scala-gatling-petstore.sh b/bin/windows/scala-gatling-petstore.sh deleted file mode 100755 index f8b0168fd519..000000000000 --- a/bin/windows/scala-gatling-petstore.sh +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -t modules\openapi-generator\src\main\resources\scala-gatling -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g scala-gatling -o samples\client\petstore\scala-gatling - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/scala-httpclient-petstore.bat b/bin/windows/scala-httpclient-petstore.bat deleted file mode 100755 index 077c5cdc62e2..000000000000 --- a/bin/windows/scala-httpclient-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g scala-httpclient-deprecated -o samples\client\petstore\scala-httpclient - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/scala-lagom-petstore.bat b/bin/windows/scala-lagom-petstore.bat deleted file mode 100644 index 16e91a9e0bd5..000000000000 --- a/bin/windows/scala-lagom-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g scala-lagom-server -o samples\server\petstore\scala-lagom-server - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/scala-play-framework-petstore.bat b/bin/windows/scala-play-framework-petstore.bat deleted file mode 100755 index 11e49896373e..000000000000 --- a/bin/windows/scala-play-framework-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g scala-play-server -o samples\server\petstore\scala-play-server - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/spring-mvc-petstore-j8-async-server.bat b/bin/windows/spring-mvc-petstore-j8-async-server.bat deleted file mode 100644 index e87ba8ed7deb..000000000000 --- a/bin/windows/spring-mvc-petstore-j8-async-server.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g spring --library=spring-mvc -o samples\server\petstore\spring-mvc-j8-async -c bin\spring-mvc-petstore-j8-async.json --additional-properties hideGenerationTimestamp=true - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/spring-mvc-petstore-server.bat b/bin/windows/spring-mvc-petstore-server.bat deleted file mode 100644 index 02783f339cfa..000000000000 --- a/bin/windows/spring-mvc-petstore-server.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -c bin\spring-mvc-petstore-server.json -g spring --library=spring-mvc -o samples\server\petstore\spring-mvc --additional-properties hideGenerationTimestamp=true - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/springboot-petstore-server.bat b/bin/windows/springboot-petstore-server.bat deleted file mode 100644 index af0e4c2ba10b..000000000000 --- a/bin/windows/springboot-petstore-server.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g spring -o samples\server\petstore\springboot --additional-properties hideGenerationTimestamp=true - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/swift5-all.bat b/bin/windows/swift5-all.bat deleted file mode 100755 index 663df4e22de4..000000000000 --- a/bin/windows/swift5-all.bat +++ /dev/null @@ -1,2 +0,0 @@ -call .\bin\windows\swift5-petstore-all.bat -call .\bin\windows\swift5-test.bat diff --git a/bin/windows/swift5-petstore-alamofire.bat b/bin/windows/swift5-petstore-alamofire.bat deleted file mode 100755 index b982ea061e1d..000000000000 --- a/bin/windows/swift5-petstore-alamofire.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\swift\petstore-with-fake-endpoints-models-for-testing.yaml -g swift5 -c bin\swift5-petstore-alamofire.json -o samples\client\petstore\swift5\alamofireLibrary - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/swift5-petstore-all.bat b/bin/windows/swift5-petstore-all.bat deleted file mode 100755 index 9d656b1437be..000000000000 --- a/bin/windows/swift5-petstore-all.bat +++ /dev/null @@ -1,10 +0,0 @@ -call .\bin\windows\swift5-petstore.bat -call .\bin\windows\swift5-petstore-promisekit.bat -call .\bin\windows\swift5-petstore-result.bat -call .\bin\windows\swift5-petstore-rxswift.bat -call .\bin\windows\swift5-petstore-objcCompatible.bat -call .\bin\windows\swift5-petstore-nonPublicApi.bat -call .\bin\windows\swift5-petstore-urlsession.bat -call .\bin\windows\swift5-petstore-alamofire.bat -call .\bin\windows\swift5-petstore-combine.bat -call .\bin\windows\swift5-petstore-readonlyProperties.bat diff --git a/bin/windows/swift5-petstore-combine.bat b/bin/windows/swift5-petstore-combine.bat deleted file mode 100755 index 5ea7cc88db94..000000000000 --- a/bin/windows/swift5-petstore-combine.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\swift\petstore-with-fake-endpoints-models-for-testing.yaml -g swift5 -c bin\swift5-petstore-combine.json -o samples\client\petstore\swift5\combineLibrary - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/swift5-petstore-nonPublicApi.bat b/bin/windows/swift5-petstore-nonPublicApi.bat deleted file mode 100755 index 685333690188..000000000000 --- a/bin/windows/swift5-petstore-nonPublicApi.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\swift\petstore-with-fake-endpoints-models-for-testing.yaml -g swift5 -c bin\swift5-petstore-nonPublicApi.json -o samples\client\petstore\swift5\nonPublicApi - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/swift5-petstore-objcCompatible.bat b/bin/windows/swift5-petstore-objcCompatible.bat deleted file mode 100755 index 7d9b7047b4f7..000000000000 --- a/bin/windows/swift5-petstore-objcCompatible.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\swift\petstore-with-fake-endpoints-models-for-testing.yaml -g swift5 -c bin\swift5-petstore-objcCompatible.json -o samples\client\petstore\swift5\objcCompatible - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/swift5-petstore-promisekit.bat b/bin/windows/swift5-petstore-promisekit.bat deleted file mode 100755 index cfd9ff41effb..000000000000 --- a/bin/windows/swift5-petstore-promisekit.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\swift\petstore-with-fake-endpoints-models-for-testing.yaml -g swift5 -c bin\swift5-petstore-promisekit.json -o samples\client\petstore\swift5\promisekitLibrary - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/swift5-petstore-readonlyProperties.bat b/bin/windows/swift5-petstore-readonlyProperties.bat deleted file mode 100644 index cc297bd1a4f2..000000000000 --- a/bin/windows/swift5-petstore-readonlyProperties.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\swift\petstore-with-fake-endpoints-models-for-testing.yaml -g swift5 -c bin\swift5-petstore-readonlyProperties.json -o samples\client\petstore\swift5\readonlyProperties - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/swift5-petstore-result.bat b/bin/windows/swift5-petstore-result.bat deleted file mode 100755 index 4aabf28d5049..000000000000 --- a/bin/windows/swift5-petstore-result.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\swift\petstore-with-fake-endpoints-models-for-testing.yaml -g swift5 -c bin\swift5-petstore-result.json -o samples\client\petstore\swift5\resultLibrary - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/swift5-petstore-rxswift.bat b/bin/windows/swift5-petstore-rxswift.bat deleted file mode 100755 index 862c18206762..000000000000 --- a/bin/windows/swift5-petstore-rxswift.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\swift\petstore-with-fake-endpoints-models-for-testing.yaml -g swift5 -c bin\swift5-petstore-rxswift.json -o samples\client\petstore\swift5\rxswiftLibrary - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/swift5-petstore-urlSession.bat b/bin/windows/swift5-petstore-urlSession.bat deleted file mode 100755 index 594317a3fa1d..000000000000 --- a/bin/windows/swift5-petstore-urlSession.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\swift\petstore-with-fake-endpoints-models-for-testing.yaml -g swift5 -c bin\swift5-petstore-urlsession.json -o samples\client\petstore\swift5\urlsessionLibrary - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/swift5-petstore.bat b/bin/windows/swift5-petstore.bat deleted file mode 100755 index 26cee2940f4e..000000000000 --- a/bin/windows/swift5-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g swift5 -o samples\client\petstore\swift5\default - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/swift5-test.bat b/bin/windows/swift5-test.bat deleted file mode 100755 index 60d74aabcf64..000000000000 --- a/bin/windows/swift5-test.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\swift5Test.json -g swift5 -c bin\swift5-test.json -o samples\client\test\swift5\default - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/typescript-angular-petstore-all.bat b/bin/windows/typescript-angular-petstore-all.bat deleted file mode 100644 index aa3a4fa2f969..000000000000 --- a/bin/windows/typescript-angular-petstore-all.bat +++ /dev/null @@ -1,11 +0,0 @@ -call .\bin\windows\typescript-angular-v6-provided-in-root.bat -call .\bin\windows\typescript-angular-v6-provided-in-root-with-npm.bat -call .\bin\windows\typescript-angular-v6-not-provided-in-root.bat -call .\bin\windows\typescript-angular-v6-not-provided-in-root-with-npm.bat -call .\bin\windows\typescript-angular-v7-provided-in-root.bat -call .\bin\windows\typescript-angular-v7-provided-in-root-with-npm.bat -call .\bin\windows\typescript-angular-v7-not-provided-in-root.bat -call .\bin\windows\typescript-angular-v7-not-provided-in-root-with-npm.bat -call .\bin\windows\typescript-angular-v8-provided-in-root-with-npm.bat -call .\bin\windows\typescript-angular-v8-petstore-provided-in-root-with-prefixed-module-name.bat -call .\bin\windows\typescript-angular-v8-single-request-parameter.bat diff --git a/bin/windows/typescript-angular-v6-not-provided-in-root-with-npm.bat b/bin/windows/typescript-angular-v6-not-provided-in-root-with-npm.bat deleted file mode 100644 index 4e3e38dff452..000000000000 --- a/bin/windows/typescript-angular-v6-not-provided-in-root-with-npm.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set 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 --additional-properties providedInRoot=false --additional-properties ngVersion=6.0.0 - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/typescript-angular-v6-not-provided-in-root.bat b/bin/windows/typescript-angular-v6-not-provided-in-root.bat deleted file mode 100644 index d5550355dff7..000000000000 --- a/bin/windows/typescript-angular-v6-not-provided-in-root.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set 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 --additional-properties providedInRoot=false --additional-properties ngVersion=6.0.0 - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/typescript-angular-v6-provided-in-root-with-npm.bat b/bin/windows/typescript-angular-v6-provided-in-root-with-npm.bat deleted file mode 100644 index a821b0babcf3..000000000000 --- a/bin/windows/typescript-angular-v6-provided-in-root-with-npm.bat +++ /dev/null @@ -1,9 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-angular -c bin/typescript-angular-v6-petstore-provided-in-root-with-npm.json -o samples\client\petstore\typescript-angular-v6-provided-in-root\builds\with-npm --additional-properties ngVersion=6.0.0 - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/typescript-angular-v6-provided-in-root.bat b/bin/windows/typescript-angular-v6-provided-in-root.bat deleted file mode 100644 index 74650e72d1cc..000000000000 --- a/bin/windows/typescript-angular-v6-provided-in-root.bat +++ /dev/null @@ -1,9 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-angular -o samples\client\petstore\typescript-angular-v6-provided-in-root\builds\default --additional-properties ngVersion=6.0.0 - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/typescript-angular-v7-not-provided-in-root-with-npm.bat b/bin/windows/typescript-angular-v7-not-provided-in-root-with-npm.bat deleted file mode 100644 index 5a133e102658..000000000000 --- a/bin/windows/typescript-angular-v7-not-provided-in-root-with-npm.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-angular -c bin\typescript-angular-v7-petstore-not-provided-in-root-with-npm.json -o samples\client\petstore\typescript-angular-v7-not-provided-in-root\builds\with-npm --additional-properties providedInRoot=false --additional-properties ngVersion=7.0.0 - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/typescript-angular-v7-not-provided-in-root.bat b/bin/windows/typescript-angular-v7-not-provided-in-root.bat deleted file mode 100644 index b9a18244d0f7..000000000000 --- a/bin/windows/typescript-angular-v7-not-provided-in-root.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-angular -o samples\client\petstore\typescript-angular-v7-not-provided-in-root\builds\default --additional-properties ngVersion=7.0.0 --additional-properties providedInRoot=false - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/typescript-angular-v7-provided-in-root-with-npm.bat b/bin/windows/typescript-angular-v7-provided-in-root-with-npm.bat deleted file mode 100644 index 38c98efd01dc..000000000000 --- a/bin/windows/typescript-angular-v7-provided-in-root-with-npm.bat +++ /dev/null @@ -1,9 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-angular -c bin/typescript-angular-v7-petstore-provided-in-root-with-npm.json -o samples\client\petstore\typescript-angular-v7-provided-in-root\builds\with-npm --additional-properties ngVersion=7.0.0 - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/typescript-angular-v7-provided-in-root.bat b/bin/windows/typescript-angular-v7-provided-in-root.bat deleted file mode 100644 index 2ea04275bc52..000000000000 --- a/bin/windows/typescript-angular-v7-provided-in-root.bat +++ /dev/null @@ -1,9 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-angular -o samples\client\petstore\typescript-angular-v7-provided-in-root\builds\default --additional-properties ngVersion=7.0.0 - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/typescript-angular-v8-petstore-provided-in-root-with-prefixed-module-name.bat b/bin/windows/typescript-angular-v8-petstore-provided-in-root-with-prefixed-module-name.bat deleted file mode 100644 index 1929c6542ed4..000000000000 --- a/bin/windows/typescript-angular-v8-petstore-provided-in-root-with-prefixed-module-name.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-angular -c bin/typescript-angular-v8-petstore-provided-in-root-with-npm.json -o samples\client\petstore\typescript-angular-v8-provided-in-root\builds\with-prefixed-module-name --additional-properties ngVersion=8.0.0,apiModulePrefix=PetStore - - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/typescript-angular-v8-provided-in-root-with-npm.bat b/bin/windows/typescript-angular-v8-provided-in-root-with-npm.bat deleted file mode 100644 index 142c2ac85e7d..000000000000 --- a/bin/windows/typescript-angular-v8-provided-in-root-with-npm.bat +++ /dev/null @@ -1,9 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-angular -c bin/typescript-angular-v8-petstore-provided-in-root-with-npm.json -o samples\client\petstore\typescript-angular-v8-provided-in-root\builds\with-npm --additional-properties ngVersion=8.0.0 - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/typescript-angular-v8-single-request-parameter.bat b/bin/windows/typescript-angular-v8-single-request-parameter.bat deleted file mode 100644 index c963702b04c3..000000000000 --- a/bin/windows/typescript-angular-v8-single-request-parameter.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-angular -c bin/typescript-angular-v8-petstore-provided-in-root-with-npm.json -o samples\client\petstore\typescript-angular-v8-provided-in-root\builds\single-request-parameter --additional-properties ngVersion=8.0.0,useSingleRequestParameter=true - - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/typescript-angularjs.bat b/bin/windows/typescript-angularjs.bat deleted file mode 100755 index d2e044632691..000000000000 --- a/bin/windows/typescript-angularjs.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-angularjs -o samples\client\petstore\typescript-angularjs - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/typescript-aurelia-petstore.bat b/bin/windows/typescript-aurelia-petstore.bat deleted file mode 100644 index 6721b4499f05..000000000000 --- a/bin/windows/typescript-aurelia-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-aurelia -o samples\client\petstore\typescript-aurelia\default - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/typescript-axios-petstore-all.bat b/bin/windows/typescript-axios-petstore-all.bat deleted file mode 100644 index 8e9a25ddaf1a..000000000000 --- a/bin/windows/typescript-axios-petstore-all.bat +++ /dev/null @@ -1,10 +0,0 @@ -@ECHO OFF - -call bin\windows\typescript-axios-petstore.bat -call bin\windows\typescript-axios-petstore-target-es6.bat -call bin\windows\typescript-axios-petstore-with-complex-headers.bat -call bin\windows\typescript-axios-petstore-with-single-request-parameters.bat -call bin\windows\typescript-axios-petstore-with-npm-version.bat -call bin\windows\typescript-axios-petstore-interfaces.bat -call bin\windows\typescript-axios-petstore-composed-schemas.bat -call bin\windows\typescript-axios-petstore-with-npm-version-and-separate-models-and-api.bat \ No newline at end of file diff --git a/bin/windows/typescript-axios-petstore-composed-schemas.bat b/bin/windows/typescript-axios-petstore-composed-schemas.bat deleted file mode 100644 index ae70255c20b4..000000000000 --- a/bin/windows/typescript-axios-petstore-composed-schemas.bat +++ /dev/null @@ -1,14 +0,0 @@ -@ECHO OFF - -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M - -echo -set ags=generate -i modules\openapi-generator\src\test\resources\3_0\composed-schemas.yaml -g typescript-axios -o samples\client\petstore\typescript-axios\builds\composed-schemas - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/typescript-axios-petstore-interfaces.bat b/bin/windows/typescript-axios-petstore-interfaces.bat deleted file mode 100644 index 2c34eba5c7af..000000000000 --- a/bin/windows/typescript-axios-petstore-interfaces.bat +++ /dev/null @@ -1,12 +0,0 @@ -@ECHO OFF - -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-axios -o samples\client\petstore\typescript-axios\builds\with-interfaces --additional-properties withInterfaces=true - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/typescript-axios-petstore-target-es6.bat b/bin/windows/typescript-axios-petstore-target-es6.bat deleted file mode 100644 index e6a971420fbd..000000000000 --- a/bin/windows/typescript-axios-petstore-target-es6.bat +++ /dev/null @@ -1,12 +0,0 @@ -@ECHO OFF - -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-axios -c bin\typescript-axios-petstore-target-es6.json -o samples\client\petstore\typescript-axios\builds\es6-target - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/typescript-axios-petstore-with-complex-headers.bat b/bin/windows/typescript-axios-petstore-with-complex-headers.bat deleted file mode 100755 index 9cf113587ea0..000000000000 --- a/bin/windows/typescript-axios-petstore-with-complex-headers.bat +++ /dev/null @@ -1,12 +0,0 @@ -@ECHO OFF - -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\3_0\petstore-with-complex-headers.yaml -g typescript-axios -o samples\client\petstore\typescript-axios\builds\with-complex-headers - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/typescript-axios-petstore-with-npm-version-and-separate-models-and-api.bat b/bin/windows/typescript-axios-petstore-with-npm-version-and-separate-models-and-api.bat deleted file mode 100644 index d67cc90b5bc5..000000000000 --- a/bin/windows/typescript-axios-petstore-with-npm-version-and-separate-models-and-api.bat +++ /dev/null @@ -1,12 +0,0 @@ -@ECHO OFF - -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-axios -c bin\typescript-axios-petstore-with-npm-version-and-separate-models-and-api.json -o samples\client\petstore\typescript-axios\builds\with-npm-version-and-separate-models-and-api - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/typescript-axios-petstore-with-npm-version.bat b/bin/windows/typescript-axios-petstore-with-npm-version.bat deleted file mode 100644 index a3ae2644e9f7..000000000000 --- a/bin/windows/typescript-axios-petstore-with-npm-version.bat +++ /dev/null @@ -1,12 +0,0 @@ -@ECHO OFF - -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-axios -c bin\typescript-axios-petstore-with-npm-version.json -o samples\client\petstore\typescript-axios\builds\with-npm-version - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/typescript-axios-petstore-with-single-request-parameters.bat b/bin/windows/typescript-axios-petstore-with-single-request-parameters.bat deleted file mode 100755 index efe0284cb879..000000000000 --- a/bin/windows/typescript-axios-petstore-with-single-request-parameters.bat +++ /dev/null @@ -1,12 +0,0 @@ -@ECHO OFF - -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore-with-operations-without-required-params.yaml -g typescript-axios -o samples\client\petstore\typescript-axios\builds\with-single-request-parameters --additional-properties useSingleRequestParameter=true - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/typescript-axios-petstore.bat b/bin/windows/typescript-axios-petstore.bat deleted file mode 100644 index 7b21e6b66e9a..000000000000 --- a/bin/windows/typescript-axios-petstore.bat +++ /dev/null @@ -1,14 +0,0 @@ -@ECHO OFF - -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M - -echo -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-axios -o samples\client\petstore\typescript-axios\builds\default - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/typescript-fetch-petstore-all.bat b/bin/windows/typescript-fetch-petstore-all.bat deleted file mode 100644 index d525bc0559fb..000000000000 --- a/bin/windows/typescript-fetch-petstore-all.bat +++ /dev/null @@ -1,9 +0,0 @@ -@ECHO OFF - -call bin\windows\typescript-fetch-petstore.bat -call bin\windows\typescript-fetch-petstore-target-es6.bat -call bin\windows\typescript-fetch-petstore-with-npm-version.bat -call bin\windows\typescript-fetch-petstore-interfaces.bat -call bin\windows\typescript-fetch-petstore-multiple-parameters.bat -call bin\windows\typescript-fetch-petstore-prefix-parameter-interfaces.bat -call bin\windows\typescript-fetch-petstore-typescript-three-plus.bat \ No newline at end of file diff --git a/bin/windows/typescript-fetch-petstore-interfaces.bat b/bin/windows/typescript-fetch-petstore-interfaces.bat deleted file mode 100644 index e25d23badb7d..000000000000 --- a/bin/windows/typescript-fetch-petstore-interfaces.bat +++ /dev/null @@ -1,12 +0,0 @@ -@ECHO OFF - -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-fetch -o samples\client\petstore\typescript-fetch\builds\with-interfaces --additional-properties withInterfaces=true - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/typescript-fetch-petstore-multiple-parameters.bat b/bin/windows/typescript-fetch-petstore-multiple-parameters.bat deleted file mode 100644 index 095fdb3e5d66..000000000000 --- a/bin/windows/typescript-fetch-petstore-multiple-parameters.bat +++ /dev/null @@ -1,12 +0,0 @@ -@ECHO OFF - -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-fetch -c bin\typescript-fetch-petstore-multiple-parameters.json -o samples\client\petstore\typescript-fetch\builds\multiple-parameters - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/typescript-fetch-petstore-prefix-parameter-interfaces.bat b/bin/windows/typescript-fetch-petstore-prefix-parameter-interfaces.bat deleted file mode 100644 index f96184e5d228..000000000000 --- a/bin/windows/typescript-fetch-petstore-prefix-parameter-interfaces.bat +++ /dev/null @@ -1,12 +0,0 @@ -@ECHO OFF - -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-fetch -c bin\typescript-fetch-petstore-prefix-parameter-interfaces.json -o samples\client\petstore\typescript-fetch\builds\prefix-parameter-interfaces - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/typescript-fetch-petstore-target-es6.bat b/bin/windows/typescript-fetch-petstore-target-es6.bat deleted file mode 100644 index afa259575f10..000000000000 --- a/bin/windows/typescript-fetch-petstore-target-es6.bat +++ /dev/null @@ -1,12 +0,0 @@ -@ECHO OFF - -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-fetch -c bin\typescript-fetch-petstore-target-es6.json -o samples\client\petstore\typescript-fetch\builds\es6-target - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/typescript-fetch-petstore-typescript-three-plus.bat b/bin/windows/typescript-fetch-petstore-typescript-three-plus.bat deleted file mode 100644 index 001a75f2986b..000000000000 --- a/bin/windows/typescript-fetch-petstore-typescript-three-plus.bat +++ /dev/null @@ -1,12 +0,0 @@ -@ECHO OFF - -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-fetch -c bin/typescript-fetch-petstore-typescript-three-plus.json -o samples\client\petstore\typescript-fetch\builds\typescript-three-plus - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/typescript-fetch-petstore-with-npm-version.bat b/bin/windows/typescript-fetch-petstore-with-npm-version.bat deleted file mode 100644 index dc0331d9ce0d..000000000000 --- a/bin/windows/typescript-fetch-petstore-with-npm-version.bat +++ /dev/null @@ -1,12 +0,0 @@ -@ECHO OFF - -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-fetch -c bin\typescript-fetch-petstore-with-npm-version.json -o samples\client\petstore\typescript-fetch\builds\with-npm-version - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/typescript-fetch-petstore.bat b/bin/windows/typescript-fetch-petstore.bat deleted file mode 100644 index b08fa66d0de8..000000000000 --- a/bin/windows/typescript-fetch-petstore.bat +++ /dev/null @@ -1,14 +0,0 @@ -@ECHO OFF - -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M - -echo -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-fetch -o samples\client\petstore\typescript-fetch\builds\default - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/typescript-inversify-petstore.bat b/bin/windows/typescript-inversify-petstore.bat deleted file mode 100644 index e29c0dda7824..000000000000 --- a/bin/windows/typescript-inversify-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-inversify -o samples\client\petstore\typescript-inversify - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/typescript-jquery-with-npm.bat b/bin/windows/typescript-jquery-with-npm.bat deleted file mode 100644 index a72a03b54195..000000000000 --- a/bin/windows/typescript-jquery-with-npm.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -c bin\typescript-jquery-petstore-npm.json -g typescript-jquery -o samples\client\petstore\typescript-jquery\npm - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/typescript-jquery.bat b/bin/windows/typescript-jquery.bat deleted file mode 100644 index d92ab3800f70..000000000000 --- a/bin/windows/typescript-jquery.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-jquery -o samples\client\petstore\typescript-jquery\default - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/typescript-node-petstore-all.bat b/bin/windows/typescript-node-petstore-all.bat deleted file mode 100644 index 3a690974e9d8..000000000000 --- a/bin/windows/typescript-node-petstore-all.bat +++ /dev/null @@ -1,2 +0,0 @@ -call .\bin\windows\typescript-node-petstore.bat -call .\bin\windows\typescript-node-petstore-with-npm.bat diff --git a/bin/windows/typescript-node-petstore-with-npm.bat b/bin/windows/typescript-node-petstore-with-npm.bat deleted file mode 100755 index 6f0a62e708ba..000000000000 --- a/bin/windows/typescript-node-petstore-with-npm.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -c bin\typescript-node-petstore-npm.json -g typescript-node -o samples\client\petstore\typescript-node\npm - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/typescript-node-petstore.bat b/bin/windows/typescript-node-petstore.bat deleted file mode 100755 index e2df9d5dd6ab..000000000000 --- a/bin/windows/typescript-node-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-node -o samples\client\petstore\typescript-node\default - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/typescript-redux-query-petstore-with-npm.bat b/bin/windows/typescript-redux-query-petstore-with-npm.bat deleted file mode 100755 index 7ec9a262027e..000000000000 --- a/bin/windows/typescript-redux-query-petstore-with-npm.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -c bin\typescript-redux-query-petstore-with-npm-version.json -g typescript-redux-query -o samples\client\petstore\typescript-redux-query\builds\with-npm-version - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/typescript-redux-query-petstore.bat b/bin/windows/typescript-redux-query-petstore.bat deleted file mode 100644 index 560fe9196662..000000000000 --- a/bin/windows/typescript-redux-query-petstore.bat +++ /dev/null @@ -1,14 +0,0 @@ -@ECHO OFF - -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M - -echo -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-redux-query -o samples\client\petstore\typescript-redux-query\builds\default - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/typescript-rxjs-petstore-all.bat b/bin/windows/typescript-rxjs-petstore-all.bat deleted file mode 100644 index d86cf0d574dd..000000000000 --- a/bin/windows/typescript-rxjs-petstore-all.bat +++ /dev/null @@ -1,6 +0,0 @@ -@ECHO OFF - -call bin\windows\typescript-rxjs-petstore.bat -call bin\windows\typescript-rxjs-petstore-target-es6.bat -call bin\windows\typescript-rxjs-petstore-with-npm-version.bat -call bin\windows\typescript-rxjs-petstore-interfaces.bat diff --git a/bin/windows/typescript-rxjs-petstore-interfaces.bat b/bin/windows/typescript-rxjs-petstore-interfaces.bat deleted file mode 100644 index b2232e82cd34..000000000000 --- a/bin/windows/typescript-rxjs-petstore-interfaces.bat +++ /dev/null @@ -1,12 +0,0 @@ -@ECHO OFF - -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-rxjs -o samples\client\petstore\typescript-rxjs\builds\with-interfaces --additional-properties withInterfaces=true - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/typescript-rxjs-petstore-target-es6.bat b/bin/windows/typescript-rxjs-petstore-target-es6.bat deleted file mode 100644 index 7a7151fdc3fc..000000000000 --- a/bin/windows/typescript-rxjs-petstore-target-es6.bat +++ /dev/null @@ -1,12 +0,0 @@ -@ECHO OFF - -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-rxjs -c bin\typescript-rxjs-petstore-target-es6.json -o samples\client\petstore\typescript-rxjs\builds\es6-target - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/typescript-rxjs-petstore-with-npm-version.bat b/bin/windows/typescript-rxjs-petstore-with-npm-version.bat deleted file mode 100644 index 2bd3875d73ce..000000000000 --- a/bin/windows/typescript-rxjs-petstore-with-npm-version.bat +++ /dev/null @@ -1,12 +0,0 @@ -@ECHO OFF - -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-rxjs -c bin\typescript-rxjs-petstore-with-npm-version.json -o samples\client\petstore\typescript-rxjs\builds\with-npm-version - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/typescript-rxjs-petstore.bat b/bin/windows/typescript-rxjs-petstore.bat deleted file mode 100644 index 025b967addbc..000000000000 --- a/bin/windows/typescript-rxjs-petstore.bat +++ /dev/null @@ -1,14 +0,0 @@ -@ECHO OFF - -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M - -echo -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-rxjs -o samples\client\petstore\typescript-rxjs\builds\default - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/ze-ph-petstore.bat b/bin/windows/ze-ph-petstore.bat deleted file mode 100644 index da5eacc3639a..000000000000 --- a/bin/windows/ze-ph-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g php-ze-ph -o samples\server\petstore\php-ze-ph - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/GenerateBatch.java b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/GenerateBatch.java index 90bdec1f3f02..1e9a4dbb247d 100644 --- a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/GenerateBatch.java +++ b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/GenerateBatch.java @@ -28,6 +28,7 @@ import io.airlift.airline.Arguments; import io.airlift.airline.Command; import io.airlift.airline.Option; +import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.ClientOptInput; import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.DefaultGenerator; @@ -47,13 +48,15 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; import java.util.stream.Stream; @SuppressWarnings({"unused", "MismatchedQueryAndUpdateOfCollection", "java:S106"}) @Command(name = "batch", description = "Generate code in batch via external configs.", hidden = true) public class GenerateBatch extends OpenApiGeneratorCommand { - + private static AtomicInteger failures = new AtomicInteger(0); + private static AtomicInteger successes = new AtomicInteger(0); private static final Logger LOGGER = LoggerFactory.getLogger(GenerateBatch.class); @Option(name = {"-v", "--verbose"}, description = "verbose mode") @@ -151,7 +154,13 @@ public void execute() { executor.awaitTermination(awaitFor, TimeUnit.MINUTES); - System.out.println("COMPLETE."); + int failCount = failures.intValue(); + if (failCount > 0) { + System.err.println(String.format(Locale.ROOT, "[FAIL] Completed with %d failures, %d successes", failCount, successes.intValue())); + System.exit(1); + } else { + System.out.println(String.format(Locale.ROOT, "[SUCCESS] Batch generation finished %d generators successfully.", successes.intValue())); + } } catch (InterruptedException e) { e.printStackTrace(); // re-interrupt @@ -183,12 +192,13 @@ private GenerationRunner(CodegenConfigurator configurator, Path rootDir, boolean */ @Override public void run() { + String name = ""; try { GlobalSettings.reset(); ClientOptInput opts = configurator.toClientOptInput(); CodegenConfig config = opts.getConfig(); - String name = config.getName(); + name = config.getName(); Path target = Paths.get(config.getOutputDir()); Path updated = rootDir.resolve(target); @@ -202,8 +212,14 @@ public void run() { defaultGenerator.generate(); System.out.printf(Locale.ROOT, "[%s] Finished generating %s…%n", Thread.currentThread().getName(), name); + successes.incrementAndGet(); } catch (Throwable e) { - System.err.printf(Locale.ROOT, "[%s] Generation failed: (%s) %s%n", Thread.currentThread().getName(), e.getClass().getSimpleName(), e.getMessage()); + failures.incrementAndGet(); + String failedOn = name; + if (StringUtils.isEmpty(failedOn)) { + failedOn = "unspecified"; + } + System.err.printf(Locale.ROOT, "[%s] Generation failed for %s: (%s) %s%n", Thread.currentThread().getName(), failedOn, e.getClass().getSimpleName(), e.getMessage()); e.printStackTrace(System.err); if (exitOnError) { System.exit(1); diff --git a/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/config/WorkflowSettings.java b/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/config/WorkflowSettings.java index c7a49db52a73..61516ec694c2 100644 --- a/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/config/WorkflowSettings.java +++ b/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/config/WorkflowSettings.java @@ -46,6 +46,7 @@ public class WorkflowSettings { public static final boolean DEFAULT_ENABLE_POST_PROCESS_FILE = false; public static final boolean DEFAULT_ENABLE_MINIMAL_UPDATE = false; public static final boolean DEFAULT_STRICT_SPEC_BEHAVIOR = true; + public static final boolean DEFAULT_GENERATE_ALIAS_AS_MODEL = false; public static final String DEFAULT_TEMPLATING_ENGINE_NAME = "mustache"; public static final ImmutableMap DEFAULT_GLOBAL_PROPERTIES = ImmutableMap.of(); @@ -59,6 +60,7 @@ public class WorkflowSettings { private boolean enablePostProcessFile = DEFAULT_ENABLE_POST_PROCESS_FILE; private boolean enableMinimalUpdate = DEFAULT_ENABLE_MINIMAL_UPDATE; private boolean strictSpecBehavior = DEFAULT_STRICT_SPEC_BEHAVIOR; + private boolean generateAliasAsModel = DEFAULT_GENERATE_ALIAS_AS_MODEL; private String templateDir; private String templatingEngineName = DEFAULT_TEMPLATING_ENGINE_NAME; private String ignoreFileOverride; @@ -79,6 +81,7 @@ private WorkflowSettings(Builder builder) { this.templatingEngineName = builder.templatingEngineName; this.ignoreFileOverride = builder.ignoreFileOverride; this.globalProperties = ImmutableMap.copyOf(builder.globalProperties); + this.generateAliasAsModel = builder.generateAliasAsModel; } /** @@ -104,6 +107,7 @@ public static Builder newBuilder(WorkflowSettings copy) { builder.validateSpec = copy.isValidateSpec(); builder.enablePostProcessFile = copy.isEnablePostProcessFile(); builder.enableMinimalUpdate = copy.isEnableMinimalUpdate(); + builder.generateAliasAsModel = copy.isGenerateAliasAsModel(); builder.strictSpecBehavior = copy.isStrictSpecBehavior(); builder.templatingEngineName = copy.getTemplatingEngineName(); builder.ignoreFileOverride = copy.getIgnoreFileOverride(); @@ -212,6 +216,15 @@ public boolean isEnableMinimalUpdate() { return enableMinimalUpdate; } + /** + * Indicates whether or not the generation should convert aliases (primitives defined as schema for use within documents) as models. + * + * @return true if generate-alias-as-model is enabled, otherwise false. + */ + public boolean isGenerateAliasAsModel() { + return generateAliasAsModel; + } + /** * Indicates whether or not 'MUST' and 'SHALL' wording in the api specification is strictly adhered to. * For example, when false, no automatic 'fixes' will be applied to documents which pass validation but don't follow the spec. @@ -275,6 +288,7 @@ public static final class Builder { private Boolean enablePostProcessFile = DEFAULT_ENABLE_POST_PROCESS_FILE; private Boolean enableMinimalUpdate = DEFAULT_ENABLE_MINIMAL_UPDATE; private Boolean strictSpecBehavior = DEFAULT_STRICT_SPEC_BEHAVIOR; + private Boolean generateAliasAsModel = DEFAULT_GENERATE_ALIAS_AS_MODEL; private String templateDir; private String templatingEngineName = DEFAULT_TEMPLATING_ENGINE_NAME; private String ignoreFileOverride; @@ -402,6 +416,18 @@ public Builder withStrictSpecBehavior(Boolean strictSpecBehavior) { return this; } + /** + * Sets the {@code generateAliasAsModel} and returns a reference to this Builder so that the methods can be chained together. + * An 'alias' is a primitive type defined as a schema, and this option will attempt to construct a model for that primitive. + * + * @param generateAliasAsModel the {@code generateAliasAsModel} to set + * @return a reference to this Builder + */ + public Builder withGenerateAliasAsModel(Boolean generateAliasAsModel) { + this.generateAliasAsModel = generateAliasAsModel != null ? generateAliasAsModel : Boolean.valueOf(DEFAULT_GENERATE_ALIAS_AS_MODEL); + return this; + } + /** * Sets the {@code templateDir} and returns a reference to this Builder so that the methods can be chained together. * @@ -519,6 +545,7 @@ public String toString() { ", templatingEngineName='" + templatingEngineName + '\'' + ", ignoreFileOverride='" + ignoreFileOverride + '\'' + ", globalProperties=" + globalProperties + + ", generateAliasAsModel=" + generateAliasAsModel + '}'; } @@ -535,6 +562,7 @@ public boolean equals(Object o) { isEnablePostProcessFile() == that.isEnablePostProcessFile() && isEnableMinimalUpdate() == that.isEnableMinimalUpdate() && isStrictSpecBehavior() == that.isStrictSpecBehavior() && + isGenerateAliasAsModel() == that.isGenerateAliasAsModel() && Objects.equals(getInputSpec(), that.getInputSpec()) && Objects.equals(getOutputDir(), that.getOutputDir()) && Objects.equals(getTemplateDir(), that.getTemplateDir()) && @@ -553,6 +581,7 @@ public int hashCode() { isRemoveOperationIdPrefix(), isLogToStderr(), isValidateSpec(), + isGenerateAliasAsModel(), isEnablePostProcessFile(), isEnableMinimalUpdate(), isStrictSpecBehavior(), diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfigurator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfigurator.java index 8520b6053363..ddb41ce7b8a6 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfigurator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfigurator.java @@ -28,6 +28,7 @@ import io.swagger.v3.parser.core.models.ParseOptions; import io.swagger.v3.parser.core.models.SwaggerParseResult; import org.apache.commons.io.FilenameUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.Validate; import org.openapitools.codegen.*; import org.openapitools.codegen.api.TemplatingEngineAdapter; @@ -214,21 +215,31 @@ public CodegenConfigurator setReservedWordsMappings(Map reserved } public CodegenConfigurator setApiPackage(String apiPackage) { + if (StringUtils.isNotEmpty(apiPackage)) { + addAdditionalProperty(CodegenConstants.API_PACKAGE, apiPackage); + } generatorSettingsBuilder.withApiPackage(apiPackage); return this; } public CodegenConfigurator setArtifactId(String artifactId) { + if (StringUtils.isNotEmpty(artifactId)) { + addAdditionalProperty(CodegenConstants.ARTIFACT_ID, artifactId); + } generatorSettingsBuilder.withArtifactId(artifactId); return this; } public CodegenConfigurator setArtifactVersion(String artifactVersion) { + if (StringUtils.isNotEmpty(artifactVersion)) { + addAdditionalProperty(CodegenConstants.ARTIFACT_VERSION, artifactVersion); + } generatorSettingsBuilder.withArtifactVersion(artifactVersion); return this; } public CodegenConfigurator setAuth(String auth) { + // do not cache this in additional properties. this.auth = auth; return this; } @@ -244,7 +255,7 @@ public CodegenConfigurator setEnablePostProcessFile(boolean enablePostProcessFil } public CodegenConfigurator setGenerateAliasAsModel(boolean generateAliasAsModel) { - // TODO: Move to GlobalSettings? + workflowSettingsBuilder.withGenerateAliasAsModel(generateAliasAsModel); ModelUtils.setGenerateAliasAsModel(generateAliasAsModel); return this; } @@ -265,26 +276,41 @@ public CodegenConfigurator setGeneratorName(final String generatorName) { } public CodegenConfigurator setGitRepoId(String gitRepoId) { + if (StringUtils.isNotEmpty(gitRepoId)) { + addAdditionalProperty(CodegenConstants.GIT_REPO_ID, gitRepoId); + } generatorSettingsBuilder.withGitRepoId(gitRepoId); return this; } public CodegenConfigurator setGitHost(String gitHost) { + if (StringUtils.isNotEmpty(gitHost)) { + addAdditionalProperty(CodegenConstants.GIT_HOST, gitHost); + } generatorSettingsBuilder.withGitHost(gitHost); return this; } public CodegenConfigurator setGitUserId(String gitUserId) { + if (StringUtils.isNotEmpty(gitUserId)) { + addAdditionalProperty(CodegenConstants.GIT_HOST, gitUserId); + } generatorSettingsBuilder.withGitUserId(gitUserId); return this; } public CodegenConfigurator setGroupId(String groupId) { + if (StringUtils.isNotEmpty(groupId)) { + addAdditionalProperty(CodegenConstants.GROUP_ID, groupId); + } generatorSettingsBuilder.withGroupId(groupId); return this; } public CodegenConfigurator setHttpUserAgent(String httpUserAgent) { + if (StringUtils.isNotEmpty(httpUserAgent)) { + addAdditionalProperty(CodegenConstants.HTTP_USER_AGENT, httpUserAgent); + } generatorSettingsBuilder.withHttpUserAgent(httpUserAgent); return this; } @@ -313,6 +339,9 @@ public CodegenConfigurator setInstantiationTypes(Map instantiati } public CodegenConfigurator setInvokerPackage(String invokerPackage) { + if (StringUtils.isNotEmpty(invokerPackage)) { + addAdditionalProperty(CodegenConstants.INVOKER_PACKAGE, invokerPackage); + } generatorSettingsBuilder.withInvokerPackage(invokerPackage); return this; } @@ -335,21 +364,33 @@ public CodegenConfigurator setLogToStderr(boolean logToStderr) { } public CodegenConfigurator setApiNameSuffix(String suffix) { + if (StringUtils.isNotEmpty(suffix)) { + addAdditionalProperty(CodegenConstants.API_NAME_SUFFIX, suffix); + } generatorSettingsBuilder.withApiNameSuffix(suffix); return this; } public CodegenConfigurator setModelNamePrefix(String prefix) { + if (StringUtils.isNotEmpty(prefix)) { + addAdditionalProperty(CodegenConstants.MODEL_NAME_PREFIX, prefix); + } generatorSettingsBuilder.withModelNamePrefix(prefix); return this; } public CodegenConfigurator setModelNameSuffix(String suffix) { + if (StringUtils.isNotEmpty(suffix)) { + addAdditionalProperty(CodegenConstants.MODEL_NAME_SUFFIX, suffix); + } generatorSettingsBuilder.withModelNameSuffix(suffix); return this; } public CodegenConfigurator setModelPackage(String modelPackage) { + if (StringUtils.isNotEmpty(modelPackage)) { + addAdditionalProperty(CodegenConstants.MODEL_PACKAGE, modelPackage); + } generatorSettingsBuilder.withModelPackage(modelPackage); return this; } @@ -360,11 +401,17 @@ public CodegenConfigurator setOutputDir(String outputDir) { } public CodegenConfigurator setPackageName(String packageName) { + if (StringUtils.isNotEmpty(packageName)) { + addAdditionalProperty(CodegenConstants.PACKAGE_NAME, packageName); + } generatorSettingsBuilder.withPackageName(packageName); return this; } public CodegenConfigurator setReleaseNote(String releaseNote) { + if (StringUtils.isNotEmpty(releaseNote)) { + addAdditionalProperty(CodegenConstants.RELEASE_NOTE, releaseNote); + } generatorSettingsBuilder.withReleaseNote(releaseNote); return this; } @@ -453,6 +500,9 @@ public Context toContext() { GlobalSettings.setProperty(entry.getKey(), entry.getValue()); } + // if caller resets GlobalSettings, we'll need to reset generateAliasAsModel. As noted in this method, this should be moved. + ModelUtils.setGenerateAliasAsModel(workflowSettings.isGenerateAliasAsModel()); + // TODO: Support custom spec loader implementations (https://github.com/OpenAPITools/openapi-generator/issues/844) final List authorizationValues = AuthParser.parse(this.auth); ParseOptions options = new ParseOptions(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java index 0afb3603c57d..0b41c204d471 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java @@ -37,7 +37,9 @@ import java.io.File; import java.time.LocalDate; +import java.time.OffsetDateTime; import java.time.ZoneId; +import java.time.format.DateTimeFormatter; import java.util.*; import java.util.regex.Pattern; diff --git a/modules/openapi-generator/src/test/resources/3_0/elm.yaml b/modules/openapi-generator/src/test/resources/3_0/elm.yaml index ae5288715ce5..13dde8a98392 100644 --- a/modules/openapi-generator/src/test/resources/3_0/elm.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/elm.yaml @@ -64,17 +64,17 @@ paths: parameters: - name: string in: path - required: true + required: true schema: type: string - name: integer in: path - required: true + required: true schema: type: integer - name: enumeration in: path - required: true + required: true schema: type: string enum: [a, b, c] diff --git a/samples/client/petstore/apex/.openapi-generator/FILES b/samples/client/petstore/apex/.openapi-generator/FILES index 11fd3bc07bbd..dd1183e235af 100644 --- a/samples/client/petstore/apex/.openapi-generator/FILES +++ b/samples/client/petstore/apex/.openapi-generator/FILES @@ -8,6 +8,10 @@ force-app/main/default/classes/OASCategory.cls force-app/main/default/classes/OASCategory.cls-meta.xml force-app/main/default/classes/OASClient.cls force-app/main/default/classes/OASClient.cls-meta.xml +force-app/main/default/classes/OASInlineObject.cls +force-app/main/default/classes/OASInlineObject.cls-meta.xml +force-app/main/default/classes/OASInlineObject1.cls +force-app/main/default/classes/OASInlineObject1.cls-meta.xml force-app/main/default/classes/OASOrder.cls force-app/main/default/classes/OASOrder.cls-meta.xml force-app/main/default/classes/OASPet.cls diff --git a/samples/client/petstore/apex/README.md b/samples/client/petstore/apex/README.md index 60da087e3fbe..3a22819780c8 100644 --- a/samples/client/petstore/apex/README.md +++ b/samples/client/petstore/apex/README.md @@ -91,6 +91,8 @@ Class | Method | HTTP request | Description - [OASApiResponse](OASApiResponse.md) - [OASCategory](OASCategory.md) + - [OASInlineObject](OASInlineObject.md) + - [OASInlineObject1](OASInlineObject1.md) - [OASOrder](OASOrder.md) - [OASPet](OASPet.md) - [OASTag](OASTag.md) diff --git a/samples/client/petstore/apex/force-app/main/default/classes/OASInlineObject.cls b/samples/client/petstore/apex/force-app/main/default/classes/OASInlineObject.cls new file mode 100644 index 000000000000..904594a5573c --- /dev/null +++ b/samples/client/petstore/apex/force-app/main/default/classes/OASInlineObject.cls @@ -0,0 +1,52 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by the OAS code generator program. + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +/** + * OASInlineObject + */ +public class OASInlineObject { + /** + * Updated name of the pet + * @return name + */ + public String name { get; set; } + + /** + * Updated status of the pet + * @return status + */ + public String status { get; set; } + + public static OASInlineObject getExample() { + OASInlineObject inlineObject = new OASInlineObject(); + inlineObject.name = ''; + inlineObject.status = ''; + return inlineObject; + } + + public Boolean equals(Object obj) { + if (obj instanceof OASInlineObject) { + OASInlineObject inlineObject = (OASInlineObject) obj; + return this.name == inlineObject.name + && this.status == inlineObject.status; + } + return false; + } + + public Integer hashCode() { + Integer hashCode = 43; + hashCode = (17 * hashCode) + (name == null ? 0 : System.hashCode(name)); + hashCode = (17 * hashCode) + (status == null ? 0 : System.hashCode(status)); + return hashCode; + } +} + diff --git a/samples/client/petstore/apex/force-app/main/default/classes/OASInlineObject.cls-meta.xml b/samples/client/petstore/apex/force-app/main/default/classes/OASInlineObject.cls-meta.xml new file mode 100644 index 000000000000..fec71a26693f --- /dev/null +++ b/samples/client/petstore/apex/force-app/main/default/classes/OASInlineObject.cls-meta.xml @@ -0,0 +1,5 @@ + + + 42.0 + Active + diff --git a/samples/client/petstore/apex/force-app/main/default/classes/OASInlineObject1.cls b/samples/client/petstore/apex/force-app/main/default/classes/OASInlineObject1.cls new file mode 100644 index 000000000000..f55bd1c5712e --- /dev/null +++ b/samples/client/petstore/apex/force-app/main/default/classes/OASInlineObject1.cls @@ -0,0 +1,52 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by the OAS code generator program. + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +/** + * OASInlineObject1 + */ +public class OASInlineObject1 { + /** + * Additional data to pass to server + * @return additionalMetadata + */ + public String additionalMetadata { get; set; } + + /** + * file to upload + * @return file + */ + public Blob file { get; set; } + + public static OASInlineObject1 getExample() { + OASInlineObject1 inlineObject1 = new OASInlineObject1(); + inlineObject1.additionalMetadata = ''; + inlineObject1.file = EncodingUtil.base64Decode(VGhlIHF1aWNrIGJyb3duIGZveCBqdW1wZWQgb3ZlciB0aGUgbGF6eSBkb2cu); + return inlineObject1; + } + + public Boolean equals(Object obj) { + if (obj instanceof OASInlineObject1) { + OASInlineObject1 inlineObject1 = (OASInlineObject1) obj; + return this.additionalMetadata == inlineObject1.additionalMetadata + && this.file == inlineObject1.file; + } + return false; + } + + public Integer hashCode() { + Integer hashCode = 43; + hashCode = (17 * hashCode) + (additionalMetadata == null ? 0 : System.hashCode(additionalMetadata)); + hashCode = (17 * hashCode) + (file == null ? 0 : System.hashCode(file)); + return hashCode; + } +} + diff --git a/samples/client/petstore/apex/force-app/main/default/classes/OASInlineObject1.cls-meta.xml b/samples/client/petstore/apex/force-app/main/default/classes/OASInlineObject1.cls-meta.xml new file mode 100644 index 000000000000..fec71a26693f --- /dev/null +++ b/samples/client/petstore/apex/force-app/main/default/classes/OASInlineObject1.cls-meta.xml @@ -0,0 +1,5 @@ + + + 42.0 + Active + diff --git a/samples/client/petstore/apex/force-app/main/default/classes/OASInlineObject1Test.cls b/samples/client/petstore/apex/force-app/main/default/classes/OASInlineObject1Test.cls new file mode 100644 index 000000000000..31c06fadba9d --- /dev/null +++ b/samples/client/petstore/apex/force-app/main/default/classes/OASInlineObject1Test.cls @@ -0,0 +1,71 @@ +@isTest +private class OASInlineObject1Test { + @isTest + private static void equalsSameInstance() { + OASInlineObject1 inlineObject11 = OASInlineObject1.getExample(); + OASInlineObject1 inlineObject12 = inlineObject11; + OASInlineObject1 inlineObject13 = new OASInlineObject1(); + OASInlineObject1 inlineObject14 = inlineObject13; + + System.assert(inlineObject11.equals(inlineObject12)); + System.assert(inlineObject12.equals(inlineObject11)); + System.assert(inlineObject11.equals(inlineObject11)); + System.assert(inlineObject13.equals(inlineObject14)); + System.assert(inlineObject14.equals(inlineObject13)); + System.assert(inlineObject13.equals(inlineObject13)); + } + + @isTest + private static void equalsIdenticalInstance() { + OASInlineObject1 inlineObject11 = OASInlineObject1.getExample(); + OASInlineObject1 inlineObject12 = OASInlineObject1.getExample(); + OASInlineObject1 inlineObject13 = new OASInlineObject1(); + OASInlineObject1 inlineObject14 = new OASInlineObject1(); + + System.assert(inlineObject11.equals(inlineObject12)); + System.assert(inlineObject12.equals(inlineObject11)); + System.assert(inlineObject13.equals(inlineObject14)); + System.assert(inlineObject14.equals(inlineObject13)); + } + + @isTest + private static void notEqualsDifferentType() { + OASInlineObject1 inlineObject11 = OASInlineObject1.getExample(); + OASInlineObject1 inlineObject12 = new OASInlineObject1(); + + System.assertEquals(false, inlineObject11.equals('foo')); + System.assertEquals(false, inlineObject12.equals('foo')); + } + + @isTest + private static void notEqualsNull() { + OASInlineObject1 inlineObject11 = OASInlineObject1.getExample(); + OASInlineObject1 inlineObject12 = new OASInlineObject1(); + OASInlineObject1 inlineObject13; + + System.assertEquals(false, inlineObject11.equals(inlineObject13)); + System.assertEquals(false, inlineObject12.equals(inlineObject13)); + } + + @isTest + private static void consistentHashCodeValue() { + OASInlineObject1 inlineObject11 = OASInlineObject1.getExample(); + OASInlineObject1 inlineObject12 = new OASInlineObject1(); + + System.assertEquals(inlineObject11.hashCode(), inlineObject11.hashCode()); + System.assertEquals(inlineObject12.hashCode(), inlineObject12.hashCode()); + } + + @isTest + private static void equalInstancesHaveSameHashCode() { + OASInlineObject1 inlineObject11 = OASInlineObject1.getExample(); + OASInlineObject1 inlineObject12 = OASInlineObject1.getExample(); + OASInlineObject1 inlineObject13 = new OASInlineObject1(); + OASInlineObject1 inlineObject14 = new OASInlineObject1(); + + System.assert(inlineObject11.equals(inlineObject12)); + System.assert(inlineObject13.equals(inlineObject14)); + System.assertEquals(inlineObject11.hashCode(), inlineObject12.hashCode()); + System.assertEquals(inlineObject13.hashCode(), inlineObject14.hashCode()); + } +} diff --git a/samples/client/petstore/apex/force-app/main/default/classes/OASInlineObject1Test.cls-meta.xml b/samples/client/petstore/apex/force-app/main/default/classes/OASInlineObject1Test.cls-meta.xml new file mode 100644 index 000000000000..fec71a26693f --- /dev/null +++ b/samples/client/petstore/apex/force-app/main/default/classes/OASInlineObject1Test.cls-meta.xml @@ -0,0 +1,5 @@ + + + 42.0 + Active + diff --git a/samples/client/petstore/apex/force-app/main/default/classes/OASInlineObjectTest.cls b/samples/client/petstore/apex/force-app/main/default/classes/OASInlineObjectTest.cls new file mode 100644 index 000000000000..a93b4a228e91 --- /dev/null +++ b/samples/client/petstore/apex/force-app/main/default/classes/OASInlineObjectTest.cls @@ -0,0 +1,71 @@ +@isTest +private class OASInlineObjectTest { + @isTest + private static void equalsSameInstance() { + OASInlineObject inlineObject1 = OASInlineObject.getExample(); + OASInlineObject inlineObject2 = inlineObject1; + OASInlineObject inlineObject3 = new OASInlineObject(); + OASInlineObject inlineObject4 = inlineObject3; + + System.assert(inlineObject1.equals(inlineObject2)); + System.assert(inlineObject2.equals(inlineObject1)); + System.assert(inlineObject1.equals(inlineObject1)); + System.assert(inlineObject3.equals(inlineObject4)); + System.assert(inlineObject4.equals(inlineObject3)); + System.assert(inlineObject3.equals(inlineObject3)); + } + + @isTest + private static void equalsIdenticalInstance() { + OASInlineObject inlineObject1 = OASInlineObject.getExample(); + OASInlineObject inlineObject2 = OASInlineObject.getExample(); + OASInlineObject inlineObject3 = new OASInlineObject(); + OASInlineObject inlineObject4 = new OASInlineObject(); + + System.assert(inlineObject1.equals(inlineObject2)); + System.assert(inlineObject2.equals(inlineObject1)); + System.assert(inlineObject3.equals(inlineObject4)); + System.assert(inlineObject4.equals(inlineObject3)); + } + + @isTest + private static void notEqualsDifferentType() { + OASInlineObject inlineObject1 = OASInlineObject.getExample(); + OASInlineObject inlineObject2 = new OASInlineObject(); + + System.assertEquals(false, inlineObject1.equals('foo')); + System.assertEquals(false, inlineObject2.equals('foo')); + } + + @isTest + private static void notEqualsNull() { + OASInlineObject inlineObject1 = OASInlineObject.getExample(); + OASInlineObject inlineObject2 = new OASInlineObject(); + OASInlineObject inlineObject3; + + System.assertEquals(false, inlineObject1.equals(inlineObject3)); + System.assertEquals(false, inlineObject2.equals(inlineObject3)); + } + + @isTest + private static void consistentHashCodeValue() { + OASInlineObject inlineObject1 = OASInlineObject.getExample(); + OASInlineObject inlineObject2 = new OASInlineObject(); + + System.assertEquals(inlineObject1.hashCode(), inlineObject1.hashCode()); + System.assertEquals(inlineObject2.hashCode(), inlineObject2.hashCode()); + } + + @isTest + private static void equalInstancesHaveSameHashCode() { + OASInlineObject inlineObject1 = OASInlineObject.getExample(); + OASInlineObject inlineObject2 = OASInlineObject.getExample(); + OASInlineObject inlineObject3 = new OASInlineObject(); + OASInlineObject inlineObject4 = new OASInlineObject(); + + System.assert(inlineObject1.equals(inlineObject2)); + System.assert(inlineObject3.equals(inlineObject4)); + System.assertEquals(inlineObject1.hashCode(), inlineObject2.hashCode()); + System.assertEquals(inlineObject3.hashCode(), inlineObject4.hashCode()); + } +} diff --git a/samples/client/petstore/apex/force-app/main/default/classes/OASInlineObjectTest.cls-meta.xml b/samples/client/petstore/apex/force-app/main/default/classes/OASInlineObjectTest.cls-meta.xml new file mode 100644 index 000000000000..fec71a26693f --- /dev/null +++ b/samples/client/petstore/apex/force-app/main/default/classes/OASInlineObjectTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 42.0 + Active + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator-ignore b/samples/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator-ignore index e7a7363b7540..d323263b54ed 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator-ignore +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator-ignore @@ -1,25 +1,4 @@ # OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md - +# This test file has changes required for testing and should not be overwritten src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator-ignore b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator-ignore index e7a7363b7540..9e4fc9202342 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator-ignore +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator-ignore @@ -1,25 +1,4 @@ # OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md - +# This project file holds config used in "live" testing src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj + diff --git a/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator-ignore b/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator-ignore index 7484ee590a38..677a9537e9ec 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator-ignore +++ b/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator-ignore @@ -1,23 +1,4 @@ # OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator +# The test project must embed linux-logo.png so it can be loaded as a stream. +src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/FILES b/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/FILES index 22b0c1f3da54..059bcf471cc9 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/FILES +++ b/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/FILES @@ -60,7 +60,6 @@ docs/UserApi.md docs/XmlItem.md git_push.sh mono_nunit_test.sh -src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj src/Org.OpenAPITools.Test/packages.config src/Org.OpenAPITools/Api/AnotherFakeApi.cs src/Org.OpenAPITools/Api/FakeApi.cs diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/.openapi-generator/FILES b/samples/client/petstore/dart/flutter_petstore/openapi/.openapi-generator/FILES index 24f6494aeca6..27a3d629cc28 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/.openapi-generator/FILES +++ b/samples/client/petstore/dart/flutter_petstore/openapi/.openapi-generator/FILES @@ -4,6 +4,8 @@ README.md doc/ApiResponse.md doc/Category.md +doc/InlineObject.md +doc/InlineObject1.md doc/Order.md doc/Pet.md doc/PetApi.md @@ -26,6 +28,8 @@ lib/auth/http_bearer_auth.dart lib/auth/oauth.dart lib/model/api_response.dart lib/model/category.dart +lib/model/inline_object.dart +lib/model/inline_object1.dart lib/model/order.dart lib/model/pet.dart lib/model/tag.dart diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/README.md b/samples/client/petstore/dart/flutter_petstore/openapi/README.md index 79b7a9edc28b..014ee45392ba 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/README.md +++ b/samples/client/petstore/dart/flutter_petstore/openapi/README.md @@ -47,10 +47,11 @@ import 'package:openapi/api.dart'; //openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; var api_instance = new PetApi(); -var body = new Pet(); // Pet | Pet object that needs to be added to the store +var pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - api_instance.addPet(body); + var result = api_instance.addPet(pet); + print(result); } catch (e) { print("Exception when calling PetApi->addPet: $e\n"); } @@ -89,6 +90,8 @@ Class | Method | HTTP request | Description - [ApiResponse](doc//ApiResponse.md) - [Category](doc//Category.md) + - [InlineObject](doc//InlineObject.md) + - [InlineObject1](doc//InlineObject1.md) - [Order](doc//Order.md) - [Pet](doc//Pet.md) - [Tag](doc//Tag.md) diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/doc/PetApi.md b/samples/client/petstore/dart/flutter_petstore/openapi/doc/PetApi.md index 5780e7f38022..3a188dec3b3e 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/doc/PetApi.md +++ b/samples/client/petstore/dart/flutter_petstore/openapi/doc/PetApi.md @@ -20,7 +20,7 @@ Method | HTTP request | Description # **addPet** -> addPet(body) +> Pet addPet(pet) Add a new pet to the store @@ -31,10 +31,11 @@ import 'package:openapi/api.dart'; //openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; var api_instance = new PetApi(); -var body = new Pet(); // Pet | Pet object that needs to be added to the store +var pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - api_instance.addPet(body); + var result = api_instance.addPet(pet); + print(result); } catch (e) { print("Exception when calling PetApi->addPet: $e\n"); } @@ -44,11 +45,11 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type -void (empty response body) +[**Pet**](Pet.md) ### Authorization @@ -57,7 +58,7 @@ void (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: Not defined + - **Accept**: application/xml, application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -243,7 +244,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **updatePet** -> updatePet(body) +> Pet updatePet(pet) Update an existing pet @@ -254,10 +255,11 @@ import 'package:openapi/api.dart'; //openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; var api_instance = new PetApi(); -var body = new Pet(); // Pet | Pet object that needs to be added to the store +var pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - api_instance.updatePet(body); + var result = api_instance.updatePet(pet); + print(result); } catch (e) { print("Exception when calling PetApi->updatePet: $e\n"); } @@ -267,11 +269,11 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type -void (empty response body) +[**Pet**](Pet.md) ### Authorization @@ -280,7 +282,7 @@ void (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: Not defined + - **Accept**: application/xml, application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/doc/StoreApi.md b/samples/client/petstore/dart/flutter_petstore/openapi/doc/StoreApi.md index df76647f11ae..a3c03643770d 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/doc/StoreApi.md +++ b/samples/client/petstore/dart/flutter_petstore/openapi/doc/StoreApi.md @@ -144,7 +144,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **placeOrder** -> Order placeOrder(body) +> Order placeOrder(order) Place an order for a pet @@ -153,10 +153,10 @@ Place an order for a pet import 'package:openapi/api.dart'; var api_instance = new StoreApi(); -var body = new Order(); // Order | order placed for purchasing the pet +var order = new Order(); // Order | order placed for purchasing the pet try { - var result = api_instance.placeOrder(body); + var result = api_instance.placeOrder(order); print(result); } catch (e) { print("Exception when calling StoreApi->placeOrder: $e\n"); @@ -167,7 +167,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | + **order** | [**Order**](Order.md)| order placed for purchasing the pet | ### Return type @@ -179,7 +179,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/xml, application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/doc/UserApi.md b/samples/client/petstore/dart/flutter_petstore/openapi/doc/UserApi.md index d3bb61265e9a..ca539ab556f7 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/doc/UserApi.md +++ b/samples/client/petstore/dart/flutter_petstore/openapi/doc/UserApi.md @@ -20,7 +20,7 @@ Method | HTTP request | Description # **createUser** -> createUser(body) +> createUser(user) Create user @@ -29,12 +29,16 @@ This can only be done by the logged in user. ### Example ```dart import 'package:openapi/api.dart'; +// TODO Configure API key authorization: api_key +//openapi.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//openapi.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer"; var api_instance = new UserApi(); -var body = new User(); // User | Created user object +var user = new User(); // User | Created user object try { - api_instance.createUser(body); + api_instance.createUser(user); } catch (e) { print("Exception when calling UserApi->createUser: $e\n"); } @@ -44,7 +48,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | + **user** | [**User**](User.md)| Created user object | ### Return type @@ -52,29 +56,33 @@ void (empty response body) ### Authorization -No authorization required +[api_key](../README.md#api_key) ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **createUsersWithArrayInput** -> createUsersWithArrayInput(body) +> createUsersWithArrayInput(user) Creates list of users with given input array ### Example ```dart import 'package:openapi/api.dart'; +// TODO Configure API key authorization: api_key +//openapi.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//openapi.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer"; var api_instance = new UserApi(); -var body = [new List<User>()]; // List | List of user object +var user = [new List<User>()]; // List | List of user object try { - api_instance.createUsersWithArrayInput(body); + api_instance.createUsersWithArrayInput(user); } catch (e) { print("Exception when calling UserApi->createUsersWithArrayInput: $e\n"); } @@ -84,7 +92,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | + **user** | [**List<User>**](User.md)| List of user object | ### Return type @@ -92,29 +100,33 @@ void (empty response body) ### Authorization -No authorization required +[api_key](../README.md#api_key) ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **createUsersWithListInput** -> createUsersWithListInput(body) +> createUsersWithListInput(user) Creates list of users with given input array ### Example ```dart import 'package:openapi/api.dart'; +// TODO Configure API key authorization: api_key +//openapi.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//openapi.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer"; var api_instance = new UserApi(); -var body = [new List<User>()]; // List | List of user object +var user = [new List<User>()]; // List | List of user object try { - api_instance.createUsersWithListInput(body); + api_instance.createUsersWithListInput(user); } catch (e) { print("Exception when calling UserApi->createUsersWithListInput: $e\n"); } @@ -124,7 +136,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | + **user** | [**List<User>**](User.md)| List of user object | ### Return type @@ -132,11 +144,11 @@ void (empty response body) ### Authorization -No authorization required +[api_key](../README.md#api_key) ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -151,6 +163,10 @@ This can only be done by the logged in user. ### Example ```dart import 'package:openapi/api.dart'; +// TODO Configure API key authorization: api_key +//openapi.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//openapi.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer"; var api_instance = new UserApi(); var username = username_example; // String | The name that needs to be deleted @@ -174,7 +190,7 @@ void (empty response body) ### Authorization -No authorization required +[api_key](../README.md#api_key) ### HTTP request headers @@ -275,6 +291,10 @@ Logs out current logged in user session ### Example ```dart import 'package:openapi/api.dart'; +// TODO Configure API key authorization: api_key +//openapi.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//openapi.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer"; var api_instance = new UserApi(); @@ -294,7 +314,7 @@ void (empty response body) ### Authorization -No authorization required +[api_key](../README.md#api_key) ### HTTP request headers @@ -304,7 +324,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **updateUser** -> updateUser(username, body) +> updateUser(username, user) Updated user @@ -313,13 +333,17 @@ This can only be done by the logged in user. ### Example ```dart import 'package:openapi/api.dart'; +// TODO Configure API key authorization: api_key +//openapi.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//openapi.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer"; var api_instance = new UserApi(); var username = username_example; // String | name that need to be deleted -var body = new User(); // User | Updated user object +var user = new User(); // User | Updated user object try { - api_instance.updateUser(username, body); + api_instance.updateUser(username, user); } catch (e) { print("Exception when calling UserApi->updateUser: $e\n"); } @@ -330,7 +354,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| name that need to be deleted | [default to null] - **body** | [**User**](User.md)| Updated user object | + **user** | [**User**](User.md)| Updated user object | ### Return type @@ -338,11 +362,11 @@ void (empty response body) ### Authorization -No authorization required +[api_key](../README.md#api_key) ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api.dart index 9a64a5342b4a..4889d9c292e9 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api.dart @@ -18,6 +18,8 @@ part 'api/user_api.dart'; part 'model/api_response.dart'; part 'model/category.dart'; +part 'model/inline_object.dart'; +part 'model/inline_object1.dart'; part 'model/order.dart'; part 'model/pet.dart'; part 'model/tag.dart'; diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/pet_api.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/pet_api.dart index 6ffc146490b8..8b68bf54e1da 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/pet_api.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/pet_api.dart @@ -10,12 +10,12 @@ class PetApi { /// Add a new pet to the store /// /// - Future addPet(Pet body) async { - Object postBody = body; + Future addPet(Pet pet) async { + Object postBody = pet; // verify required params are set - if(body == null) { - throw new ApiException(400, "Missing required param: body"); + if(pet == null) { + throw new ApiException(400, "Missing required param: pet"); } // create path and map variables @@ -52,8 +52,9 @@ class PetApi { if(response.statusCode >= 400) { throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { + return apiClient.deserialize(_decodeBodyBytes(response), 'Pet') as Pet; } else { - return; + return null; } } /// Deletes a pet @@ -261,12 +262,12 @@ class PetApi { /// Update an existing pet /// /// - Future updatePet(Pet body) async { - Object postBody = body; + Future updatePet(Pet pet) async { + Object postBody = pet; // verify required params are set - if(body == null) { - throw new ApiException(400, "Missing required param: body"); + if(pet == null) { + throw new ApiException(400, "Missing required param: pet"); } // create path and map variables @@ -303,8 +304,9 @@ class PetApi { if(response.statusCode >= 400) { throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { + return apiClient.deserialize(_decodeBodyBytes(response), 'Pet') as Pet; } else { - return; + return null; } } /// Updates a pet in the store with form data diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/store_api.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/store_api.dart index 7475aa4d9901..122b2a3e6c5c 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/store_api.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/store_api.dart @@ -157,12 +157,12 @@ class StoreApi { /// Place an order for a pet /// /// - Future placeOrder(Order body) async { - Object postBody = body; + Future placeOrder(Order order) async { + Object postBody = order; // verify required params are set - if(body == null) { - throw new ApiException(400, "Missing required param: body"); + if(order == null) { + throw new ApiException(400, "Missing required param: order"); } // create path and map variables @@ -173,7 +173,7 @@ class StoreApi { Map headerParams = {}; Map formParams = {}; - List contentTypes = []; + List contentTypes = ["application/json"]; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/user_api.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/user_api.dart index 8f00081a8c4c..a1d232be9cc0 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/user_api.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/user_api.dart @@ -10,12 +10,12 @@ class UserApi { /// Create user /// /// This can only be done by the logged in user. - Future createUser(User body) async { - Object postBody = body; + Future createUser(User user) async { + Object postBody = user; // verify required params are set - if(body == null) { - throw new ApiException(400, "Missing required param: body"); + if(user == null) { + throw new ApiException(400, "Missing required param: user"); } // create path and map variables @@ -26,10 +26,10 @@ class UserApi { Map headerParams = {}; Map formParams = {}; - List contentTypes = []; + List contentTypes = ["application/json"]; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - List authNames = []; + List authNames = ["api_key"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; @@ -59,12 +59,12 @@ class UserApi { /// Creates list of users with given input array /// /// - Future createUsersWithArrayInput(List body) async { - Object postBody = body; + Future createUsersWithArrayInput(List user) async { + Object postBody = user; // verify required params are set - if(body == null) { - throw new ApiException(400, "Missing required param: body"); + if(user == null) { + throw new ApiException(400, "Missing required param: user"); } // create path and map variables @@ -75,10 +75,10 @@ class UserApi { Map headerParams = {}; Map formParams = {}; - List contentTypes = []; + List contentTypes = ["application/json"]; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - List authNames = []; + List authNames = ["api_key"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; @@ -108,12 +108,12 @@ class UserApi { /// Creates list of users with given input array /// /// - Future createUsersWithListInput(List body) async { - Object postBody = body; + Future createUsersWithListInput(List user) async { + Object postBody = user; // verify required params are set - if(body == null) { - throw new ApiException(400, "Missing required param: body"); + if(user == null) { + throw new ApiException(400, "Missing required param: user"); } // create path and map variables @@ -124,10 +124,10 @@ class UserApi { Map headerParams = {}; Map formParams = {}; - List contentTypes = []; + List contentTypes = ["application/json"]; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - List authNames = []; + List authNames = ["api_key"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; @@ -176,7 +176,7 @@ class UserApi { List contentTypes = []; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - List authNames = []; + List authNames = ["api_key"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; @@ -327,7 +327,7 @@ class UserApi { List contentTypes = []; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - List authNames = []; + List authNames = ["api_key"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; @@ -357,15 +357,15 @@ class UserApi { /// Updated user /// /// This can only be done by the logged in user. - Future updateUser(String username, User body) async { - Object postBody = body; + Future updateUser(String username, User user) async { + Object postBody = user; // verify required params are set if(username == null) { throw new ApiException(400, "Missing required param: username"); } - if(body == null) { - throw new ApiException(400, "Missing required param: body"); + if(user == null) { + throw new ApiException(400, "Missing required param: user"); } // create path and map variables @@ -376,10 +376,10 @@ class UserApi { Map headerParams = {}; Map formParams = {}; - List contentTypes = []; + List contentTypes = ["application/json"]; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - List authNames = []; + List authNames = ["api_key"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_client.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_client.dart index 3524b1301f31..7cfb5ff0f328 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_client.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_client.dart @@ -43,6 +43,10 @@ class ApiClient { return new ApiResponse.fromJson(value); case 'Category': return new Category.fromJson(value); + case 'InlineObject': + return new InlineObject.fromJson(value); + case 'InlineObject1': + return new InlineObject1.fromJson(value); case 'Order': return new Order.fromJson(value); case 'Pet': diff --git a/samples/client/petstore/go-experimental/go-petstore/.openapi-generator/FILES b/samples/client/petstore/go-experimental/go-petstore/.openapi-generator/FILES index ff02be3b9e9f..dda891d9edb7 100644 --- a/samples/client/petstore/go-experimental/go-petstore/.openapi-generator/FILES +++ b/samples/client/petstore/go-experimental/go-petstore/.openapi-generator/FILES @@ -1,5 +1,4 @@ .gitignore -.openapi-generator-ignore .travis.yml README.md api/openapi.yaml diff --git a/samples/client/petstore/go/go-petstore-withXml/.openapi-generator/FILES b/samples/client/petstore/go/go-petstore-withXml/.openapi-generator/FILES index 11af8052487e..28a8ffd70f16 100644 --- a/samples/client/petstore/go/go-petstore-withXml/.openapi-generator/FILES +++ b/samples/client/petstore/go/go-petstore-withXml/.openapi-generator/FILES @@ -1,5 +1,4 @@ .gitignore -.openapi-generator-ignore .travis.yml README.md api/openapi.yaml diff --git a/samples/client/petstore/go/go-petstore/.openapi-generator/FILES b/samples/client/petstore/go/go-petstore/.openapi-generator/FILES index 11af8052487e..28a8ffd70f16 100644 --- a/samples/client/petstore/go/go-petstore/.openapi-generator/FILES +++ b/samples/client/petstore/go/go-petstore/.openapi-generator/FILES @@ -1,5 +1,4 @@ .gitignore -.openapi-generator-ignore .travis.yml README.md api/openapi.yaml diff --git a/samples/client/petstore/java/feign10x/.openapi-generator-ignore b/samples/client/petstore/java/feign10x/.openapi-generator-ignore index 7484ee590a38..e829446f0b8c 100644 --- a/samples/client/petstore/java/feign10x/.openapi-generator-ignore +++ b/samples/client/petstore/java/feign10x/.openapi-generator-ignore @@ -1,23 +1,4 @@ # OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator +# This is a "live" test which should not be overwritten +src/test/java/org/openapitools/client/StringUtilTest.java -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/client/petstore/java/feign10x/.openapi-generator/FILES b/samples/client/petstore/java/feign10x/.openapi-generator/FILES index 4fa1d13eeb82..1e341310444b 100644 --- a/samples/client/petstore/java/feign10x/.openapi-generator/FILES +++ b/samples/client/petstore/java/feign10x/.openapi-generator/FILES @@ -1,5 +1,4 @@ .gitignore -.openapi-generator-ignore .travis.yml README.md api/openapi.yaml diff --git a/samples/client/petstore/java/google-api-client/.openapi-generator/FILES b/samples/client/petstore/java/google-api-client/.openapi-generator/FILES index 9b1a5ed4a2cb..e6f553b3189e 100644 --- a/samples/client/petstore/java/google-api-client/.openapi-generator/FILES +++ b/samples/client/petstore/java/google-api-client/.openapi-generator/FILES @@ -1,5 +1,4 @@ .gitignore -.openapi-generator-ignore .travis.yml README.md api/openapi.yaml diff --git a/samples/client/petstore/java/jersey1/.openapi-generator-ignore b/samples/client/petstore/java/jersey1/.openapi-generator-ignore index 7484ee590a38..323ce96e73fb 100644 --- a/samples/client/petstore/java/jersey1/.openapi-generator-ignore +++ b/samples/client/petstore/java/jersey1/.openapi-generator-ignore @@ -1,23 +1,9 @@ # OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator +# These are "live" tests that should not be overwritten +src/test/java/org/openapitools/client/StringUtilTest.java +src/test/java/org/openapitools/client/ApiClientTest.java +src/test/java/org/openapitools/client/ConfigurationTest.java +src/test/java/org/openapitools/client/auth/ApiKeyAuthTest.java +src/test/java/org/openapitools/client/auth/HttpBasicAuthTest.java +src/test/java/org/openapitools/client/model/EnumValueTest.java -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/client/petstore/java/jersey1/.openapi-generator/FILES b/samples/client/petstore/java/jersey1/.openapi-generator/FILES index 02508529f32e..1c6e0a38c6eb 100644 --- a/samples/client/petstore/java/jersey1/.openapi-generator/FILES +++ b/samples/client/petstore/java/jersey1/.openapi-generator/FILES @@ -1,5 +1,4 @@ .gitignore -.openapi-generator-ignore .travis.yml README.md api/openapi.yaml diff --git a/samples/client/petstore/java/jersey2-java8/.openapi-generator-ignore b/samples/client/petstore/java/jersey2-java8/.openapi-generator-ignore index 7484ee590a38..79656709d888 100644 --- a/samples/client/petstore/java/jersey2-java8/.openapi-generator-ignore +++ b/samples/client/petstore/java/jersey2-java8/.openapi-generator-ignore @@ -1,23 +1,4 @@ # OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md +# These are "live" test files which should not be overwritten +src/test/java/org/openapitools/client/JSONTest.java +src/test/java/org/openapitools/client/JSONComposedSchemaTest.java \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2-java8/.openapi-generator/FILES b/samples/client/petstore/java/jersey2-java8/.openapi-generator/FILES index ec3057e7863d..25518623866e 100644 --- a/samples/client/petstore/java/jersey2-java8/.openapi-generator/FILES +++ b/samples/client/petstore/java/jersey2-java8/.openapi-generator/FILES @@ -1,5 +1,4 @@ .gitignore -.openapi-generator-ignore .travis.yml README.md api/openapi.yaml diff --git a/samples/client/petstore/java/microprofile-rest-client/.openapi-generator/FILES b/samples/client/petstore/java/microprofile-rest-client/.openapi-generator/FILES index b1ed7fac0243..ae145903e52b 100644 --- a/samples/client/petstore/java/microprofile-rest-client/.openapi-generator/FILES +++ b/samples/client/petstore/java/microprofile-rest-client/.openapi-generator/FILES @@ -1,4 +1,3 @@ -.openapi-generator-ignore README.md docs/Category.md docs/ModelApiResponse.md diff --git a/samples/client/petstore/java/native/.openapi-generator/FILES b/samples/client/petstore/java/native/.openapi-generator/FILES index 2614283ebd79..48923dfacbed 100644 --- a/samples/client/petstore/java/native/.openapi-generator/FILES +++ b/samples/client/petstore/java/native/.openapi-generator/FILES @@ -1,5 +1,4 @@ .gitignore -.openapi-generator-ignore .travis.yml README.md api/openapi.yaml diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator/FILES b/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator/FILES index 487da55fc8f6..3cd173237152 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator/FILES +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator/FILES @@ -1,5 +1,4 @@ .gitignore -.openapi-generator-ignore .travis.yml README.md api/openapi.yaml diff --git a/samples/client/petstore/java/okhttp-gson/.openapi-generator-ignore b/samples/client/petstore/java/okhttp-gson/.openapi-generator-ignore index 7484ee590a38..fa2ddf08fcce 100644 --- a/samples/client/petstore/java/okhttp-gson/.openapi-generator-ignore +++ b/samples/client/petstore/java/okhttp-gson/.openapi-generator-ignore @@ -1,23 +1,13 @@ # OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator +# These tests are "live" tests and should not be overwritten +src/test/java/org/openapitools/client/StringUtilTest.java +src/test/java/org/openapitools/client/ApiClientTest.java +src/test/java/org/openapitools/client/ConfigurationTest.java +src/test/java/org/openapitools/client/auth/ApiKeyAuthTest.java +src/test/java/org/openapitools/client/auth/HttpBasicAuthTest.java +src/test/java/org/openapitools/client/model/EnumValueTest.java +src/test/java/org/openapitools/client/model/PetTest.java +src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java +src/test/java/org/openapitools/client/JSONTest.java +src/test/java/org/openapitools/client/api/PetApiTest.java -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/client/petstore/java/okhttp-gson/.openapi-generator/FILES b/samples/client/petstore/java/okhttp-gson/.openapi-generator/FILES index 487da55fc8f6..3cd173237152 100644 --- a/samples/client/petstore/java/okhttp-gson/.openapi-generator/FILES +++ b/samples/client/petstore/java/okhttp-gson/.openapi-generator/FILES @@ -1,5 +1,4 @@ .gitignore -.openapi-generator-ignore .travis.yml README.md api/openapi.yaml diff --git a/samples/client/petstore/java/rest-assured-jackson/.openapi-generator/FILES b/samples/client/petstore/java/rest-assured-jackson/.openapi-generator/FILES index 1ec6b7ec4696..5f08ec35a282 100644 --- a/samples/client/petstore/java/rest-assured-jackson/.openapi-generator/FILES +++ b/samples/client/petstore/java/rest-assured-jackson/.openapi-generator/FILES @@ -1,5 +1,4 @@ .gitignore -.openapi-generator-ignore .travis.yml README.md api/openapi.yaml @@ -126,55 +125,3 @@ src/main/java/org/openapitools/client/model/TypeHolderDefault.java src/main/java/org/openapitools/client/model/TypeHolderExample.java src/main/java/org/openapitools/client/model/User.java src/main/java/org/openapitools/client/model/XmlItem.java -src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java -src/test/java/org/openapitools/client/api/FakeApiTest.java -src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java -src/test/java/org/openapitools/client/api/PetApiTest.java -src/test/java/org/openapitools/client/api/StoreApiTest.java -src/test/java/org/openapitools/client/api/UserApiTest.java -src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java -src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java -src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java -src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java -src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java -src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java -src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java -src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java -src/test/java/org/openapitools/client/model/AnimalTest.java -src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java -src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java -src/test/java/org/openapitools/client/model/ArrayTestTest.java -src/test/java/org/openapitools/client/model/BigCatAllOfTest.java -src/test/java/org/openapitools/client/model/BigCatTest.java -src/test/java/org/openapitools/client/model/CapitalizationTest.java -src/test/java/org/openapitools/client/model/CatAllOfTest.java -src/test/java/org/openapitools/client/model/CatTest.java -src/test/java/org/openapitools/client/model/CategoryTest.java -src/test/java/org/openapitools/client/model/ClassModelTest.java -src/test/java/org/openapitools/client/model/ClientTest.java -src/test/java/org/openapitools/client/model/DogAllOfTest.java -src/test/java/org/openapitools/client/model/DogTest.java -src/test/java/org/openapitools/client/model/EnumArraysTest.java -src/test/java/org/openapitools/client/model/EnumClassTest.java -src/test/java/org/openapitools/client/model/EnumTestTest.java -src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java -src/test/java/org/openapitools/client/model/FormatTestTest.java -src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java -src/test/java/org/openapitools/client/model/MapTestTest.java -src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java -src/test/java/org/openapitools/client/model/Model200ResponseTest.java -src/test/java/org/openapitools/client/model/ModelApiResponseTest.java -src/test/java/org/openapitools/client/model/ModelReturnTest.java -src/test/java/org/openapitools/client/model/NameTest.java -src/test/java/org/openapitools/client/model/NumberOnlyTest.java -src/test/java/org/openapitools/client/model/OrderTest.java -src/test/java/org/openapitools/client/model/OuterCompositeTest.java -src/test/java/org/openapitools/client/model/OuterEnumTest.java -src/test/java/org/openapitools/client/model/PetTest.java -src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java -src/test/java/org/openapitools/client/model/SpecialModelNameTest.java -src/test/java/org/openapitools/client/model/TagTest.java -src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java -src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java -src/test/java/org/openapitools/client/model/UserTest.java -src/test/java/org/openapitools/client/model/XmlItemTest.java diff --git a/samples/client/petstore/java/rest-assured/.openapi-generator/FILES b/samples/client/petstore/java/rest-assured/.openapi-generator/FILES index 788e11e8b4c8..05f54dd39263 100644 --- a/samples/client/petstore/java/rest-assured/.openapi-generator/FILES +++ b/samples/client/petstore/java/rest-assured/.openapi-generator/FILES @@ -1,5 +1,4 @@ .gitignore -.openapi-generator-ignore .travis.yml README.md api/openapi.yaml diff --git a/samples/client/petstore/java/resteasy/.openapi-generator/FILES b/samples/client/petstore/java/resteasy/.openapi-generator/FILES index dda27c587a5c..21772fc513d8 100644 --- a/samples/client/petstore/java/resteasy/.openapi-generator/FILES +++ b/samples/client/petstore/java/resteasy/.openapi-generator/FILES @@ -1,5 +1,4 @@ .gitignore -.openapi-generator-ignore .travis.yml README.md api/openapi.yaml diff --git a/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/FILES b/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/FILES index 03765b422be7..535678e0a811 100644 --- a/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/FILES +++ b/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/FILES @@ -1,5 +1,4 @@ .gitignore -.openapi-generator-ignore .travis.yml README.md api/openapi.yaml diff --git a/samples/client/petstore/java/resttemplate/.openapi-generator-ignore b/samples/client/petstore/java/resttemplate/.openapi-generator-ignore index 7484ee590a38..ff761313061c 100644 --- a/samples/client/petstore/java/resttemplate/.openapi-generator-ignore +++ b/samples/client/petstore/java/resttemplate/.openapi-generator-ignore @@ -1,23 +1,6 @@ # OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md +# These files are "live" tests which should not be overwritten. +src/test/java/org/openapitools/client/ApiClientTest.java +src/test/java/org/openapitools/client/auth/ApiKeyAuthTest.java +src/test/java/org/openapitools/client/auth/HttpBasicAuthTest.java +src/test/java/org/openapitools/client/model/EnumValueTest.java diff --git a/samples/client/petstore/java/resttemplate/.openapi-generator/FILES b/samples/client/petstore/java/resttemplate/.openapi-generator/FILES index 03765b422be7..535678e0a811 100644 --- a/samples/client/petstore/java/resttemplate/.openapi-generator/FILES +++ b/samples/client/petstore/java/resttemplate/.openapi-generator/FILES @@ -1,5 +1,4 @@ .gitignore -.openapi-generator-ignore .travis.yml README.md api/openapi.yaml diff --git a/samples/client/petstore/java/retrofit2-play24/.openapi-generator/FILES b/samples/client/petstore/java/retrofit2-play24/.openapi-generator/FILES index 99c1f65498f2..a562460201e4 100644 --- a/samples/client/petstore/java/retrofit2-play24/.openapi-generator/FILES +++ b/samples/client/petstore/java/retrofit2-play24/.openapi-generator/FILES @@ -1,5 +1,4 @@ .gitignore -.openapi-generator-ignore .travis.yml README.md api/openapi.yaml diff --git a/samples/client/petstore/java/retrofit2-play25/.openapi-generator/FILES b/samples/client/petstore/java/retrofit2-play25/.openapi-generator/FILES index be4ab8505cc0..af054bf73c15 100644 --- a/samples/client/petstore/java/retrofit2-play25/.openapi-generator/FILES +++ b/samples/client/petstore/java/retrofit2-play25/.openapi-generator/FILES @@ -1,5 +1,4 @@ .gitignore -.openapi-generator-ignore .travis.yml README.md api/openapi.yaml diff --git a/samples/client/petstore/java/retrofit2-play26/.openapi-generator/FILES b/samples/client/petstore/java/retrofit2-play26/.openapi-generator/FILES index ebda8ecef547..f9e53f21c7f8 100644 --- a/samples/client/petstore/java/retrofit2-play26/.openapi-generator/FILES +++ b/samples/client/petstore/java/retrofit2-play26/.openapi-generator/FILES @@ -1,5 +1,4 @@ .gitignore -.openapi-generator-ignore .travis.yml README.md api/openapi.yaml diff --git a/samples/client/petstore/java/retrofit2/.openapi-generator/FILES b/samples/client/petstore/java/retrofit2/.openapi-generator/FILES index 299bd8c42f85..27ea75ae653c 100644 --- a/samples/client/petstore/java/retrofit2/.openapi-generator/FILES +++ b/samples/client/petstore/java/retrofit2/.openapi-generator/FILES @@ -1,5 +1,4 @@ .gitignore -.openapi-generator-ignore .travis.yml README.md api/openapi.yaml diff --git a/samples/client/petstore/java/retrofit2rx/.openapi-generator/FILES b/samples/client/petstore/java/retrofit2rx/.openapi-generator/FILES index 299bd8c42f85..27ea75ae653c 100644 --- a/samples/client/petstore/java/retrofit2rx/.openapi-generator/FILES +++ b/samples/client/petstore/java/retrofit2rx/.openapi-generator/FILES @@ -1,5 +1,4 @@ .gitignore -.openapi-generator-ignore .travis.yml README.md api/openapi.yaml diff --git a/samples/client/petstore/java/retrofit2rx2/.openapi-generator/FILES b/samples/client/petstore/java/retrofit2rx2/.openapi-generator/FILES index 299bd8c42f85..27ea75ae653c 100644 --- a/samples/client/petstore/java/retrofit2rx2/.openapi-generator/FILES +++ b/samples/client/petstore/java/retrofit2rx2/.openapi-generator/FILES @@ -1,5 +1,4 @@ .gitignore -.openapi-generator-ignore .travis.yml README.md api/openapi.yaml diff --git a/samples/client/petstore/java/vertx/.openapi-generator/FILES b/samples/client/petstore/java/vertx/.openapi-generator/FILES index ed426605c3c4..82fed67a26fb 100644 --- a/samples/client/petstore/java/vertx/.openapi-generator/FILES +++ b/samples/client/petstore/java/vertx/.openapi-generator/FILES @@ -1,5 +1,4 @@ .gitignore -.openapi-generator-ignore .travis.yml README.md api/openapi.yaml diff --git a/samples/client/petstore/java/webclient/.openapi-generator/FILES b/samples/client/petstore/java/webclient/.openapi-generator/FILES index dd1c115a002c..bc6035c8a0e8 100644 --- a/samples/client/petstore/java/webclient/.openapi-generator/FILES +++ b/samples/client/petstore/java/webclient/.openapi-generator/FILES @@ -1,5 +1,4 @@ .gitignore -.openapi-generator-ignore .travis.yml README.md api/openapi.yaml diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator/FILES b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator/FILES index f2b161556c38..723be80c5a06 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator/FILES @@ -1,4 +1,3 @@ -.openapi-generator-ignore README.md build.gradle docs/ApiResponse.md diff --git a/samples/client/petstore/kotlin-string/.openapi-generator-ignore b/samples/client/petstore/kotlin-string/.openapi-generator-ignore index 7484ee590a38..cabbe3494d4c 100644 --- a/samples/client/petstore/kotlin-string/.openapi-generator-ignore +++ b/samples/client/petstore/kotlin-string/.openapi-generator-ignore @@ -1,23 +1,3 @@ # OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator +pom.xml -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/client/petstore/kotlin-threetenbp/.openapi-generator-ignore b/samples/client/petstore/kotlin-threetenbp/.openapi-generator-ignore index 7484ee590a38..cabbe3494d4c 100644 --- a/samples/client/petstore/kotlin-threetenbp/.openapi-generator-ignore +++ b/samples/client/petstore/kotlin-threetenbp/.openapi-generator-ignore @@ -1,23 +1,3 @@ # OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator +pom.xml -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/FILES b/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/FILES index ab9845ac2fb4..72f2a6e75849 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/FILES +++ b/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/FILES @@ -118,57 +118,3 @@ lib/Model/User.php lib/Model/XmlItem.php lib/ObjectSerializer.php phpunit.xml.dist -test/Api/AnotherFakeApiTest.php -test/Api/FakeApiTest.php -test/Api/FakeClassnameTags123ApiTest.php -test/Api/PetApiTest.php -test/Api/StoreApiTest.php -test/Api/UserApiTest.php -test/Model/AdditionalPropertiesAnyTypeTest.php -test/Model/AdditionalPropertiesArrayTest.php -test/Model/AdditionalPropertiesBooleanTest.php -test/Model/AdditionalPropertiesClassTest.php -test/Model/AdditionalPropertiesIntegerTest.php -test/Model/AdditionalPropertiesNumberTest.php -test/Model/AdditionalPropertiesObjectTest.php -test/Model/AdditionalPropertiesStringTest.php -test/Model/AnimalTest.php -test/Model/ApiResponseTest.php -test/Model/ArrayOfArrayOfNumberOnlyTest.php -test/Model/ArrayOfNumberOnlyTest.php -test/Model/ArrayTestTest.php -test/Model/BigCatAllOfTest.php -test/Model/BigCatTest.php -test/Model/CapitalizationTest.php -test/Model/CatAllOfTest.php -test/Model/CatTest.php -test/Model/CategoryTest.php -test/Model/ClassModelTest.php -test/Model/ClientTest.php -test/Model/DogAllOfTest.php -test/Model/DogTest.php -test/Model/EnumArraysTest.php -test/Model/EnumClassTest.php -test/Model/EnumTestTest.php -test/Model/FileSchemaTestClassTest.php -test/Model/FileTest.php -test/Model/FormatTestTest.php -test/Model/HasOnlyReadOnlyTest.php -test/Model/MapTestTest.php -test/Model/MixedPropertiesAndAdditionalPropertiesClassTest.php -test/Model/Model200ResponseTest.php -test/Model/ModelListTest.php -test/Model/ModelReturnTest.php -test/Model/NameTest.php -test/Model/NumberOnlyTest.php -test/Model/OrderTest.php -test/Model/OuterCompositeTest.php -test/Model/OuterEnumTest.php -test/Model/PetTest.php -test/Model/ReadOnlyFirstTest.php -test/Model/SpecialModelNameTest.php -test/Model/TagTest.php -test/Model/TypeHolderDefaultTest.php -test/Model/TypeHolderExampleTest.php -test/Model/UserTest.php -test/Model/XmlItemTest.php diff --git a/samples/client/petstore/ruby-faraday/.openapi-generator/FILES b/samples/client/petstore/ruby-faraday/.openapi-generator/FILES index 1bb03794c747..dff9045f9ba1 100644 --- a/samples/client/petstore/ruby-faraday/.openapi-generator/FILES +++ b/samples/client/petstore/ruby-faraday/.openapi-generator/FILES @@ -32,6 +32,12 @@ docs/Foo.md docs/FormatTest.md docs/HasOnlyReadOnly.md docs/HealthCheckResult.md +docs/InlineObject.md +docs/InlineObject1.md +docs/InlineObject2.md +docs/InlineObject3.md +docs/InlineObject4.md +docs/InlineObject5.md docs/InlineResponseDefault.md docs/List.md docs/MapTest.md @@ -91,6 +97,12 @@ lib/petstore/models/foo.rb lib/petstore/models/format_test.rb lib/petstore/models/has_only_read_only.rb lib/petstore/models/health_check_result.rb +lib/petstore/models/inline_object.rb +lib/petstore/models/inline_object1.rb +lib/petstore/models/inline_object2.rb +lib/petstore/models/inline_object3.rb +lib/petstore/models/inline_object4.rb +lib/petstore/models/inline_object5.rb lib/petstore/models/inline_response_default.rb lib/petstore/models/list.rb lib/petstore/models/map_test.rb @@ -113,56 +125,6 @@ lib/petstore/models/tag.rb lib/petstore/models/user.rb lib/petstore/version.rb petstore.gemspec -spec/api/another_fake_api_spec.rb -spec/api/default_api_spec.rb -spec/api/fake_api_spec.rb -spec/api/fake_classname_tags123_api_spec.rb -spec/api/pet_api_spec.rb -spec/api/store_api_spec.rb -spec/api/user_api_spec.rb spec/api_client_spec.rb spec/configuration_spec.rb -spec/models/additional_properties_class_spec.rb -spec/models/animal_spec.rb -spec/models/api_response_spec.rb -spec/models/array_of_array_of_number_only_spec.rb -spec/models/array_of_number_only_spec.rb -spec/models/array_test_spec.rb -spec/models/capitalization_spec.rb -spec/models/cat_all_of_spec.rb -spec/models/cat_spec.rb -spec/models/category_spec.rb -spec/models/class_model_spec.rb -spec/models/client_spec.rb -spec/models/dog_all_of_spec.rb -spec/models/dog_spec.rb -spec/models/enum_arrays_spec.rb -spec/models/enum_class_spec.rb -spec/models/enum_test_spec.rb -spec/models/file_schema_test_class_spec.rb -spec/models/file_spec.rb -spec/models/foo_spec.rb -spec/models/format_test_spec.rb -spec/models/has_only_read_only_spec.rb -spec/models/health_check_result_spec.rb -spec/models/inline_response_default_spec.rb -spec/models/list_spec.rb -spec/models/map_test_spec.rb -spec/models/mixed_properties_and_additional_properties_class_spec.rb -spec/models/model200_response_spec.rb -spec/models/model_return_spec.rb -spec/models/name_spec.rb -spec/models/nullable_class_spec.rb -spec/models/number_only_spec.rb -spec/models/order_spec.rb -spec/models/outer_composite_spec.rb -spec/models/outer_enum_default_value_spec.rb -spec/models/outer_enum_integer_default_value_spec.rb -spec/models/outer_enum_integer_spec.rb -spec/models/outer_enum_spec.rb -spec/models/pet_spec.rb -spec/models/read_only_first_spec.rb -spec/models/special_model_name_spec.rb -spec/models/tag_spec.rb -spec/models/user_spec.rb spec/spec_helper.rb diff --git a/samples/client/petstore/ruby-faraday/README.md b/samples/client/petstore/ruby-faraday/README.md index 35c76f3817e4..719039e53116 100644 --- a/samples/client/petstore/ruby-faraday/README.md +++ b/samples/client/petstore/ruby-faraday/README.md @@ -141,6 +141,12 @@ Class | Method | HTTP request | Description - [Petstore::FormatTest](docs/FormatTest.md) - [Petstore::HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - [Petstore::HealthCheckResult](docs/HealthCheckResult.md) + - [Petstore::InlineObject](docs/InlineObject.md) + - [Petstore::InlineObject1](docs/InlineObject1.md) + - [Petstore::InlineObject2](docs/InlineObject2.md) + - [Petstore::InlineObject3](docs/InlineObject3.md) + - [Petstore::InlineObject4](docs/InlineObject4.md) + - [Petstore::InlineObject5](docs/InlineObject5.md) - [Petstore::InlineResponseDefault](docs/InlineResponseDefault.md) - [Petstore::List](docs/List.md) - [Petstore::MapTest](docs/MapTest.md) diff --git a/samples/client/petstore/ruby-faraday/docs/InlineObject.md b/samples/client/petstore/ruby-faraday/docs/InlineObject.md new file mode 100644 index 000000000000..f5211d44464c --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/InlineObject.md @@ -0,0 +1,19 @@ +# Petstore::InlineObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Updated name of the pet | [optional] +**status** | **String** | Updated status of the pet | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::InlineObject.new(name: null, + status: null) +``` + + diff --git a/samples/client/petstore/ruby-faraday/docs/InlineObject1.md b/samples/client/petstore/ruby-faraday/docs/InlineObject1.md new file mode 100644 index 000000000000..bac17e753cdc --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/InlineObject1.md @@ -0,0 +1,19 @@ +# Petstore::InlineObject1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**additional_metadata** | **String** | Additional data to pass to server | [optional] +**file** | **File** | file to upload | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::InlineObject1.new(additional_metadata: null, + file: null) +``` + + diff --git a/samples/client/petstore/ruby-faraday/docs/InlineObject2.md b/samples/client/petstore/ruby-faraday/docs/InlineObject2.md new file mode 100644 index 000000000000..31118c5b262e --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/InlineObject2.md @@ -0,0 +1,19 @@ +# Petstore::InlineObject2 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enum_form_string_array** | **Array<String>** | Form parameter enum test (string array) | [optional] +**enum_form_string** | **String** | Form parameter enum test (string) | [optional] [default to '-efg'] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::InlineObject2.new(enum_form_string_array: null, + enum_form_string: null) +``` + + diff --git a/samples/client/petstore/ruby-faraday/docs/InlineObject3.md b/samples/client/petstore/ruby-faraday/docs/InlineObject3.md new file mode 100644 index 000000000000..b6cb7ccb29b1 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/InlineObject3.md @@ -0,0 +1,43 @@ +# Petstore::InlineObject3 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integer** | **Integer** | None | [optional] +**int32** | **Integer** | None | [optional] +**int64** | **Integer** | None | [optional] +**number** | **Float** | None | +**float** | **Float** | None | [optional] +**double** | **Float** | None | +**string** | **String** | None | [optional] +**pattern_without_delimiter** | **String** | None | +**byte** | **String** | None | +**binary** | **File** | None | [optional] +**date** | **Date** | None | [optional] +**date_time** | **DateTime** | None | [optional] +**password** | **String** | None | [optional] +**callback** | **String** | None | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::InlineObject3.new(integer: null, + int32: null, + int64: null, + number: null, + float: null, + double: null, + string: null, + pattern_without_delimiter: null, + byte: null, + binary: null, + date: null, + date_time: null, + password: null, + callback: null) +``` + + diff --git a/samples/client/petstore/ruby-faraday/docs/InlineObject4.md b/samples/client/petstore/ruby-faraday/docs/InlineObject4.md new file mode 100644 index 000000000000..97179c3e3772 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/InlineObject4.md @@ -0,0 +1,19 @@ +# Petstore::InlineObject4 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**param** | **String** | field1 | +**param2** | **String** | field2 | + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::InlineObject4.new(param: null, + param2: null) +``` + + diff --git a/samples/client/petstore/ruby-faraday/docs/InlineObject5.md b/samples/client/petstore/ruby-faraday/docs/InlineObject5.md new file mode 100644 index 000000000000..23c1df99ffeb --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/InlineObject5.md @@ -0,0 +1,19 @@ +# Petstore::InlineObject5 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**additional_metadata** | **String** | Additional data to pass to server | [optional] +**required_file** | **File** | file to upload | + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::InlineObject5.new(additional_metadata: null, + required_file: null) +``` + + diff --git a/samples/client/petstore/ruby-faraday/lib/petstore.rb b/samples/client/petstore/ruby-faraday/lib/petstore.rb index f0df2170db08..7f8ae56e123b 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore.rb @@ -40,6 +40,12 @@ require 'petstore/models/format_test' require 'petstore/models/has_only_read_only' require 'petstore/models/health_check_result' +require 'petstore/models/inline_object' +require 'petstore/models/inline_object1' +require 'petstore/models/inline_object2' +require 'petstore/models/inline_object3' +require 'petstore/models/inline_object4' +require 'petstore/models/inline_object5' require 'petstore/models/inline_response_default' require 'petstore/models/list' require 'petstore/models/map_test' diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object.rb new file mode 100644 index 000000000000..7d2ce0e05f39 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object.rb @@ -0,0 +1,217 @@ +=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: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.0.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class InlineObject + # Updated name of the pet + attr_accessor :name + + # Updated status of the pet + attr_accessor :status + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'name', + :'status' => :'status' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'name' => :'String', + :'status' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::InlineObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::InlineObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + 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 + 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 && + name == o.name && + status == o.status + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [name, status].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + 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 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 + Petstore.const_get(type).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) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + 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-faraday/lib/petstore/models/inline_object1.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object1.rb new file mode 100644 index 000000000000..45a9d5bfcd72 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object1.rb @@ -0,0 +1,217 @@ +=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: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.0.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class InlineObject1 + # Additional data to pass to server + attr_accessor :additional_metadata + + # file to upload + attr_accessor :file + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'additional_metadata' => :'additionalMetadata', + :'file' => :'file' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'additional_metadata' => :'String', + :'file' => :'File' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::InlineObject1` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::InlineObject1`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'additional_metadata') + self.additional_metadata = attributes[:'additional_metadata'] + end + + if attributes.key?(:'file') + self.file = attributes[:'file'] + 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 + 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 && + additional_metadata == o.additional_metadata && + file == o.file + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [additional_metadata, file].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + 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 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 + Petstore.const_get(type).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) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + 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-faraday/lib/petstore/models/inline_object2.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object2.rb new file mode 100644 index 000000000000..51784af066b6 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object2.rb @@ -0,0 +1,255 @@ +=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: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.0.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class InlineObject2 + # Form parameter enum test (string array) + attr_accessor :enum_form_string_array + + # Form parameter enum test (string) + attr_accessor :enum_form_string + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'enum_form_string_array' => :'enum_form_string_array', + :'enum_form_string' => :'enum_form_string' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'enum_form_string_array' => :'Array', + :'enum_form_string' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::InlineObject2` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::InlineObject2`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'enum_form_string_array') + if (value = attributes[:'enum_form_string_array']).is_a?(Array) + self.enum_form_string_array = value + end + end + + if attributes.key?(:'enum_form_string') + self.enum_form_string = attributes[:'enum_form_string'] + else + self.enum_form_string = '-efg' + 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 + 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? + enum_form_string_validator = EnumAttributeValidator.new('String', ["_abc", "-efg", "(xyz)"]) + return false unless enum_form_string_validator.valid?(@enum_form_string) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] enum_form_string Object to be assigned + def enum_form_string=(enum_form_string) + validator = EnumAttributeValidator.new('String', ["_abc", "-efg", "(xyz)"]) + unless validator.valid?(enum_form_string) + fail ArgumentError, "invalid value for \"enum_form_string\", must be one of #{validator.allowable_values}." + end + @enum_form_string = enum_form_string + 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 && + enum_form_string_array == o.enum_form_string_array && + enum_form_string == o.enum_form_string + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [enum_form_string_array, enum_form_string].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + 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 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 + Petstore.const_get(type).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) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + 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-faraday/lib/petstore/models/inline_object3.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object3.rb new file mode 100644 index 000000000000..71fe8bd38a82 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object3.rb @@ -0,0 +1,538 @@ +=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: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.0.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class InlineObject3 + # None + attr_accessor :integer + + # None + attr_accessor :int32 + + # None + attr_accessor :int64 + + # None + attr_accessor :number + + # None + attr_accessor :float + + # None + attr_accessor :double + + # None + attr_accessor :string + + # None + attr_accessor :pattern_without_delimiter + + # None + attr_accessor :byte + + # None + attr_accessor :binary + + # None + attr_accessor :date + + # None + attr_accessor :date_time + + # None + attr_accessor :password + + # None + attr_accessor :callback + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'integer' => :'integer', + :'int32' => :'int32', + :'int64' => :'int64', + :'number' => :'number', + :'float' => :'float', + :'double' => :'double', + :'string' => :'string', + :'pattern_without_delimiter' => :'pattern_without_delimiter', + :'byte' => :'byte', + :'binary' => :'binary', + :'date' => :'date', + :'date_time' => :'dateTime', + :'password' => :'password', + :'callback' => :'callback' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'integer' => :'Integer', + :'int32' => :'Integer', + :'int64' => :'Integer', + :'number' => :'Float', + :'float' => :'Float', + :'double' => :'Float', + :'string' => :'String', + :'pattern_without_delimiter' => :'String', + :'byte' => :'String', + :'binary' => :'File', + :'date' => :'Date', + :'date_time' => :'DateTime', + :'password' => :'String', + :'callback' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::InlineObject3` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::InlineObject3`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'integer') + self.integer = attributes[:'integer'] + end + + if attributes.key?(:'int32') + self.int32 = attributes[:'int32'] + end + + if attributes.key?(:'int64') + self.int64 = attributes[:'int64'] + end + + if attributes.key?(:'number') + self.number = attributes[:'number'] + end + + if attributes.key?(:'float') + self.float = attributes[:'float'] + end + + if attributes.key?(:'double') + self.double = attributes[:'double'] + end + + if attributes.key?(:'string') + self.string = attributes[:'string'] + end + + if attributes.key?(:'pattern_without_delimiter') + self.pattern_without_delimiter = attributes[:'pattern_without_delimiter'] + end + + if attributes.key?(:'byte') + self.byte = attributes[:'byte'] + end + + if attributes.key?(:'binary') + self.binary = attributes[:'binary'] + end + + if attributes.key?(:'date') + self.date = attributes[:'date'] + end + + if attributes.key?(:'date_time') + self.date_time = attributes[:'date_time'] + end + + if attributes.key?(:'password') + self.password = attributes[:'password'] + end + + if attributes.key?(:'callback') + self.callback = attributes[:'callback'] + 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 !@integer.nil? && @integer > 100 + invalid_properties.push('invalid value for "integer", must be smaller than or equal to 100.') + end + + if !@integer.nil? && @integer < 10 + invalid_properties.push('invalid value for "integer", must be greater than or equal to 10.') + end + + if !@int32.nil? && @int32 > 200 + invalid_properties.push('invalid value for "int32", must be smaller than or equal to 200.') + end + + if !@int32.nil? && @int32 < 20 + invalid_properties.push('invalid value for "int32", must be greater than or equal to 20.') + end + + if @number.nil? + invalid_properties.push('invalid value for "number", number cannot be nil.') + end + + if @number > 543.2 + invalid_properties.push('invalid value for "number", must be smaller than or equal to 543.2.') + end + + if @number < 32.1 + invalid_properties.push('invalid value for "number", must be greater than or equal to 32.1.') + end + + if !@float.nil? && @float > 987.6 + invalid_properties.push('invalid value for "float", must be smaller than or equal to 987.6.') + end + + if @double.nil? + invalid_properties.push('invalid value for "double", double cannot be nil.') + end + + if @double > 123.4 + invalid_properties.push('invalid value for "double", must be smaller than or equal to 123.4.') + end + + if @double < 67.8 + invalid_properties.push('invalid value for "double", must be greater than or equal to 67.8.') + end + + pattern = Regexp.new(/[a-z]/i) + if !@string.nil? && @string !~ pattern + invalid_properties.push("invalid value for \"string\", must conform to the pattern #{pattern}.") + end + + if @pattern_without_delimiter.nil? + invalid_properties.push('invalid value for "pattern_without_delimiter", pattern_without_delimiter cannot be nil.') + end + + pattern = Regexp.new(/^[A-Z].*/) + if @pattern_without_delimiter !~ pattern + invalid_properties.push("invalid value for \"pattern_without_delimiter\", must conform to the pattern #{pattern}.") + end + + if @byte.nil? + invalid_properties.push('invalid value for "byte", byte cannot be nil.') + end + + if !@password.nil? && @password.to_s.length > 64 + invalid_properties.push('invalid value for "password", the character length must be smaller than or equal to 64.') + end + + if !@password.nil? && @password.to_s.length < 10 + invalid_properties.push('invalid value for "password", the character length must be great than or equal to 10.') + 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 !@integer.nil? && @integer > 100 + return false if !@integer.nil? && @integer < 10 + return false if !@int32.nil? && @int32 > 200 + return false if !@int32.nil? && @int32 < 20 + return false if @number.nil? + return false if @number > 543.2 + return false if @number < 32.1 + return false if !@float.nil? && @float > 987.6 + return false if @double.nil? + return false if @double > 123.4 + return false if @double < 67.8 + return false if !@string.nil? && @string !~ Regexp.new(/[a-z]/i) + return false if @pattern_without_delimiter.nil? + return false if @pattern_without_delimiter !~ Regexp.new(/^[A-Z].*/) + return false if @byte.nil? + return false if !@password.nil? && @password.to_s.length > 64 + return false if !@password.nil? && @password.to_s.length < 10 + true + end + + # Custom attribute writer method with validation + # @param [Object] integer Value to be assigned + def integer=(integer) + if !integer.nil? && integer > 100 + fail ArgumentError, 'invalid value for "integer", must be smaller than or equal to 100.' + end + + if !integer.nil? && integer < 10 + fail ArgumentError, 'invalid value for "integer", must be greater than or equal to 10.' + end + + @integer = integer + end + + # Custom attribute writer method with validation + # @param [Object] int32 Value to be assigned + def int32=(int32) + if !int32.nil? && int32 > 200 + fail ArgumentError, 'invalid value for "int32", must be smaller than or equal to 200.' + end + + if !int32.nil? && int32 < 20 + fail ArgumentError, 'invalid value for "int32", must be greater than or equal to 20.' + end + + @int32 = int32 + end + + # Custom attribute writer method with validation + # @param [Object] number Value to be assigned + def number=(number) + if number.nil? + fail ArgumentError, 'number cannot be nil' + end + + if number > 543.2 + fail ArgumentError, 'invalid value for "number", must be smaller than or equal to 543.2.' + end + + if number < 32.1 + fail ArgumentError, 'invalid value for "number", must be greater than or equal to 32.1.' + end + + @number = number + end + + # Custom attribute writer method with validation + # @param [Object] float Value to be assigned + def float=(float) + if !float.nil? && float > 987.6 + fail ArgumentError, 'invalid value for "float", must be smaller than or equal to 987.6.' + end + + @float = float + end + + # Custom attribute writer method with validation + # @param [Object] double Value to be assigned + def double=(double) + if double.nil? + fail ArgumentError, 'double cannot be nil' + end + + if double > 123.4 + fail ArgumentError, 'invalid value for "double", must be smaller than or equal to 123.4.' + end + + if double < 67.8 + fail ArgumentError, 'invalid value for "double", must be greater than or equal to 67.8.' + end + + @double = double + end + + # Custom attribute writer method with validation + # @param [Object] string Value to be assigned + def string=(string) + pattern = Regexp.new(/[a-z]/i) + if !string.nil? && string !~ pattern + fail ArgumentError, "invalid value for \"string\", must conform to the pattern #{pattern}." + end + + @string = string + end + + # Custom attribute writer method with validation + # @param [Object] pattern_without_delimiter Value to be assigned + def pattern_without_delimiter=(pattern_without_delimiter) + if pattern_without_delimiter.nil? + fail ArgumentError, 'pattern_without_delimiter cannot be nil' + end + + pattern = Regexp.new(/^[A-Z].*/) + if pattern_without_delimiter !~ pattern + fail ArgumentError, "invalid value for \"pattern_without_delimiter\", must conform to the pattern #{pattern}." + end + + @pattern_without_delimiter = pattern_without_delimiter + end + + # Custom attribute writer method with validation + # @param [Object] password Value to be assigned + def password=(password) + if !password.nil? && password.to_s.length > 64 + fail ArgumentError, 'invalid value for "password", the character length must be smaller than or equal to 64.' + end + + if !password.nil? && password.to_s.length < 10 + fail ArgumentError, 'invalid value for "password", the character length must be great than or equal to 10.' + end + + @password = password + 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 && + integer == o.integer && + int32 == o.int32 && + int64 == o.int64 && + number == o.number && + float == o.float && + double == o.double && + string == o.string && + pattern_without_delimiter == o.pattern_without_delimiter && + byte == o.byte && + binary == o.binary && + date == o.date && + date_time == o.date_time && + password == o.password && + callback == o.callback + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [integer, int32, int64, number, float, double, string, pattern_without_delimiter, byte, binary, date, date_time, password, callback].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + 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 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 + Petstore.const_get(type).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) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + 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-faraday/lib/petstore/models/inline_object4.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object4.rb new file mode 100644 index 000000000000..560e747ce79c --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object4.rb @@ -0,0 +1,227 @@ +=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: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.0.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class InlineObject4 + # 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 + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::InlineObject4` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::InlineObject4`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'param') + self.param = attributes[:'param'] + end + + if attributes.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 [Integer] 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 self.build_from_hash(attributes) + new.build_from_hash(attributes) + 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 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 + Petstore.const_get(type).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) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + 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-faraday/lib/petstore/models/inline_object5.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object5.rb new file mode 100644 index 000000000000..e75bb452989a --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object5.rb @@ -0,0 +1,222 @@ +=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: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.0.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class InlineObject5 + # Additional data to pass to server + attr_accessor :additional_metadata + + # file to upload + attr_accessor :required_file + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'additional_metadata' => :'additionalMetadata', + :'required_file' => :'requiredFile' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'additional_metadata' => :'String', + :'required_file' => :'File' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::InlineObject5` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::InlineObject5`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'additional_metadata') + self.additional_metadata = attributes[:'additional_metadata'] + end + + if attributes.key?(:'required_file') + self.required_file = attributes[:'required_file'] + 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 @required_file.nil? + invalid_properties.push('invalid value for "required_file", required_file 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 @required_file.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 && + additional_metadata == o.additional_metadata && + required_file == o.required_file + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [additional_metadata, required_file].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + 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 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 + Petstore.const_get(type).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) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + 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-faraday/spec/models/inline_object1_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/inline_object1_spec.rb new file mode 100644 index 000000000000..a702fd774eac --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/inline_object1_spec.rb @@ -0,0 +1,47 @@ +=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: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.0.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::InlineObject1 +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'InlineObject1' do + before do + # run before each test + @instance = Petstore::InlineObject1.new + end + + after do + # run after each test + end + + describe 'test an instance of InlineObject1' do + it 'should create an instance of InlineObject1' do + expect(@instance).to be_instance_of(Petstore::InlineObject1) + end + end + describe 'test attribute "additional_metadata"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "file"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/inline_object2_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/inline_object2_spec.rb new file mode 100644 index 000000000000..7013915ea39d --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/inline_object2_spec.rb @@ -0,0 +1,55 @@ +=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: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.0.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::InlineObject2 +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'InlineObject2' do + before do + # run before each test + @instance = Petstore::InlineObject2.new + end + + after do + # run after each test + end + + describe 'test an instance of InlineObject2' do + it 'should create an instance of InlineObject2' do + expect(@instance).to be_instance_of(Petstore::InlineObject2) + end + end + describe 'test attribute "enum_form_string_array"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('Array', [">", "$"]) + # validator.allowable_values.each do |value| + # expect { @instance.enum_form_string_array = value }.not_to raise_error + # end + end + end + + describe 'test attribute "enum_form_string"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["_abc", "-efg", "(xyz)"]) + # validator.allowable_values.each do |value| + # expect { @instance.enum_form_string = value }.not_to raise_error + # end + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/inline_object3_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/inline_object3_spec.rb new file mode 100644 index 000000000000..4daf41b4ace0 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/inline_object3_spec.rb @@ -0,0 +1,119 @@ +=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: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.0.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::InlineObject3 +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'InlineObject3' do + before do + # run before each test + @instance = Petstore::InlineObject3.new + end + + after do + # run after each test + end + + describe 'test an instance of InlineObject3' do + it 'should create an instance of InlineObject3' do + expect(@instance).to be_instance_of(Petstore::InlineObject3) + end + end + describe 'test attribute "integer"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "int32"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "int64"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "number"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "float"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "double"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "string"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "pattern_without_delimiter"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "byte"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "binary"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "date_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "password"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "callback"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/inline_object4_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/inline_object4_spec.rb new file mode 100644 index 000000000000..fa806f95860c --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/inline_object4_spec.rb @@ -0,0 +1,47 @@ +=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: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.0.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::InlineObject4 +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'InlineObject4' do + before do + # run before each test + @instance = Petstore::InlineObject4.new + end + + after do + # run after each test + end + + describe 'test an instance of InlineObject4' do + it 'should create an instance of InlineObject4' do + expect(@instance).to be_instance_of(Petstore::InlineObject4) + end + end + describe 'test attribute "param"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "param2"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/inline_object5_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/inline_object5_spec.rb new file mode 100644 index 000000000000..e2410b21bc09 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/inline_object5_spec.rb @@ -0,0 +1,47 @@ +=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: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.0.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::InlineObject5 +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'InlineObject5' do + before do + # run before each test + @instance = Petstore::InlineObject5.new + end + + after do + # run after each test + end + + describe 'test an instance of InlineObject5' do + it 'should create an instance of InlineObject5' do + expect(@instance).to be_instance_of(Petstore::InlineObject5) + end + end + describe 'test attribute "additional_metadata"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "required_file"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/inline_object_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/inline_object_spec.rb new file mode 100644 index 000000000000..c5a7db44780e --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/inline_object_spec.rb @@ -0,0 +1,47 @@ +=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: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.0.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::InlineObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'InlineObject' do + before do + # run before each test + @instance = Petstore::InlineObject.new + end + + after do + # run after each test + end + + describe 'test an instance of InlineObject' do + it 'should create an instance of InlineObject' do + expect(@instance).to be_instance_of(Petstore::InlineObject) + end + end + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "status"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby/.openapi-generator/FILES b/samples/client/petstore/ruby/.openapi-generator/FILES index 1bb03794c747..dff9045f9ba1 100644 --- a/samples/client/petstore/ruby/.openapi-generator/FILES +++ b/samples/client/petstore/ruby/.openapi-generator/FILES @@ -32,6 +32,12 @@ docs/Foo.md docs/FormatTest.md docs/HasOnlyReadOnly.md docs/HealthCheckResult.md +docs/InlineObject.md +docs/InlineObject1.md +docs/InlineObject2.md +docs/InlineObject3.md +docs/InlineObject4.md +docs/InlineObject5.md docs/InlineResponseDefault.md docs/List.md docs/MapTest.md @@ -91,6 +97,12 @@ lib/petstore/models/foo.rb lib/petstore/models/format_test.rb lib/petstore/models/has_only_read_only.rb lib/petstore/models/health_check_result.rb +lib/petstore/models/inline_object.rb +lib/petstore/models/inline_object1.rb +lib/petstore/models/inline_object2.rb +lib/petstore/models/inline_object3.rb +lib/petstore/models/inline_object4.rb +lib/petstore/models/inline_object5.rb lib/petstore/models/inline_response_default.rb lib/petstore/models/list.rb lib/petstore/models/map_test.rb @@ -113,56 +125,6 @@ lib/petstore/models/tag.rb lib/petstore/models/user.rb lib/petstore/version.rb petstore.gemspec -spec/api/another_fake_api_spec.rb -spec/api/default_api_spec.rb -spec/api/fake_api_spec.rb -spec/api/fake_classname_tags123_api_spec.rb -spec/api/pet_api_spec.rb -spec/api/store_api_spec.rb -spec/api/user_api_spec.rb spec/api_client_spec.rb spec/configuration_spec.rb -spec/models/additional_properties_class_spec.rb -spec/models/animal_spec.rb -spec/models/api_response_spec.rb -spec/models/array_of_array_of_number_only_spec.rb -spec/models/array_of_number_only_spec.rb -spec/models/array_test_spec.rb -spec/models/capitalization_spec.rb -spec/models/cat_all_of_spec.rb -spec/models/cat_spec.rb -spec/models/category_spec.rb -spec/models/class_model_spec.rb -spec/models/client_spec.rb -spec/models/dog_all_of_spec.rb -spec/models/dog_spec.rb -spec/models/enum_arrays_spec.rb -spec/models/enum_class_spec.rb -spec/models/enum_test_spec.rb -spec/models/file_schema_test_class_spec.rb -spec/models/file_spec.rb -spec/models/foo_spec.rb -spec/models/format_test_spec.rb -spec/models/has_only_read_only_spec.rb -spec/models/health_check_result_spec.rb -spec/models/inline_response_default_spec.rb -spec/models/list_spec.rb -spec/models/map_test_spec.rb -spec/models/mixed_properties_and_additional_properties_class_spec.rb -spec/models/model200_response_spec.rb -spec/models/model_return_spec.rb -spec/models/name_spec.rb -spec/models/nullable_class_spec.rb -spec/models/number_only_spec.rb -spec/models/order_spec.rb -spec/models/outer_composite_spec.rb -spec/models/outer_enum_default_value_spec.rb -spec/models/outer_enum_integer_default_value_spec.rb -spec/models/outer_enum_integer_spec.rb -spec/models/outer_enum_spec.rb -spec/models/pet_spec.rb -spec/models/read_only_first_spec.rb -spec/models/special_model_name_spec.rb -spec/models/tag_spec.rb -spec/models/user_spec.rb spec/spec_helper.rb diff --git a/samples/client/petstore/ruby/README.md b/samples/client/petstore/ruby/README.md index 35c76f3817e4..719039e53116 100644 --- a/samples/client/petstore/ruby/README.md +++ b/samples/client/petstore/ruby/README.md @@ -141,6 +141,12 @@ Class | Method | HTTP request | Description - [Petstore::FormatTest](docs/FormatTest.md) - [Petstore::HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - [Petstore::HealthCheckResult](docs/HealthCheckResult.md) + - [Petstore::InlineObject](docs/InlineObject.md) + - [Petstore::InlineObject1](docs/InlineObject1.md) + - [Petstore::InlineObject2](docs/InlineObject2.md) + - [Petstore::InlineObject3](docs/InlineObject3.md) + - [Petstore::InlineObject4](docs/InlineObject4.md) + - [Petstore::InlineObject5](docs/InlineObject5.md) - [Petstore::InlineResponseDefault](docs/InlineResponseDefault.md) - [Petstore::List](docs/List.md) - [Petstore::MapTest](docs/MapTest.md) diff --git a/samples/client/petstore/ruby/docs/InlineObject.md b/samples/client/petstore/ruby/docs/InlineObject.md new file mode 100644 index 000000000000..f5211d44464c --- /dev/null +++ b/samples/client/petstore/ruby/docs/InlineObject.md @@ -0,0 +1,19 @@ +# Petstore::InlineObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Updated name of the pet | [optional] +**status** | **String** | Updated status of the pet | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::InlineObject.new(name: null, + status: null) +``` + + diff --git a/samples/client/petstore/ruby/docs/InlineObject1.md b/samples/client/petstore/ruby/docs/InlineObject1.md new file mode 100644 index 000000000000..bac17e753cdc --- /dev/null +++ b/samples/client/petstore/ruby/docs/InlineObject1.md @@ -0,0 +1,19 @@ +# Petstore::InlineObject1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**additional_metadata** | **String** | Additional data to pass to server | [optional] +**file** | **File** | file to upload | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::InlineObject1.new(additional_metadata: null, + file: null) +``` + + diff --git a/samples/client/petstore/ruby/docs/InlineObject2.md b/samples/client/petstore/ruby/docs/InlineObject2.md new file mode 100644 index 000000000000..31118c5b262e --- /dev/null +++ b/samples/client/petstore/ruby/docs/InlineObject2.md @@ -0,0 +1,19 @@ +# Petstore::InlineObject2 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enum_form_string_array** | **Array<String>** | Form parameter enum test (string array) | [optional] +**enum_form_string** | **String** | Form parameter enum test (string) | [optional] [default to '-efg'] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::InlineObject2.new(enum_form_string_array: null, + enum_form_string: null) +``` + + diff --git a/samples/client/petstore/ruby/docs/InlineObject3.md b/samples/client/petstore/ruby/docs/InlineObject3.md new file mode 100644 index 000000000000..b6cb7ccb29b1 --- /dev/null +++ b/samples/client/petstore/ruby/docs/InlineObject3.md @@ -0,0 +1,43 @@ +# Petstore::InlineObject3 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integer** | **Integer** | None | [optional] +**int32** | **Integer** | None | [optional] +**int64** | **Integer** | None | [optional] +**number** | **Float** | None | +**float** | **Float** | None | [optional] +**double** | **Float** | None | +**string** | **String** | None | [optional] +**pattern_without_delimiter** | **String** | None | +**byte** | **String** | None | +**binary** | **File** | None | [optional] +**date** | **Date** | None | [optional] +**date_time** | **DateTime** | None | [optional] +**password** | **String** | None | [optional] +**callback** | **String** | None | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::InlineObject3.new(integer: null, + int32: null, + int64: null, + number: null, + float: null, + double: null, + string: null, + pattern_without_delimiter: null, + byte: null, + binary: null, + date: null, + date_time: null, + password: null, + callback: null) +``` + + diff --git a/samples/client/petstore/ruby/docs/InlineObject4.md b/samples/client/petstore/ruby/docs/InlineObject4.md new file mode 100644 index 000000000000..97179c3e3772 --- /dev/null +++ b/samples/client/petstore/ruby/docs/InlineObject4.md @@ -0,0 +1,19 @@ +# Petstore::InlineObject4 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**param** | **String** | field1 | +**param2** | **String** | field2 | + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::InlineObject4.new(param: null, + param2: null) +``` + + diff --git a/samples/client/petstore/ruby/docs/InlineObject5.md b/samples/client/petstore/ruby/docs/InlineObject5.md new file mode 100644 index 000000000000..23c1df99ffeb --- /dev/null +++ b/samples/client/petstore/ruby/docs/InlineObject5.md @@ -0,0 +1,19 @@ +# Petstore::InlineObject5 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**additional_metadata** | **String** | Additional data to pass to server | [optional] +**required_file** | **File** | file to upload | + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::InlineObject5.new(additional_metadata: null, + required_file: null) +``` + + diff --git a/samples/client/petstore/ruby/lib/petstore.rb b/samples/client/petstore/ruby/lib/petstore.rb index f0df2170db08..7f8ae56e123b 100644 --- a/samples/client/petstore/ruby/lib/petstore.rb +++ b/samples/client/petstore/ruby/lib/petstore.rb @@ -40,6 +40,12 @@ require 'petstore/models/format_test' require 'petstore/models/has_only_read_only' require 'petstore/models/health_check_result' +require 'petstore/models/inline_object' +require 'petstore/models/inline_object1' +require 'petstore/models/inline_object2' +require 'petstore/models/inline_object3' +require 'petstore/models/inline_object4' +require 'petstore/models/inline_object5' require 'petstore/models/inline_response_default' require 'petstore/models/list' require 'petstore/models/map_test' diff --git a/samples/client/petstore/ruby/lib/petstore/models/inline_object.rb b/samples/client/petstore/ruby/lib/petstore/models/inline_object.rb new file mode 100644 index 000000000000..7d2ce0e05f39 --- /dev/null +++ b/samples/client/petstore/ruby/lib/petstore/models/inline_object.rb @@ -0,0 +1,217 @@ +=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: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.0.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class InlineObject + # Updated name of the pet + attr_accessor :name + + # Updated status of the pet + attr_accessor :status + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'name', + :'status' => :'status' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'name' => :'String', + :'status' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::InlineObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::InlineObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + 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 + 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 && + name == o.name && + status == o.status + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [name, status].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + 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 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 + Petstore.const_get(type).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) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + 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/inline_object1.rb b/samples/client/petstore/ruby/lib/petstore/models/inline_object1.rb new file mode 100644 index 000000000000..45a9d5bfcd72 --- /dev/null +++ b/samples/client/petstore/ruby/lib/petstore/models/inline_object1.rb @@ -0,0 +1,217 @@ +=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: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.0.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class InlineObject1 + # Additional data to pass to server + attr_accessor :additional_metadata + + # file to upload + attr_accessor :file + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'additional_metadata' => :'additionalMetadata', + :'file' => :'file' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'additional_metadata' => :'String', + :'file' => :'File' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::InlineObject1` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::InlineObject1`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'additional_metadata') + self.additional_metadata = attributes[:'additional_metadata'] + end + + if attributes.key?(:'file') + self.file = attributes[:'file'] + 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 + 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 && + additional_metadata == o.additional_metadata && + file == o.file + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [additional_metadata, file].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + 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 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 + Petstore.const_get(type).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) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + 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/inline_object2.rb b/samples/client/petstore/ruby/lib/petstore/models/inline_object2.rb new file mode 100644 index 000000000000..51784af066b6 --- /dev/null +++ b/samples/client/petstore/ruby/lib/petstore/models/inline_object2.rb @@ -0,0 +1,255 @@ +=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: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.0.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class InlineObject2 + # Form parameter enum test (string array) + attr_accessor :enum_form_string_array + + # Form parameter enum test (string) + attr_accessor :enum_form_string + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'enum_form_string_array' => :'enum_form_string_array', + :'enum_form_string' => :'enum_form_string' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'enum_form_string_array' => :'Array', + :'enum_form_string' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::InlineObject2` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::InlineObject2`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'enum_form_string_array') + if (value = attributes[:'enum_form_string_array']).is_a?(Array) + self.enum_form_string_array = value + end + end + + if attributes.key?(:'enum_form_string') + self.enum_form_string = attributes[:'enum_form_string'] + else + self.enum_form_string = '-efg' + 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 + 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? + enum_form_string_validator = EnumAttributeValidator.new('String', ["_abc", "-efg", "(xyz)"]) + return false unless enum_form_string_validator.valid?(@enum_form_string) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] enum_form_string Object to be assigned + def enum_form_string=(enum_form_string) + validator = EnumAttributeValidator.new('String', ["_abc", "-efg", "(xyz)"]) + unless validator.valid?(enum_form_string) + fail ArgumentError, "invalid value for \"enum_form_string\", must be one of #{validator.allowable_values}." + end + @enum_form_string = enum_form_string + 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 && + enum_form_string_array == o.enum_form_string_array && + enum_form_string == o.enum_form_string + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [enum_form_string_array, enum_form_string].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + 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 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 + Petstore.const_get(type).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) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + 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/inline_object3.rb b/samples/client/petstore/ruby/lib/petstore/models/inline_object3.rb new file mode 100644 index 000000000000..71fe8bd38a82 --- /dev/null +++ b/samples/client/petstore/ruby/lib/petstore/models/inline_object3.rb @@ -0,0 +1,538 @@ +=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: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.0.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class InlineObject3 + # None + attr_accessor :integer + + # None + attr_accessor :int32 + + # None + attr_accessor :int64 + + # None + attr_accessor :number + + # None + attr_accessor :float + + # None + attr_accessor :double + + # None + attr_accessor :string + + # None + attr_accessor :pattern_without_delimiter + + # None + attr_accessor :byte + + # None + attr_accessor :binary + + # None + attr_accessor :date + + # None + attr_accessor :date_time + + # None + attr_accessor :password + + # None + attr_accessor :callback + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'integer' => :'integer', + :'int32' => :'int32', + :'int64' => :'int64', + :'number' => :'number', + :'float' => :'float', + :'double' => :'double', + :'string' => :'string', + :'pattern_without_delimiter' => :'pattern_without_delimiter', + :'byte' => :'byte', + :'binary' => :'binary', + :'date' => :'date', + :'date_time' => :'dateTime', + :'password' => :'password', + :'callback' => :'callback' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'integer' => :'Integer', + :'int32' => :'Integer', + :'int64' => :'Integer', + :'number' => :'Float', + :'float' => :'Float', + :'double' => :'Float', + :'string' => :'String', + :'pattern_without_delimiter' => :'String', + :'byte' => :'String', + :'binary' => :'File', + :'date' => :'Date', + :'date_time' => :'DateTime', + :'password' => :'String', + :'callback' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::InlineObject3` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::InlineObject3`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'integer') + self.integer = attributes[:'integer'] + end + + if attributes.key?(:'int32') + self.int32 = attributes[:'int32'] + end + + if attributes.key?(:'int64') + self.int64 = attributes[:'int64'] + end + + if attributes.key?(:'number') + self.number = attributes[:'number'] + end + + if attributes.key?(:'float') + self.float = attributes[:'float'] + end + + if attributes.key?(:'double') + self.double = attributes[:'double'] + end + + if attributes.key?(:'string') + self.string = attributes[:'string'] + end + + if attributes.key?(:'pattern_without_delimiter') + self.pattern_without_delimiter = attributes[:'pattern_without_delimiter'] + end + + if attributes.key?(:'byte') + self.byte = attributes[:'byte'] + end + + if attributes.key?(:'binary') + self.binary = attributes[:'binary'] + end + + if attributes.key?(:'date') + self.date = attributes[:'date'] + end + + if attributes.key?(:'date_time') + self.date_time = attributes[:'date_time'] + end + + if attributes.key?(:'password') + self.password = attributes[:'password'] + end + + if attributes.key?(:'callback') + self.callback = attributes[:'callback'] + 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 !@integer.nil? && @integer > 100 + invalid_properties.push('invalid value for "integer", must be smaller than or equal to 100.') + end + + if !@integer.nil? && @integer < 10 + invalid_properties.push('invalid value for "integer", must be greater than or equal to 10.') + end + + if !@int32.nil? && @int32 > 200 + invalid_properties.push('invalid value for "int32", must be smaller than or equal to 200.') + end + + if !@int32.nil? && @int32 < 20 + invalid_properties.push('invalid value for "int32", must be greater than or equal to 20.') + end + + if @number.nil? + invalid_properties.push('invalid value for "number", number cannot be nil.') + end + + if @number > 543.2 + invalid_properties.push('invalid value for "number", must be smaller than or equal to 543.2.') + end + + if @number < 32.1 + invalid_properties.push('invalid value for "number", must be greater than or equal to 32.1.') + end + + if !@float.nil? && @float > 987.6 + invalid_properties.push('invalid value for "float", must be smaller than or equal to 987.6.') + end + + if @double.nil? + invalid_properties.push('invalid value for "double", double cannot be nil.') + end + + if @double > 123.4 + invalid_properties.push('invalid value for "double", must be smaller than or equal to 123.4.') + end + + if @double < 67.8 + invalid_properties.push('invalid value for "double", must be greater than or equal to 67.8.') + end + + pattern = Regexp.new(/[a-z]/i) + if !@string.nil? && @string !~ pattern + invalid_properties.push("invalid value for \"string\", must conform to the pattern #{pattern}.") + end + + if @pattern_without_delimiter.nil? + invalid_properties.push('invalid value for "pattern_without_delimiter", pattern_without_delimiter cannot be nil.') + end + + pattern = Regexp.new(/^[A-Z].*/) + if @pattern_without_delimiter !~ pattern + invalid_properties.push("invalid value for \"pattern_without_delimiter\", must conform to the pattern #{pattern}.") + end + + if @byte.nil? + invalid_properties.push('invalid value for "byte", byte cannot be nil.') + end + + if !@password.nil? && @password.to_s.length > 64 + invalid_properties.push('invalid value for "password", the character length must be smaller than or equal to 64.') + end + + if !@password.nil? && @password.to_s.length < 10 + invalid_properties.push('invalid value for "password", the character length must be great than or equal to 10.') + 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 !@integer.nil? && @integer > 100 + return false if !@integer.nil? && @integer < 10 + return false if !@int32.nil? && @int32 > 200 + return false if !@int32.nil? && @int32 < 20 + return false if @number.nil? + return false if @number > 543.2 + return false if @number < 32.1 + return false if !@float.nil? && @float > 987.6 + return false if @double.nil? + return false if @double > 123.4 + return false if @double < 67.8 + return false if !@string.nil? && @string !~ Regexp.new(/[a-z]/i) + return false if @pattern_without_delimiter.nil? + return false if @pattern_without_delimiter !~ Regexp.new(/^[A-Z].*/) + return false if @byte.nil? + return false if !@password.nil? && @password.to_s.length > 64 + return false if !@password.nil? && @password.to_s.length < 10 + true + end + + # Custom attribute writer method with validation + # @param [Object] integer Value to be assigned + def integer=(integer) + if !integer.nil? && integer > 100 + fail ArgumentError, 'invalid value for "integer", must be smaller than or equal to 100.' + end + + if !integer.nil? && integer < 10 + fail ArgumentError, 'invalid value for "integer", must be greater than or equal to 10.' + end + + @integer = integer + end + + # Custom attribute writer method with validation + # @param [Object] int32 Value to be assigned + def int32=(int32) + if !int32.nil? && int32 > 200 + fail ArgumentError, 'invalid value for "int32", must be smaller than or equal to 200.' + end + + if !int32.nil? && int32 < 20 + fail ArgumentError, 'invalid value for "int32", must be greater than or equal to 20.' + end + + @int32 = int32 + end + + # Custom attribute writer method with validation + # @param [Object] number Value to be assigned + def number=(number) + if number.nil? + fail ArgumentError, 'number cannot be nil' + end + + if number > 543.2 + fail ArgumentError, 'invalid value for "number", must be smaller than or equal to 543.2.' + end + + if number < 32.1 + fail ArgumentError, 'invalid value for "number", must be greater than or equal to 32.1.' + end + + @number = number + end + + # Custom attribute writer method with validation + # @param [Object] float Value to be assigned + def float=(float) + if !float.nil? && float > 987.6 + fail ArgumentError, 'invalid value for "float", must be smaller than or equal to 987.6.' + end + + @float = float + end + + # Custom attribute writer method with validation + # @param [Object] double Value to be assigned + def double=(double) + if double.nil? + fail ArgumentError, 'double cannot be nil' + end + + if double > 123.4 + fail ArgumentError, 'invalid value for "double", must be smaller than or equal to 123.4.' + end + + if double < 67.8 + fail ArgumentError, 'invalid value for "double", must be greater than or equal to 67.8.' + end + + @double = double + end + + # Custom attribute writer method with validation + # @param [Object] string Value to be assigned + def string=(string) + pattern = Regexp.new(/[a-z]/i) + if !string.nil? && string !~ pattern + fail ArgumentError, "invalid value for \"string\", must conform to the pattern #{pattern}." + end + + @string = string + end + + # Custom attribute writer method with validation + # @param [Object] pattern_without_delimiter Value to be assigned + def pattern_without_delimiter=(pattern_without_delimiter) + if pattern_without_delimiter.nil? + fail ArgumentError, 'pattern_without_delimiter cannot be nil' + end + + pattern = Regexp.new(/^[A-Z].*/) + if pattern_without_delimiter !~ pattern + fail ArgumentError, "invalid value for \"pattern_without_delimiter\", must conform to the pattern #{pattern}." + end + + @pattern_without_delimiter = pattern_without_delimiter + end + + # Custom attribute writer method with validation + # @param [Object] password Value to be assigned + def password=(password) + if !password.nil? && password.to_s.length > 64 + fail ArgumentError, 'invalid value for "password", the character length must be smaller than or equal to 64.' + end + + if !password.nil? && password.to_s.length < 10 + fail ArgumentError, 'invalid value for "password", the character length must be great than or equal to 10.' + end + + @password = password + 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 && + integer == o.integer && + int32 == o.int32 && + int64 == o.int64 && + number == o.number && + float == o.float && + double == o.double && + string == o.string && + pattern_without_delimiter == o.pattern_without_delimiter && + byte == o.byte && + binary == o.binary && + date == o.date && + date_time == o.date_time && + password == o.password && + callback == o.callback + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [integer, int32, int64, number, float, double, string, pattern_without_delimiter, byte, binary, date, date_time, password, callback].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + 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 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 + Petstore.const_get(type).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) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + 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/inline_object4.rb b/samples/client/petstore/ruby/lib/petstore/models/inline_object4.rb new file mode 100644 index 000000000000..560e747ce79c --- /dev/null +++ b/samples/client/petstore/ruby/lib/petstore/models/inline_object4.rb @@ -0,0 +1,227 @@ +=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: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.0.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class InlineObject4 + # 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 + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::InlineObject4` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::InlineObject4`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'param') + self.param = attributes[:'param'] + end + + if attributes.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 [Integer] 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 self.build_from_hash(attributes) + new.build_from_hash(attributes) + 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 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 + Petstore.const_get(type).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) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + 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/inline_object5.rb b/samples/client/petstore/ruby/lib/petstore/models/inline_object5.rb new file mode 100644 index 000000000000..e75bb452989a --- /dev/null +++ b/samples/client/petstore/ruby/lib/petstore/models/inline_object5.rb @@ -0,0 +1,222 @@ +=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: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.0.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class InlineObject5 + # Additional data to pass to server + attr_accessor :additional_metadata + + # file to upload + attr_accessor :required_file + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'additional_metadata' => :'additionalMetadata', + :'required_file' => :'requiredFile' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'additional_metadata' => :'String', + :'required_file' => :'File' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::InlineObject5` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::InlineObject5`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'additional_metadata') + self.additional_metadata = attributes[:'additional_metadata'] + end + + if attributes.key?(:'required_file') + self.required_file = attributes[:'required_file'] + 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 @required_file.nil? + invalid_properties.push('invalid value for "required_file", required_file 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 @required_file.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 && + additional_metadata == o.additional_metadata && + required_file == o.required_file + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [additional_metadata, required_file].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + 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 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 + Petstore.const_get(type).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) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + 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/inline_object1_spec.rb b/samples/client/petstore/ruby/spec/models/inline_object1_spec.rb new file mode 100644 index 000000000000..a702fd774eac --- /dev/null +++ b/samples/client/petstore/ruby/spec/models/inline_object1_spec.rb @@ -0,0 +1,47 @@ +=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: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.0.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::InlineObject1 +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'InlineObject1' do + before do + # run before each test + @instance = Petstore::InlineObject1.new + end + + after do + # run after each test + end + + describe 'test an instance of InlineObject1' do + it 'should create an instance of InlineObject1' do + expect(@instance).to be_instance_of(Petstore::InlineObject1) + end + end + describe 'test attribute "additional_metadata"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "file"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby/spec/models/inline_object2_spec.rb b/samples/client/petstore/ruby/spec/models/inline_object2_spec.rb new file mode 100644 index 000000000000..7013915ea39d --- /dev/null +++ b/samples/client/petstore/ruby/spec/models/inline_object2_spec.rb @@ -0,0 +1,55 @@ +=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: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.0.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::InlineObject2 +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'InlineObject2' do + before do + # run before each test + @instance = Petstore::InlineObject2.new + end + + after do + # run after each test + end + + describe 'test an instance of InlineObject2' do + it 'should create an instance of InlineObject2' do + expect(@instance).to be_instance_of(Petstore::InlineObject2) + end + end + describe 'test attribute "enum_form_string_array"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('Array', [">", "$"]) + # validator.allowable_values.each do |value| + # expect { @instance.enum_form_string_array = value }.not_to raise_error + # end + end + end + + describe 'test attribute "enum_form_string"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["_abc", "-efg", "(xyz)"]) + # validator.allowable_values.each do |value| + # expect { @instance.enum_form_string = value }.not_to raise_error + # end + end + end + +end diff --git a/samples/client/petstore/ruby/spec/models/inline_object3_spec.rb b/samples/client/petstore/ruby/spec/models/inline_object3_spec.rb new file mode 100644 index 000000000000..4daf41b4ace0 --- /dev/null +++ b/samples/client/petstore/ruby/spec/models/inline_object3_spec.rb @@ -0,0 +1,119 @@ +=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: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.0.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::InlineObject3 +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'InlineObject3' do + before do + # run before each test + @instance = Petstore::InlineObject3.new + end + + after do + # run after each test + end + + describe 'test an instance of InlineObject3' do + it 'should create an instance of InlineObject3' do + expect(@instance).to be_instance_of(Petstore::InlineObject3) + end + end + describe 'test attribute "integer"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "int32"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "int64"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "number"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "float"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "double"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "string"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "pattern_without_delimiter"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "byte"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "binary"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "date_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "password"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "callback"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby/spec/models/inline_object4_spec.rb b/samples/client/petstore/ruby/spec/models/inline_object4_spec.rb new file mode 100644 index 000000000000..fa806f95860c --- /dev/null +++ b/samples/client/petstore/ruby/spec/models/inline_object4_spec.rb @@ -0,0 +1,47 @@ +=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: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.0.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::InlineObject4 +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'InlineObject4' do + before do + # run before each test + @instance = Petstore::InlineObject4.new + end + + after do + # run after each test + end + + describe 'test an instance of InlineObject4' do + it 'should create an instance of InlineObject4' do + expect(@instance).to be_instance_of(Petstore::InlineObject4) + end + end + describe 'test attribute "param"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "param2"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby/spec/models/inline_object5_spec.rb b/samples/client/petstore/ruby/spec/models/inline_object5_spec.rb new file mode 100644 index 000000000000..e2410b21bc09 --- /dev/null +++ b/samples/client/petstore/ruby/spec/models/inline_object5_spec.rb @@ -0,0 +1,47 @@ +=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: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.0.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::InlineObject5 +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'InlineObject5' do + before do + # run before each test + @instance = Petstore::InlineObject5.new + end + + after do + # run after each test + end + + describe 'test an instance of InlineObject5' do + it 'should create an instance of InlineObject5' do + expect(@instance).to be_instance_of(Petstore::InlineObject5) + end + end + describe 'test attribute "additional_metadata"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "required_file"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby/spec/models/inline_object_spec.rb b/samples/client/petstore/ruby/spec/models/inline_object_spec.rb new file mode 100644 index 000000000000..c5a7db44780e --- /dev/null +++ b/samples/client/petstore/ruby/spec/models/inline_object_spec.rb @@ -0,0 +1,47 @@ +=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: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.0.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::InlineObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'InlineObject' do + before do + # run before each test + @instance = Petstore::InlineObject.new + end + + after do + # run after each test + end + + describe 'test an instance of InlineObject' do + it 'should create an instance of InlineObject' do + expect(@instance).to be_instance_of(Petstore::InlineObject) + end + end + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "status"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/scala-sttp/README.md b/samples/client/petstore/scala-sttp/README.md index 891ebf40fc01..7d0aef8990b8 100644 --- a/samples/client/petstore/scala-sttp/README.md +++ b/samples/client/petstore/scala-sttp/README.md @@ -1,4 +1,4 @@ -# 'scala-sttp-petstore' +# scala-sttp-petstore OpenAPI Petstore - API version: 1.0.0 @@ -37,7 +37,7 @@ Add this dependency to your project's POM: ```xml org.openapitools - 'scala-sttp-petstore' + scala-sttp-petstore 1.0.0 compile @@ -48,13 +48,13 @@ Add this dependency to your project's POM: Add this dependency to your project's build file: ```groovy -compile "org.openapitools:'scala-sttp-petstore':1.0.0" +compile "org.openapitools:scala-sttp-petstore:1.0.0" ``` ### SBT users ```scala -libraryDependencies += "org.openapitools" % "'scala-sttp-petstore'" % "1.0.0" +libraryDependencies += "org.openapitools" % "scala-sttp-petstore" % "1.0.0" ``` ## Getting Started diff --git a/samples/client/petstore/scala-sttp/build.sbt b/samples/client/petstore/scala-sttp/build.sbt index 68b09b1d6dd8..b940c8b67373 100644 --- a/samples/client/petstore/scala-sttp/build.sbt +++ b/samples/client/petstore/scala-sttp/build.sbt @@ -1,5 +1,5 @@ version := "1.0.0" -name := "'scala-sttp-petstore'" +name := "scala-sttp-petstore" organization := "org.openapitools" scalaVersion := "2.13.0" diff --git a/samples/client/petstore/spring-cloud-async/.openapi-generator/FILES b/samples/client/petstore/spring-cloud-async/.openapi-generator/FILES index d4c572c593bb..3510d2b2d276 100644 --- a/samples/client/petstore/spring-cloud-async/.openapi-generator/FILES +++ b/samples/client/petstore/spring-cloud-async/.openapi-generator/FILES @@ -1,4 +1,3 @@ -.openapi-generator-ignore README.md pom.xml src/main/java/org/openapitools/api/PetApi.java diff --git a/samples/client/petstore/spring-cloud/.openapi-generator/FILES b/samples/client/petstore/spring-cloud/.openapi-generator/FILES index d4c572c593bb..3510d2b2d276 100644 --- a/samples/client/petstore/spring-cloud/.openapi-generator/FILES +++ b/samples/client/petstore/spring-cloud/.openapi-generator/FILES @@ -1,4 +1,3 @@ -.openapi-generator-ignore README.md pom.xml src/main/java/org/openapitools/api/PetApi.java diff --git a/samples/client/petstore/swift5/alamofireLibrary/Package.swift b/samples/client/petstore/swift5/alamofireLibrary/Package.swift index 9371b3d57bd4..6e820c6971b0 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/Package.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/Package.swift @@ -14,19 +14,19 @@ let package = Package( // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "PetstoreClient", - targets: ["PetstoreClient"]) + targets: ["PetstoreClient"]), ], dependencies: [ // Dependencies declare other packages that this package depends on. - .package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.9.1") + .package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.9.1"), ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. // Targets can depend on other targets in this package, and on products in packages which this package depends on. .target( name: "PetstoreClient", - dependencies: ["Alamofire" ], + dependencies: ["Alamofire", ], path: "PetstoreClient/Classes" - ) + ), ] ) diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 5b09f9557113..2404bc8ffc6d 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { + public static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { let destination = source.reduce(into: [String: Any]()) { (result, item) in if let value = item.value { result[item.key] = value @@ -20,17 +20,17 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { + public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? [Any?] { - result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") + if let collection = item.value as? Array { + result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { + public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { guard let source = source else { return nil } @@ -46,15 +46,15 @@ public struct APIHelper { } public static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? [Any?] { + if let collection = source as? Array { return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") } return source } - public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { + public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? [Any?] { + if let collection = item.value as? Array { collection.filter({ $0 != nil }).map({"\($0!)"}).forEach { value in result.append(URLQueryItem(name: item.key, value: value)) } @@ -69,3 +69,4 @@ public struct APIHelper { return destination } } + diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift index 224d1fc911b6..69e723d482f5 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,23 +9,23 @@ import Foundation open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var credential: URLCredential? - public static var customHeaders: [String: String] = [:] + public static var customHeaders: [String:String] = [:] public static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() public static var apiResponseQueue: DispatchQueue = .main } open class RequestBuilder { var credential: URLCredential? - var headers: [String: String] - public let parameters: [String: Any]? + var headers: [String:String] + public let parameters: [String:Any]? public let isBody: Bool public let method: String public let URLString: String /// Optional block to obtain a reference to the request's progress instance when available. - public var onProgressReady: ((Progress) -> Void)? + public var onProgressReady: ((Progress) -> ())? - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -35,7 +35,7 @@ open class RequestBuilder { addHeaders(PetstoreClientAPI.customHeaders) } - open func addHeaders(_ aHeaders: [String: String]) { + open func addHeaders(_ aHeaders:[String:String]) { for (header, value) in aHeaders { headers[header] = value } @@ -58,5 +58,5 @@ open class RequestBuilder { public protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 5bbf323f820c..bb3ae7178254 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class AnotherFakeAPI { /** To test special tags @@ -15,7 +17,7 @@ open class AnotherFakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 134d6aea416a..d1d81faa335c 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class FakeAPI { /** @@ -14,7 +16,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) { + open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?,_ error: Error?) -> Void)) { fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -49,7 +51,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) { + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?,_ error: Error?) -> Void)) { fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -84,7 +86,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) { + open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?,_ error: Error?) -> Void)) { fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -119,7 +121,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { + open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -154,7 +156,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -190,7 +192,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -229,7 +231,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -279,7 +281,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testEndpointParametersWithRequestBuilder(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -316,7 +318,7 @@ open class FakeAPI { open class func testEndpointParametersWithRequestBuilder(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "integer": integer?.encodeToJSON(), "int32": int32?.encodeToJSON(), "int64": int64?.encodeToJSON(), @@ -335,7 +337,7 @@ open class FakeAPI { let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -424,7 +426,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -452,19 +454,19 @@ open class FakeAPI { open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "enum_form_string_array": enumFormStringArray?.encodeToJSON(), "enum_form_string": enumFormString?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), - "enum_query_string": enumQueryString?.encodeToJSON(), - "enum_query_integer": enumQueryInteger?.encodeToJSON(), + "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), + "enum_query_string": enumQueryString?.encodeToJSON(), + "enum_query_integer": enumQueryInteger?.encodeToJSON(), "enum_query_double": enumQueryDouble?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -490,7 +492,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -516,13 +518,13 @@ open class FakeAPI { open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), "int64_group": int64Group?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -543,7 +545,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testInlineAdditionalProperties(param: [String:String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -560,7 +562,7 @@ open class FakeAPI { - parameter param: (body) request body - returns: RequestBuilder */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { let path = "/fake/inline-additionalProperties" let URLString = PetstoreClientAPI.basePath + path let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) @@ -580,7 +582,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -601,14 +603,14 @@ open class FakeAPI { open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { let path = "/fake/jsonFormData" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "param": param.encodeToJSON(), "param2": param2.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 48cfe7187b9a..d21c4a49d43d 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -7,6 +7,8 @@ import Foundation + + open class FakeClassnameTags123API { /** To test class name in snake case @@ -15,7 +17,7 @@ open class FakeClassnameTags123API { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index c938db720047..f5366f5832ba 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class PetAPI { /** Add a new pet to the store @@ -15,7 +17,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -55,7 +57,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -82,8 +84,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let nillableHeaders: [String: Any?] = [ "api_key": apiKey?.encodeToJSON() @@ -111,7 +113,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { + open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -135,8 +137,8 @@ open class PetAPI { open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "status": status.encodeToJSON() @@ -155,7 +157,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @available(*, deprecated, message: "This operation is deprecated.") - open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { + open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -180,8 +182,8 @@ open class PetAPI { open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "tags": tags.encodeToJSON() @@ -199,7 +201,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) { + open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?,_ error: Error?) -> Void)) { getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -226,8 +228,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -242,7 +244,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -283,7 +285,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -311,14 +313,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "name": name?.encodeToJSON(), "status": status?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -335,7 +337,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -363,14 +365,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "file": file?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -387,7 +389,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -415,14 +417,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "requiredFile": requiredFile.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index a8a83eda39a4..3848eda85ad6 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class StoreAPI { /** Delete purchase order by ID @@ -15,7 +17,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -39,8 +41,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -54,7 +56,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) { + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String:Int]?,_ error: Error?) -> Void)) { getInventoryWithRequestBuilder().execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -74,14 +76,14 @@ open class StoreAPI { - name: api_key - returns: RequestBuilder<[String:Int]> */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { + open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } @@ -93,7 +95,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { + open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -117,8 +119,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -133,7 +135,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { + open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 505ed1b0c5c9..546166841d9e 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class UserAPI { /** Create user @@ -15,7 +17,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -52,7 +54,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -88,7 +90,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -124,7 +126,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -148,8 +150,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -164,7 +166,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) { + open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?,_ error: Error?) -> Void)) { getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -187,8 +189,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -204,7 +206,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { + open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -226,11 +228,11 @@ open class UserAPI { open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username.encodeToJSON(), + "username": username.encodeToJSON(), "password": password.encodeToJSON() ]) @@ -245,7 +247,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { logoutUserWithRequestBuilder().execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -264,8 +266,8 @@ open class UserAPI { open class func logoutUserWithRequestBuilder() -> RequestBuilder { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -281,7 +283,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift index 368b4edffb93..e7320f28ec57 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift @@ -12,7 +12,7 @@ class AlamofireRequestBuilderFactory: RequestBuilderFactory { return AlamofireRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return AlamofireDecodableRequestBuilder.self } } @@ -21,7 +21,7 @@ class AlamofireRequestBuilderFactory: RequestBuilderFactory { private var managerStore = SynchronizedDictionary() open class AlamofireRequestBuilder: RequestBuilder { - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } @@ -59,17 +59,17 @@ open class AlamofireRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the request configuration (e.g. to override the cache policy). */ - open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) -> DataRequest { + open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) -> DataRequest { return manager.request(URLString, method: method, parameters: parameters, encoding: encoding, headers: headers) } override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, Error>) -> Void) { - let managerId: String = UUID().uuidString + let managerId:String = UUID().uuidString // Create a new manager for each request to customize its request header let manager = createSessionManager() managerStore[managerId] = manager - let encoding: ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() + let encoding:ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() let xMethod = Alamofire.HTTPMethod(rawValue: method) let fileKeys = parameters == nil ? [] : parameters!.filter { $1 is NSURL } @@ -82,7 +82,8 @@ open class AlamofireRequestBuilder: RequestBuilder { case let fileURL as URL: if let mimeType = self.contentTypeForFormPart(fileURL: fileURL) { mpForm.append(fileURL, withName: k, fileName: fileURL.lastPathComponent, mimeType: mimeType) - } else { + } + else { mpForm.append(fileURL, withName: k) } case let string as String: @@ -101,7 +102,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } self.processRequest(request: upload, managerId, apiResponseQueue, completion) case .failure(let encodingError): - apiResponseQueue.async { + apiResponseQueue.async{ completion(.failure(ErrorResponse.error(415, nil, encodingError))) } } @@ -131,14 +132,14 @@ open class AlamofireRequestBuilder: RequestBuilder { case is String.Type: validatedRequest.responseString(queue: apiResponseQueue, completionHandler: { (stringResponse) in cleanupRequest() - + switch stringResponse.result { case let .success(value): completion(.success(Response(response: stringResponse.response!, body: value as? T))) case let .failure(error): completion(.failure(ErrorResponse.error(stringResponse.response?.statusCode ?? 500, stringResponse.data, error))) } - + }) case is URL.Type: validatedRequest.responseData(queue: apiResponseQueue, completionHandler: { (dataResponse) in @@ -187,26 +188,26 @@ open class AlamofireRequestBuilder: RequestBuilder { case is Void.Type: validatedRequest.responseData(queue: apiResponseQueue, completionHandler: { (voidResponse) in cleanupRequest() - + switch voidResponse.result { case .success: completion(.success(Response(response: voidResponse.response!, body: nil))) case let .failure(error): completion(.failure(ErrorResponse.error(voidResponse.response?.statusCode ?? 500, voidResponse.data, error))) } - + }) default: validatedRequest.responseData(queue: apiResponseQueue, completionHandler: { (dataResponse) in cleanupRequest() - + switch dataResponse.result { case .success: completion(.success(Response(response: dataResponse.response!, body: dataResponse.data as? T))) case let .failure(error): completion(.failure(ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, error))) } - + }) } } @@ -219,7 +220,7 @@ open class AlamofireRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -227,7 +228,7 @@ open class AlamofireRequestBuilder: RequestBuilder { let items = contentDisposition.components(separatedBy: ";") - var filename: String? + var filename : String? = nil for contentItem in items { @@ -238,7 +239,7 @@ open class AlamofireRequestBuilder: RequestBuilder { filename = contentItem return filename? - .replacingCharacters(in: range, with: "") + .replacingCharacters(in: range, with:"") .replacingOccurrences(of: "\"", with: "") .trimmingCharacters(in: .whitespacesAndNewlines) } @@ -247,7 +248,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url: URL) throws -> String { + fileprivate func getPath(from url : URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -261,7 +262,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -272,7 +273,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } -open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { +open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { override fileprivate func processRequest(request: DataRequest, _ managerId: String, _ apiResponseQueue: DispatchQueue, _ completion: @escaping (_ result: Swift.Result, Error>) -> Void) { if let credential = self.credential { @@ -289,7 +290,7 @@ open class AlamofireDecodableRequestBuilder: AlamofireRequestBuild case is String.Type: validatedRequest.responseString(queue: apiResponseQueue, completionHandler: { (stringResponse) in cleanupRequest() - + switch stringResponse.result { case let .success(value): completion(.success(Response(response: stringResponse.response!, body: value as? T))) @@ -301,7 +302,7 @@ open class AlamofireDecodableRequestBuilder: AlamofireRequestBuild case is Void.Type: validatedRequest.responseData(queue: apiResponseQueue, completionHandler: { (voidResponse) in cleanupRequest() - + switch voidResponse.result { case .success: completion(.success(Response(response: voidResponse.response!, body: nil))) @@ -313,7 +314,7 @@ open class AlamofireDecodableRequestBuilder: AlamofireRequestBuild case is Data.Type: validatedRequest.responseData(queue: apiResponseQueue, completionHandler: { (dataResponse) in cleanupRequest() - + switch dataResponse.result { case .success: completion(.success(Response(response: dataResponse.response!, body: dataResponse.data as? T))) @@ -342,14 +343,14 @@ open class AlamofireDecodableRequestBuilder: AlamofireRequestBuild } let decodeResult = CodableHelper.decode(T.self, from: data) - + switch decodeResult { case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) case let .failure(error): completion(.failure(ErrorResponse.error(httpResponse.statusCode, data, error))) } - + }) } } @@ -357,9 +358,9 @@ open class AlamofireDecodableRequestBuilder: AlamofireRequestBuild } extension JSONDataEncoding: ParameterEncoding { - + // MARK: Encoding - + /// Creates a URL request by encoding parameters and applying them onto an existing request. /// /// - parameter urlRequest: The request to have parameters applied. @@ -371,7 +372,7 @@ extension JSONDataEncoding: ParameterEncoding { /// - returns: The encoded request. public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { let urlRequest = try urlRequest.asURLRequest() - + return self.encode(urlRequest, with: parameters) } } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index ef971ebadc60..01b28a4bd42d 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -45,4 +45,4 @@ open class CodableHelper { open class func encode(_ value: T) -> Swift.Result where T: Encodable { return Swift.Result { try self.jsonEncoder.encode(value) } } -} +} \ No newline at end of file diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift index 627d9adb757e..f171525e4394 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -7,10 +7,10 @@ import Foundation open class Configuration { - + // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} + +} \ No newline at end of file diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 93ed6b90b376..6e279679c67a 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -108,24 +108,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { if let values = values { try encodeArray(values, forKey: key) } } - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -135,7 +135,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -147,8 +147,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { - var tmpArray: [T]? + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { + var tmpArray: [T]? = nil if contains(key) { tmpArray = try decodeArray(T.self, forKey: key) @@ -157,8 +157,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { + var map: [Self.Key : T] = [:] for key in allKeys { if !excludedKeys.contains(key) { @@ -177,3 +177,5 @@ extension HTTPURLResponse { return Array(200 ..< 300).contains(statusCode) } } + + diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift index b79e9f5e64d5..08f1ef334dff 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift @@ -41,7 +41,7 @@ public struct JSONDataEncoding { } public static func encodingParameters(jsonData: Data?) -> [String: Any]? { - var returnedParams: [String: Any]? + var returnedParams: [String: Any]? = nil if let jsonData = jsonData, !jsonData.isEmpty { var params: [String: Any] = [:] params[jsonDataKey] = jsonData diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 02f78ffb4705..314f1eff1f9b 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -9,8 +9,8 @@ import Foundation open class JSONEncodingHelper { - open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { - var params: [String: Any]? + open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { + var params: [String: Any]? = nil // Encode the Encodable object if let encodableObj = encodableObj { @@ -27,7 +27,7 @@ open class JSONEncodingHelper { } open class func encodingParameters(forEncodableObject encodableObj: Any?) -> [String: Any]? { - var params: [String: Any]? + var params: [String: Any]? = nil if let encodableObj = encodableObj { do { @@ -41,5 +41,5 @@ open class JSONEncodingHelper { return params } - + } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift index c0542c14c081..11e81ffcc472 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,11 +10,11 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -public enum ErrorResponse: Error { +public enum ErrorResponse : Error { case error(Int, Data?, Error) } -public enum DownloadException: Error { +public enum DownloadException : Error { case responseDataMissing case responseFailed case requestMissing @@ -30,6 +30,7 @@ public enum DecodableRequestBuilderError: Error { case generalError(Error) } + open class Response { public let statusCode: Int public let header: [String: String] @@ -43,7 +44,7 @@ open class Response { public convenience init(response: HTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String: String]() + var header = [String:String]() for (key, value) in rawHeader { if let key = key.base as? String, let value = value as? String { header[key] = value diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 1af031535967..28ca8377b889 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -7,17 +7,19 @@ import Foundation -public struct AdditionalPropertiesClass: Codable { - public var mapString: [String: String]? - public var mapMapString: [String: [String: String]]? +public struct AdditionalPropertiesClass: Codable { - public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { + + public var mapString: [String:String]? + public var mapMapString: [String:[String:String]]? + + public init(mapString: [String:String]?, mapMapString: [String:[String:String]]?) { self.mapString = mapString self.mapMapString = mapMapString } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapString = "map_string" case mapMapString = "map_map_string" } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 5ed9f31e2a36..1050d79dbe9d 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -7,7 +7,9 @@ import Foundation -public struct Animal: Codable { + +public struct Animal: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift index e09b0e9efdc8..e7bea63f8ed2 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -7,4 +7,5 @@ import Foundation + public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index ec270da89074..4d0393b9ba45 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -7,7 +7,9 @@ import Foundation -public struct ApiResponse: Codable { + +public struct ApiResponse: Codable { + public var code: Int? public var type: String? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 6c252ed475b2..1363c96394ba 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayOfArrayOfNumberOnly: Codable { + +public struct ArrayOfArrayOfNumberOnly: Codable { + public var arrayArrayNumber: [[Double]]? @@ -15,7 +17,7 @@ public struct ArrayOfArrayOfNumberOnly: Codable { self.arrayArrayNumber = arrayArrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayArrayNumber = "ArrayArrayNumber" } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index e84eb5d65025..6b8873730c43 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayOfNumberOnly: Codable { + +public struct ArrayOfNumberOnly: Codable { + public var arrayNumber: [Double]? @@ -15,7 +17,7 @@ public struct ArrayOfNumberOnly: Codable { self.arrayNumber = arrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayNumber = "ArrayNumber" } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index d2140933d181..64f7c6d9db99 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayTest: Codable { + +public struct ArrayTest: Codable { + public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? @@ -19,7 +21,7 @@ public struct ArrayTest: Codable { self.arrayArrayOfModel = arrayArrayOfModel } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" case arrayArrayOfModel = "array_array_of_model" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index d1b3b27616ed..ddb669a59045 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -7,7 +7,9 @@ import Foundation -public struct Capitalization: Codable { + +public struct Capitalization: Codable { + public var smallCamel: String? public var capitalCamel: String? @@ -26,7 +28,7 @@ public struct Capitalization: Codable { self.ATT_NAME = ATT_NAME } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case smallCamel case capitalCamel = "CapitalCamel" case smallSnake = "small_Snake" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 7ab887f3113f..c4f6e0d488ca 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -7,7 +7,9 @@ import Foundation -public struct Cat: Codable { + +public struct Cat: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index a51ad0dffab1..7b1d7e32be80 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -7,7 +7,9 @@ import Foundation -public struct CatAllOf: Codable { + +public struct CatAllOf: Codable { + public var declawed: Bool? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index eb8f7e5e1974..3ec00f5ab10d 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,7 +7,9 @@ import Foundation -public struct Category: Codable { + +public struct Category: Codable { + public var id: Int64? public var name: String = "default-name" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index e2a7d4427a06..af030c3dd626 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model with \"_class\" property */ -public struct ClassModel: Codable { +public struct ClassModel: Codable { + public var _class: String? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 00245ca37280..0aae748c76b4 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -7,7 +7,9 @@ import Foundation -public struct Client: Codable { + +public struct Client: Codable { + public var client: String? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 492c1228008e..198e28b94dd6 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -7,7 +7,9 @@ import Foundation -public struct Dog: Codable { + +public struct Dog: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 7786f8acc5ae..8ff49b2af23f 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -7,7 +7,9 @@ import Foundation -public struct DogAllOf: Codable { + +public struct DogAllOf: Codable { + public var breed: String? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 9844e7c40e35..e2d3fa04f94b 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -7,7 +7,9 @@ import Foundation -public struct EnumArrays: Codable { + +public struct EnumArrays: Codable { + public enum JustSymbol: String, Codable, CaseIterable { case greaterThanOrEqualTo = ">=" @@ -25,7 +27,7 @@ public struct EnumArrays: Codable { self.arrayEnum = arrayEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justSymbol = "just_symbol" case arrayEnum = "array_enum" } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index d4029d73f8af..c2c639ba3246 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -7,6 +7,7 @@ import Foundation + public enum EnumClass: String, Codable, CaseIterable { case abc = "_abc" case efg = "-efg" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 789f583e1d77..a56e1f36389b 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct EnumTest: Codable { + +public struct EnumTest: Codable { + public enum EnumString: String, Codable, CaseIterable { case upper = "UPPER" @@ -41,7 +43,7 @@ public struct EnumTest: Codable { self.outerEnum = outerEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case enumString = "enum_string" case enumStringRequired = "enum_string_required" case enumInteger = "enum_integer" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift index abf3ccffc485..773b53b2cb76 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -8,7 +8,8 @@ import Foundation /** Must be named `File` for test. */ -public struct File: Codable { +public struct File: Codable { + /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 532f1457939a..83dc1148cfa3 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -7,7 +7,9 @@ import Foundation -public struct FileSchemaTestClass: Codable { + +public struct FileSchemaTestClass: Codable { + public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index 20bd6d103b3d..bccd3f9fb178 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct FormatTest: Codable { + +public struct FormatTest: Codable { + public var integer: Int? public var int32: Int? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 906ddb06fb17..566d71a35ef0 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct HasOnlyReadOnly: Codable { + +public struct HasOnlyReadOnly: Codable { + public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift index fe13d302ccbf..80cecab242f2 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -7,7 +7,9 @@ import Foundation -public struct List: Codable { + +public struct List: Codable { + public var _123list: String? @@ -15,7 +17,7 @@ public struct List: Codable { self._123list = _123list } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _123list = "123-list" } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 4b6037f378ee..f0c02de95f7a 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -7,25 +7,27 @@ import Foundation -public struct MapTest: Codable { + +public struct MapTest: Codable { + public enum MapOfEnumString: String, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" } - public var mapMapOfString: [String: [String: String]]? - public var mapOfEnumString: [String: String]? - public var directMap: [String: Bool]? + public var mapMapOfString: [String:[String:String]]? + public var mapOfEnumString: [String:String]? + public var directMap: [String:Bool]? public var indirectMap: StringBooleanMap? - public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { + public init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?, directMap: [String:Bool]?, indirectMap: StringBooleanMap?) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap self.indirectMap = indirectMap } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" case directMap = "direct_map" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c3deb2f28932..710e62a9b587 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,13 +7,15 @@ import Foundation -public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { + +public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { + public var uuid: UUID? public var dateTime: Date? - public var map: [String: Animal]? + public var map: [String:Animal]? - public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { + public init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { self.uuid = uuid self.dateTime = dateTime self.map = map diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index b61db7d6e716..450a53b918ca 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model name starting with number */ -public struct Model200Response: Codable { +public struct Model200Response: Codable { + public var name: Int? public var _class: String? @@ -18,7 +19,7 @@ public struct Model200Response: Codable { self._class = _class } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case _class = "class" } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 8ab4db44b73a..6deb69fcd731 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model name same as property name */ -public struct Name: Codable { +public struct Name: Codable { + public var name: Int public var snakeCase: Int? @@ -22,7 +23,7 @@ public struct Name: Codable { self._123number = _123number } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case snakeCase = "snake_case" case property diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 4d1dafcc2c1f..0c9ee2b7b9f4 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct NumberOnly: Codable { + +public struct NumberOnly: Codable { + public var justNumber: Double? @@ -15,7 +17,7 @@ public struct NumberOnly: Codable { self.justNumber = justNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justNumber = "JustNumber" } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 40c30cc8609c..ab0eac0b304e 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,7 +7,9 @@ import Foundation -public struct Order: Codable { + +public struct Order: Codable { + public enum Status: String, Codable, CaseIterable { case placed = "placed" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 18c3a024f122..4a7d22710441 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -7,7 +7,9 @@ import Foundation -public struct OuterComposite: Codable { + +public struct OuterComposite: Codable { + public var myNumber: Double? public var myString: String? @@ -19,7 +21,7 @@ public struct OuterComposite: Codable { self.myBoolean = myBoolean } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case myNumber = "my_number" case myString = "my_string" case myBoolean = "my_boolean" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index c3b778cbbed4..9e6b8d74e874 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -7,6 +7,7 @@ import Foundation + public enum OuterEnum: String, Codable, CaseIterable { case placed = "placed" case approved = "approved" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index b9ce0e933256..a973071d6c96 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,7 +7,9 @@ import Foundation -public struct Pet: Codable { + +public struct Pet: Codable { + public enum Status: String, Codable, CaseIterable { case available = "available" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 0acd21fd1000..b2a6b7e2b8a6 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -7,7 +7,9 @@ import Foundation -public struct ReadOnlyFirst: Codable { + +public struct ReadOnlyFirst: Codable { + public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index c223f993a69e..7e089dcee2b4 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing reserved words */ -public struct Return: Codable { +public struct Return: Codable { + public var _return: Int? @@ -16,7 +17,7 @@ public struct Return: Codable { self._return = _return } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _return = "return" } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index 6e8650f76d8e..e890ef952520 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -7,7 +7,9 @@ import Foundation -public struct SpecialModelName: Codable { + +public struct SpecialModelName: Codable { + public var specialPropertyName: Int64? @@ -15,7 +17,7 @@ public struct SpecialModelName: Codable { self.specialPropertyName = specialPropertyName } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case specialPropertyName = "$special[property.name]" } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index 3f1237fee477..f65ae0623d6e 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -7,9 +7,12 @@ import Foundation -public struct StringBooleanMap: Codable { - public var additionalProperties: [String: Bool] = [:] +public struct StringBooleanMap: Codable { + + + + public var additionalProperties: [String:Bool] = [:] public subscript(key: String) -> Bool? { get { @@ -42,4 +45,5 @@ public struct StringBooleanMap: Codable { additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } + } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 4dd8a9a9f5a0..a91b6061bcf7 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,7 +7,9 @@ import Foundation -public struct Tag: Codable { + +public struct Tag: Codable { + public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index a9e088808ed3..2d377c3edb02 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -7,7 +7,9 @@ import Foundation -public struct TypeHolderDefault: Codable { + +public struct TypeHolderDefault: Codable { + public var stringItem: String = "what" public var numberItem: Double @@ -23,7 +25,7 @@ public struct TypeHolderDefault: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index dff4083ae432..e5eb92da696e 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -7,7 +7,9 @@ import Foundation -public struct TypeHolderExample: Codable { + +public struct TypeHolderExample: Codable { + public var stringItem: String public var numberItem: Double @@ -23,7 +25,7 @@ public struct TypeHolderExample: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 79f271ed7356..f70328ca9e59 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,7 +7,9 @@ import Foundation -public struct User: Codable { + +public struct User: Codable { + public var id: Int64? public var username: String? diff --git a/samples/client/petstore/swift5/combineLibrary/Package.swift b/samples/client/petstore/swift5/combineLibrary/Package.swift index 96dfff54edf4..79f6f8188738 100644 --- a/samples/client/petstore/swift5/combineLibrary/Package.swift +++ b/samples/client/petstore/swift5/combineLibrary/Package.swift @@ -14,7 +14,7 @@ let package = Package( // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "PetstoreClient", - targets: ["PetstoreClient"]) + targets: ["PetstoreClient"]), ], dependencies: [ // Dependencies declare other packages that this package depends on. @@ -26,6 +26,6 @@ let package = Package( name: "PetstoreClient", dependencies: [], path: "PetstoreClient/Classes" - ) + ), ] ) diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 5b09f9557113..2404bc8ffc6d 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { + public static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { let destination = source.reduce(into: [String: Any]()) { (result, item) in if let value = item.value { result[item.key] = value @@ -20,17 +20,17 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { + public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? [Any?] { - result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") + if let collection = item.value as? Array { + result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { + public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { guard let source = source else { return nil } @@ -46,15 +46,15 @@ public struct APIHelper { } public static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? [Any?] { + if let collection = source as? Array { return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") } return source } - public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { + public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? [Any?] { + if let collection = item.value as? Array { collection.filter({ $0 != nil }).map({"\($0!)"}).forEach { value in result.append(URLQueryItem(name: item.key, value: value)) } @@ -69,3 +69,4 @@ public struct APIHelper { return destination } } + diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift index a5c2d605dff6..c5d1b9b42df3 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,15 +9,15 @@ import Foundation open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var credential: URLCredential? - public static var customHeaders: [String: String] = [:] + public static var customHeaders: [String:String] = [:] public static var requestBuilderFactory: RequestBuilderFactory = URLSessionRequestBuilderFactory() public static var apiResponseQueue: DispatchQueue = .main } open class RequestBuilder { var credential: URLCredential? - var headers: [String: String] - public let parameters: [String: Any]? + var headers: [String:String] + public let parameters: [String:Any]? public let isBody: Bool public let method: String public let URLString: String @@ -25,9 +25,9 @@ open class RequestBuilder { /// Optional block to obtain a reference to the request's progress instance when available. /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. /// If you need to get the request's progress in older OS versions, please use Alamofire http client. - public var onProgressReady: ((Progress) -> Void)? + public var onProgressReady: ((Progress) -> ())? - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -37,7 +37,7 @@ open class RequestBuilder { addHeaders(PetstoreClientAPI.customHeaders) } - open func addHeaders(_ aHeaders: [String: String]) { + open func addHeaders(_ aHeaders:[String:String]) { for (header, value) in aHeaders { headers[header] = value } @@ -60,5 +60,5 @@ open class RequestBuilder { public protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 2df909dec9ad..cf5a4a61c291 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -8,6 +8,8 @@ import Foundation import Combine + + open class AnotherFakeAPI { /** To test special tags diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 47510b7781a5..ccfdc072331f 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -8,6 +8,8 @@ import Foundation import Combine + + open class FakeAPI { /** @@ -341,7 +343,7 @@ open class FakeAPI { open class func testEndpointParametersWithRequestBuilder(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "integer": integer?.encodeToJSON(), "int32": int32?.encodeToJSON(), "int64": int64?.encodeToJSON(), @@ -360,7 +362,7 @@ open class FakeAPI { let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -480,19 +482,19 @@ open class FakeAPI { open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "enum_form_string_array": enumFormStringArray?.encodeToJSON(), "enum_form_string": enumFormString?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), - "enum_query_string": enumQueryString?.encodeToJSON(), - "enum_query_integer": enumQueryInteger?.encodeToJSON(), + "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), + "enum_query_string": enumQueryString?.encodeToJSON(), + "enum_query_integer": enumQueryInteger?.encodeToJSON(), "enum_query_double": enumQueryDouble?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -547,13 +549,13 @@ open class FakeAPI { open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), "int64_group": int64Group?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -575,7 +577,7 @@ open class FakeAPI { - returns: AnyPublisher */ @available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { + open class func testInlineAdditionalProperties(param: [String:String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { return Future.init { promisse in testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result -> Void in switch result { @@ -594,7 +596,7 @@ open class FakeAPI { - parameter param: (body) request body - returns: RequestBuilder */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { let path = "/fake/inline-additionalProperties" let URLString = PetstoreClientAPI.basePath + path let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) @@ -638,14 +640,14 @@ open class FakeAPI { open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { let path = "/fake/jsonFormData" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "param": param.encodeToJSON(), "param2": param2.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 6f0401af8885..7d04bd796bb7 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -8,6 +8,8 @@ import Foundation import Combine + + open class FakeClassnameTags123API { /** To test class name in snake case diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 309ee4e9686e..6c288c225c7a 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -8,6 +8,8 @@ import Foundation import Combine + + open class PetAPI { /** Add a new pet to the store @@ -89,8 +91,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let nillableHeaders: [String: Any?] = [ "api_key": apiKey?.encodeToJSON() @@ -145,8 +147,8 @@ open class PetAPI { open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "status": status.encodeToJSON() @@ -193,8 +195,8 @@ open class PetAPI { open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "tags": tags.encodeToJSON() @@ -242,8 +244,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -333,14 +335,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "name": name?.encodeToJSON(), "status": status?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -388,14 +390,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "file": file?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -443,14 +445,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "requiredFile": requiredFile.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index b36a3a30c3a5..1a4392975b6b 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -8,6 +8,8 @@ import Foundation import Combine + + open class StoreAPI { /** Delete purchase order by ID @@ -43,8 +45,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -59,8 +61,8 @@ open class StoreAPI { - returns: AnyPublisher<[String:Int], Error> */ @available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher<[String: Int], Error> { - return Future<[String: Int], Error>.init { promisse in + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher<[String:Int], Error> { + return Future<[String:Int], Error>.init { promisse in getInventoryWithRequestBuilder().execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -81,14 +83,14 @@ open class StoreAPI { - name: api_key - returns: RequestBuilder<[String:Int]> */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { + open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } @@ -127,8 +129,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 3d5694cc935c..59fec6d34fe6 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -8,6 +8,8 @@ import Foundation import Combine + + open class UserAPI { /** Create user @@ -161,8 +163,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -203,8 +205,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -245,11 +247,11 @@ open class UserAPI { open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username.encodeToJSON(), + "username": username.encodeToJSON(), "password": password.encodeToJSON() ]) @@ -286,8 +288,8 @@ open class UserAPI { open class func logoutUserWithRequestBuilder() -> RequestBuilder { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index ef971ebadc60..01b28a4bd42d 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -45,4 +45,4 @@ open class CodableHelper { open class func encode(_ value: T) -> Swift.Result where T: Encodable { return Swift.Result { try self.jsonEncoder.encode(value) } } -} +} \ No newline at end of file diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift index 627d9adb757e..f171525e4394 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -7,10 +7,10 @@ import Foundation open class Configuration { - + // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} + +} \ No newline at end of file diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 93ed6b90b376..6e279679c67a 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -108,24 +108,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { if let values = values { try encodeArray(values, forKey: key) } } - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -135,7 +135,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -147,8 +147,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { - var tmpArray: [T]? + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { + var tmpArray: [T]? = nil if contains(key) { tmpArray = try decodeArray(T.self, forKey: key) @@ -157,8 +157,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { + var map: [Self.Key : T] = [:] for key in allKeys { if !excludedKeys.contains(key) { @@ -177,3 +177,5 @@ extension HTTPURLResponse { return Array(200 ..< 300).contains(statusCode) } } + + diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift index b79e9f5e64d5..08f1ef334dff 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift @@ -41,7 +41,7 @@ public struct JSONDataEncoding { } public static func encodingParameters(jsonData: Data?) -> [String: Any]? { - var returnedParams: [String: Any]? + var returnedParams: [String: Any]? = nil if let jsonData = jsonData, !jsonData.isEmpty { var params: [String: Any] = [:] params[jsonDataKey] = jsonData diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 02f78ffb4705..314f1eff1f9b 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -9,8 +9,8 @@ import Foundation open class JSONEncodingHelper { - open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { - var params: [String: Any]? + open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { + var params: [String: Any]? = nil // Encode the Encodable object if let encodableObj = encodableObj { @@ -27,7 +27,7 @@ open class JSONEncodingHelper { } open class func encodingParameters(forEncodableObject encodableObj: Any?) -> [String: Any]? { - var params: [String: Any]? + var params: [String: Any]? = nil if let encodableObj = encodableObj { do { @@ -41,5 +41,5 @@ open class JSONEncodingHelper { return params } - + } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift index c0542c14c081..11e81ffcc472 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,11 +10,11 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -public enum ErrorResponse: Error { +public enum ErrorResponse : Error { case error(Int, Data?, Error) } -public enum DownloadException: Error { +public enum DownloadException : Error { case responseDataMissing case responseFailed case requestMissing @@ -30,6 +30,7 @@ public enum DecodableRequestBuilderError: Error { case generalError(Error) } + open class Response { public let statusCode: Int public let header: [String: String] @@ -43,7 +44,7 @@ open class Response { public convenience init(response: HTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String: String]() + var header = [String:String]() for (key, value) in rawHeader { if let key = key.base as? String, let value = value as? String { header[key] = value diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 1af031535967..28ca8377b889 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -7,17 +7,19 @@ import Foundation -public struct AdditionalPropertiesClass: Codable { - public var mapString: [String: String]? - public var mapMapString: [String: [String: String]]? +public struct AdditionalPropertiesClass: Codable { - public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { + + public var mapString: [String:String]? + public var mapMapString: [String:[String:String]]? + + public init(mapString: [String:String]?, mapMapString: [String:[String:String]]?) { self.mapString = mapString self.mapMapString = mapMapString } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapString = "map_string" case mapMapString = "map_map_string" } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 5ed9f31e2a36..1050d79dbe9d 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -7,7 +7,9 @@ import Foundation -public struct Animal: Codable { + +public struct Animal: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift index e09b0e9efdc8..e7bea63f8ed2 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -7,4 +7,5 @@ import Foundation + public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index ec270da89074..4d0393b9ba45 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -7,7 +7,9 @@ import Foundation -public struct ApiResponse: Codable { + +public struct ApiResponse: Codable { + public var code: Int? public var type: String? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 6c252ed475b2..1363c96394ba 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayOfArrayOfNumberOnly: Codable { + +public struct ArrayOfArrayOfNumberOnly: Codable { + public var arrayArrayNumber: [[Double]]? @@ -15,7 +17,7 @@ public struct ArrayOfArrayOfNumberOnly: Codable { self.arrayArrayNumber = arrayArrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayArrayNumber = "ArrayArrayNumber" } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index e84eb5d65025..6b8873730c43 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayOfNumberOnly: Codable { + +public struct ArrayOfNumberOnly: Codable { + public var arrayNumber: [Double]? @@ -15,7 +17,7 @@ public struct ArrayOfNumberOnly: Codable { self.arrayNumber = arrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayNumber = "ArrayNumber" } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index d2140933d181..64f7c6d9db99 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayTest: Codable { + +public struct ArrayTest: Codable { + public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? @@ -19,7 +21,7 @@ public struct ArrayTest: Codable { self.arrayArrayOfModel = arrayArrayOfModel } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" case arrayArrayOfModel = "array_array_of_model" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index d1b3b27616ed..ddb669a59045 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -7,7 +7,9 @@ import Foundation -public struct Capitalization: Codable { + +public struct Capitalization: Codable { + public var smallCamel: String? public var capitalCamel: String? @@ -26,7 +28,7 @@ public struct Capitalization: Codable { self.ATT_NAME = ATT_NAME } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case smallCamel case capitalCamel = "CapitalCamel" case smallSnake = "small_Snake" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 7ab887f3113f..c4f6e0d488ca 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -7,7 +7,9 @@ import Foundation -public struct Cat: Codable { + +public struct Cat: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index a51ad0dffab1..7b1d7e32be80 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -7,7 +7,9 @@ import Foundation -public struct CatAllOf: Codable { + +public struct CatAllOf: Codable { + public var declawed: Bool? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index eb8f7e5e1974..3ec00f5ab10d 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,7 +7,9 @@ import Foundation -public struct Category: Codable { + +public struct Category: Codable { + public var id: Int64? public var name: String = "default-name" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index e2a7d4427a06..af030c3dd626 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model with \"_class\" property */ -public struct ClassModel: Codable { +public struct ClassModel: Codable { + public var _class: String? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 00245ca37280..0aae748c76b4 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -7,7 +7,9 @@ import Foundation -public struct Client: Codable { + +public struct Client: Codable { + public var client: String? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 492c1228008e..198e28b94dd6 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -7,7 +7,9 @@ import Foundation -public struct Dog: Codable { + +public struct Dog: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 7786f8acc5ae..8ff49b2af23f 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -7,7 +7,9 @@ import Foundation -public struct DogAllOf: Codable { + +public struct DogAllOf: Codable { + public var breed: String? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 9844e7c40e35..e2d3fa04f94b 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -7,7 +7,9 @@ import Foundation -public struct EnumArrays: Codable { + +public struct EnumArrays: Codable { + public enum JustSymbol: String, Codable, CaseIterable { case greaterThanOrEqualTo = ">=" @@ -25,7 +27,7 @@ public struct EnumArrays: Codable { self.arrayEnum = arrayEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justSymbol = "just_symbol" case arrayEnum = "array_enum" } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index d4029d73f8af..c2c639ba3246 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -7,6 +7,7 @@ import Foundation + public enum EnumClass: String, Codable, CaseIterable { case abc = "_abc" case efg = "-efg" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 789f583e1d77..a56e1f36389b 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct EnumTest: Codable { + +public struct EnumTest: Codable { + public enum EnumString: String, Codable, CaseIterable { case upper = "UPPER" @@ -41,7 +43,7 @@ public struct EnumTest: Codable { self.outerEnum = outerEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case enumString = "enum_string" case enumStringRequired = "enum_string_required" case enumInteger = "enum_integer" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift index abf3ccffc485..773b53b2cb76 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -8,7 +8,8 @@ import Foundation /** Must be named `File` for test. */ -public struct File: Codable { +public struct File: Codable { + /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 532f1457939a..83dc1148cfa3 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -7,7 +7,9 @@ import Foundation -public struct FileSchemaTestClass: Codable { + +public struct FileSchemaTestClass: Codable { + public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index 20bd6d103b3d..bccd3f9fb178 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct FormatTest: Codable { + +public struct FormatTest: Codable { + public var integer: Int? public var int32: Int? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 906ddb06fb17..566d71a35ef0 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct HasOnlyReadOnly: Codable { + +public struct HasOnlyReadOnly: Codable { + public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift index fe13d302ccbf..80cecab242f2 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -7,7 +7,9 @@ import Foundation -public struct List: Codable { + +public struct List: Codable { + public var _123list: String? @@ -15,7 +17,7 @@ public struct List: Codable { self._123list = _123list } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _123list = "123-list" } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 4b6037f378ee..f0c02de95f7a 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -7,25 +7,27 @@ import Foundation -public struct MapTest: Codable { + +public struct MapTest: Codable { + public enum MapOfEnumString: String, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" } - public var mapMapOfString: [String: [String: String]]? - public var mapOfEnumString: [String: String]? - public var directMap: [String: Bool]? + public var mapMapOfString: [String:[String:String]]? + public var mapOfEnumString: [String:String]? + public var directMap: [String:Bool]? public var indirectMap: StringBooleanMap? - public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { + public init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?, directMap: [String:Bool]?, indirectMap: StringBooleanMap?) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap self.indirectMap = indirectMap } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" case directMap = "direct_map" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c3deb2f28932..710e62a9b587 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,13 +7,15 @@ import Foundation -public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { + +public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { + public var uuid: UUID? public var dateTime: Date? - public var map: [String: Animal]? + public var map: [String:Animal]? - public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { + public init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { self.uuid = uuid self.dateTime = dateTime self.map = map diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index b61db7d6e716..450a53b918ca 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model name starting with number */ -public struct Model200Response: Codable { +public struct Model200Response: Codable { + public var name: Int? public var _class: String? @@ -18,7 +19,7 @@ public struct Model200Response: Codable { self._class = _class } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case _class = "class" } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 8ab4db44b73a..6deb69fcd731 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model name same as property name */ -public struct Name: Codable { +public struct Name: Codable { + public var name: Int public var snakeCase: Int? @@ -22,7 +23,7 @@ public struct Name: Codable { self._123number = _123number } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case snakeCase = "snake_case" case property diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 4d1dafcc2c1f..0c9ee2b7b9f4 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct NumberOnly: Codable { + +public struct NumberOnly: Codable { + public var justNumber: Double? @@ -15,7 +17,7 @@ public struct NumberOnly: Codable { self.justNumber = justNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justNumber = "JustNumber" } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 40c30cc8609c..ab0eac0b304e 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,7 +7,9 @@ import Foundation -public struct Order: Codable { + +public struct Order: Codable { + public enum Status: String, Codable, CaseIterable { case placed = "placed" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 18c3a024f122..4a7d22710441 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -7,7 +7,9 @@ import Foundation -public struct OuterComposite: Codable { + +public struct OuterComposite: Codable { + public var myNumber: Double? public var myString: String? @@ -19,7 +21,7 @@ public struct OuterComposite: Codable { self.myBoolean = myBoolean } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case myNumber = "my_number" case myString = "my_string" case myBoolean = "my_boolean" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index c3b778cbbed4..9e6b8d74e874 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -7,6 +7,7 @@ import Foundation + public enum OuterEnum: String, Codable, CaseIterable { case placed = "placed" case approved = "approved" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index b9ce0e933256..a973071d6c96 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,7 +7,9 @@ import Foundation -public struct Pet: Codable { + +public struct Pet: Codable { + public enum Status: String, Codable, CaseIterable { case available = "available" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 0acd21fd1000..b2a6b7e2b8a6 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -7,7 +7,9 @@ import Foundation -public struct ReadOnlyFirst: Codable { + +public struct ReadOnlyFirst: Codable { + public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index c223f993a69e..7e089dcee2b4 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing reserved words */ -public struct Return: Codable { +public struct Return: Codable { + public var _return: Int? @@ -16,7 +17,7 @@ public struct Return: Codable { self._return = _return } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _return = "return" } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index 6e8650f76d8e..e890ef952520 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -7,7 +7,9 @@ import Foundation -public struct SpecialModelName: Codable { + +public struct SpecialModelName: Codable { + public var specialPropertyName: Int64? @@ -15,7 +17,7 @@ public struct SpecialModelName: Codable { self.specialPropertyName = specialPropertyName } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case specialPropertyName = "$special[property.name]" } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index 3f1237fee477..f65ae0623d6e 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -7,9 +7,12 @@ import Foundation -public struct StringBooleanMap: Codable { - public var additionalProperties: [String: Bool] = [:] +public struct StringBooleanMap: Codable { + + + + public var additionalProperties: [String:Bool] = [:] public subscript(key: String) -> Bool? { get { @@ -42,4 +45,5 @@ public struct StringBooleanMap: Codable { additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } + } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 4dd8a9a9f5a0..a91b6061bcf7 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,7 +7,9 @@ import Foundation -public struct Tag: Codable { + +public struct Tag: Codable { + public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index a9e088808ed3..2d377c3edb02 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -7,7 +7,9 @@ import Foundation -public struct TypeHolderDefault: Codable { + +public struct TypeHolderDefault: Codable { + public var stringItem: String = "what" public var numberItem: Double @@ -23,7 +25,7 @@ public struct TypeHolderDefault: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index dff4083ae432..e5eb92da696e 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -7,7 +7,9 @@ import Foundation -public struct TypeHolderExample: Codable { + +public struct TypeHolderExample: Codable { + public var stringItem: String public var numberItem: Double @@ -23,7 +25,7 @@ public struct TypeHolderExample: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 79f271ed7356..f70328ca9e59 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,7 +7,9 @@ import Foundation -public struct User: Codable { + +public struct User: Codable { + public var id: Int64? public var username: String? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index 55d0eb421919..22261e2ce948 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -14,7 +14,7 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { return URLSessionRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return URLSessionDecodableRequestBuilder.self } } @@ -23,16 +23,16 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { private var urlSessionStore = SynchronizedDictionary() open class URLSessionRequestBuilder: RequestBuilder { - + private var observation: NSKeyValueObservation? - + deinit { observation?.invalidate() } - + // swiftlint:disable:next weak_delegate fileprivate let sessionDelegate = SessionDelegate() - + /** May be assigned if you want to control the authentication challenges. */ @@ -45,11 +45,11 @@ open class URLSessionRequestBuilder: RequestBuilder { - retry the request. */ public var taskCompletionShouldRetry: ((Data?, URLResponse?, Error?, @escaping (Bool) -> Void) -> Void)? - - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + + required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } - + /** May be overridden by a subclass if you want to control the URLSession configuration. @@ -77,40 +77,40 @@ open class URLSessionRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the URLRequest configuration (e.g. to override the cache policy). */ - open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) throws -> URLRequest { - + open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) throws -> URLRequest { + guard let url = URL(string: URLString) else { throw DownloadException.requestMissingURL } - + var originalRequest = URLRequest(url: url) - + originalRequest.httpMethod = method.rawValue - + buildHeaders().forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + headers.forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + let modifiedRequest = try encoding.encode(originalRequest, with: parameters) - + return modifiedRequest } override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, Error>) -> Void) { - let urlSessionId: String = UUID().uuidString + let urlSessionId:String = UUID().uuidString // Create a new manager for each request to customize its request header let urlSession = createURLSession() urlSessionStore[urlSessionId] = urlSession - + let parameters: [String: Any] = self.parameters ?? [:] - + let fileKeys = parameters.filter { $1 is URL } .map { $0.0 } - + let encoding: ParameterEncoding if fileKeys.count > 0 { encoding = FileUploadEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) @@ -119,29 +119,29 @@ open class URLSessionRequestBuilder: RequestBuilder { } else { encoding = URLEncoding() } - + guard let xMethod = HTTPMethod(rawValue: method) else { fatalError("Unsuported Http method - \(method)") } - + let cleanupRequest = { urlSessionStore[urlSessionId] = nil self.observation?.invalidate() } - + do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) - + let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in - + guard let self = self else { return } - + if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - + taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in - + guard let self = self else { return } - + if shouldRetry { cleanupRequest() self.execute(apiResponseQueue, completion) @@ -157,13 +157,13 @@ open class URLSessionRequestBuilder: RequestBuilder { } } } - + if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { onProgressReady?(dataTask.progress) } - + dataTask.resume() - + } catch { apiResponseQueue.async { cleanupRequest() @@ -172,7 +172,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - + fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, Error>) -> Void) { if let error = error { @@ -192,52 +192,52 @@ open class URLSessionRequestBuilder: RequestBuilder { switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is URL.Type: do { - + guard error == nil else { throw DownloadException.responseFailed } - + guard let data = data else { throw DownloadException.responseDataMissing } - + let fileManager = FileManager.default let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] let requestURL = try self.getURL(from: urlRequest) - + var requestPath = try self.getPath(from: requestURL) - + if let headerFileName = self.getFileName(fromContentDisposition: httpResponse.allHeaderFields["Content-Disposition"] as? String) { requestPath = requestPath.appending("/\(headerFileName)") } - + let filePath = documentsDirectory.appendingPathComponent(requestPath) let directoryPath = filePath.deletingLastPathComponent().path - + try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) try data.write(to: filePath, options: .atomic) - + completion(.success(Response(response: httpResponse, body: filePath as? T))) - + } catch let requestParserError as DownloadException { completion(.failure(ErrorResponse.error(400, data, requestParserError))) } catch let error { completion(.failure(ErrorResponse.error(400, data, error))) } - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + default: - + completion(.success(Response(response: httpResponse, body: data as? T))) } @@ -251,7 +251,7 @@ open class URLSessionRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -270,7 +270,7 @@ open class URLSessionRequestBuilder: RequestBuilder { filename = contentItem return filename? - .replacingCharacters(in: range, with: "") + .replacingCharacters(in: range, with:"") .replacingOccurrences(of: "\"", with: "") .trimmingCharacters(in: .whitespacesAndNewlines) } @@ -279,7 +279,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url: URL) throws -> String { + fileprivate func getPath(from url : URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -293,7 +293,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -304,7 +304,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } -open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { +open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, Error>) -> Void) { if let error = error { @@ -324,28 +324,28 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + case is Data.Type: - + completion(.success(Response(response: httpResponse, body: data as? T))) - + default: - + guard let data = data, !data.isEmpty else { completion(.failure(ErrorResponse.error(httpResponse.statusCode, nil, DecodableRequestBuilderError.emptyDataResponse))) return } - + let decodeResult = CodableHelper.decode(T.self, from: data) - + switch decodeResult { case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) @@ -356,10 +356,10 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui } } -private class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { - +fileprivate class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { + var credential: URLCredential? - + var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { @@ -402,13 +402,13 @@ public protocol ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest } -private class URLEncoding: ParameterEncoding { - func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { - +fileprivate class URLEncoding: ParameterEncoding { + func encode(_ urlRequest: URLRequest, with parameters: [String : Any]?) throws -> URLRequest { + var urlRequest = urlRequest - + guard let parameters = parameters else { return urlRequest } - + guard let url = urlRequest.url else { throw DownloadException.requestMissingURL } @@ -417,12 +417,12 @@ private class URLEncoding: ParameterEncoding { urlComponents.queryItems = APIHelper.mapValuesToQueryItems(parameters) urlRequest.url = urlComponents.url } - + return urlRequest } } -private class FileUploadEncoding: ParameterEncoding { +fileprivate class FileUploadEncoding: ParameterEncoding { let contentTypeForFormPart: (_ fileURL: URL) -> String? @@ -433,13 +433,13 @@ private class FileUploadEncoding: ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { var urlRequest = urlRequest - + guard let parameters = parameters, !parameters.isEmpty else { return urlRequest } - + let boundary = "Boundary-\(UUID().uuidString)" - + urlRequest.setValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type") for (key, value) in parameters { @@ -479,7 +479,7 @@ private class FileUploadEncoding: ParameterEncoding { fatalError("Unprocessable value \(value) with key \(key)") } } - + var body = urlRequest.httpBody.orEmpty body.append("\r\n--\(boundary)--\r\n") @@ -494,7 +494,7 @@ private class FileUploadEncoding: ParameterEncoding { var urlRequest = urlRequest var body = urlRequest.httpBody.orEmpty - + let fileData = try Data(contentsOf: fileURL) let mimetype = self.contentTypeForFormPart(fileURL) ?? mimeType(for: fileURL) @@ -502,7 +502,7 @@ private class FileUploadEncoding: ParameterEncoding { let fileName = fileURL.lastPathComponent // If we already added something then we need an additional newline. - if body.count > 0 { + if (body.count > 0) { body.append("\r\n") } @@ -518,20 +518,20 @@ private class FileUploadEncoding: ParameterEncoding { // The value data. body.append(fileData) - + urlRequest.httpBody = body return urlRequest } - + private func configureDataUploadRequest(urlRequest: URLRequest, boundary: String, name: String, data: Data) -> URLRequest { var urlRequest = urlRequest - + var body = urlRequest.httpBody.orEmpty // If we already added something then we need an additional newline. - if body.count > 0 { + if (body.count > 0) { body.append("\r\n") } diff --git a/samples/client/petstore/swift5/default/Package.swift b/samples/client/petstore/swift5/default/Package.swift index 96dfff54edf4..79f6f8188738 100644 --- a/samples/client/petstore/swift5/default/Package.swift +++ b/samples/client/petstore/swift5/default/Package.swift @@ -14,7 +14,7 @@ let package = Package( // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "PetstoreClient", - targets: ["PetstoreClient"]) + targets: ["PetstoreClient"]), ], dependencies: [ // Dependencies declare other packages that this package depends on. @@ -26,6 +26,6 @@ let package = Package( name: "PetstoreClient", dependencies: [], path: "PetstoreClient/Classes" - ) + ), ] ) diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 5b09f9557113..2404bc8ffc6d 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { + public static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { let destination = source.reduce(into: [String: Any]()) { (result, item) in if let value = item.value { result[item.key] = value @@ -20,17 +20,17 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { + public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? [Any?] { - result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") + if let collection = item.value as? Array { + result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { + public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { guard let source = source else { return nil } @@ -46,15 +46,15 @@ public struct APIHelper { } public static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? [Any?] { + if let collection = source as? Array { return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") } return source } - public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { + public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? [Any?] { + if let collection = item.value as? Array { collection.filter({ $0 != nil }).map({"\($0!)"}).forEach { value in result.append(URLQueryItem(name: item.key, value: value)) } @@ -69,3 +69,4 @@ public struct APIHelper { return destination } } + diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs.swift index a5c2d605dff6..c5d1b9b42df3 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,15 +9,15 @@ import Foundation open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var credential: URLCredential? - public static var customHeaders: [String: String] = [:] + public static var customHeaders: [String:String] = [:] public static var requestBuilderFactory: RequestBuilderFactory = URLSessionRequestBuilderFactory() public static var apiResponseQueue: DispatchQueue = .main } open class RequestBuilder { var credential: URLCredential? - var headers: [String: String] - public let parameters: [String: Any]? + var headers: [String:String] + public let parameters: [String:Any]? public let isBody: Bool public let method: String public let URLString: String @@ -25,9 +25,9 @@ open class RequestBuilder { /// Optional block to obtain a reference to the request's progress instance when available. /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. /// If you need to get the request's progress in older OS versions, please use Alamofire http client. - public var onProgressReady: ((Progress) -> Void)? + public var onProgressReady: ((Progress) -> ())? - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -37,7 +37,7 @@ open class RequestBuilder { addHeaders(PetstoreClientAPI.customHeaders) } - open func addHeaders(_ aHeaders: [String: String]) { + open func addHeaders(_ aHeaders:[String:String]) { for (header, value) in aHeaders { headers[header] = value } @@ -60,5 +60,5 @@ open class RequestBuilder { public protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 5bbf323f820c..bb3ae7178254 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class AnotherFakeAPI { /** To test special tags @@ -15,7 +17,7 @@ open class AnotherFakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 134d6aea416a..d1d81faa335c 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class FakeAPI { /** @@ -14,7 +16,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) { + open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?,_ error: Error?) -> Void)) { fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -49,7 +51,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) { + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?,_ error: Error?) -> Void)) { fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -84,7 +86,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) { + open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?,_ error: Error?) -> Void)) { fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -119,7 +121,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { + open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -154,7 +156,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -190,7 +192,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -229,7 +231,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -279,7 +281,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testEndpointParametersWithRequestBuilder(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -316,7 +318,7 @@ open class FakeAPI { open class func testEndpointParametersWithRequestBuilder(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "integer": integer?.encodeToJSON(), "int32": int32?.encodeToJSON(), "int64": int64?.encodeToJSON(), @@ -335,7 +337,7 @@ open class FakeAPI { let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -424,7 +426,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -452,19 +454,19 @@ open class FakeAPI { open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "enum_form_string_array": enumFormStringArray?.encodeToJSON(), "enum_form_string": enumFormString?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), - "enum_query_string": enumQueryString?.encodeToJSON(), - "enum_query_integer": enumQueryInteger?.encodeToJSON(), + "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), + "enum_query_string": enumQueryString?.encodeToJSON(), + "enum_query_integer": enumQueryInteger?.encodeToJSON(), "enum_query_double": enumQueryDouble?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -490,7 +492,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -516,13 +518,13 @@ open class FakeAPI { open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), "int64_group": int64Group?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -543,7 +545,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testInlineAdditionalProperties(param: [String:String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -560,7 +562,7 @@ open class FakeAPI { - parameter param: (body) request body - returns: RequestBuilder */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { let path = "/fake/inline-additionalProperties" let URLString = PetstoreClientAPI.basePath + path let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) @@ -580,7 +582,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -601,14 +603,14 @@ open class FakeAPI { open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { let path = "/fake/jsonFormData" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "param": param.encodeToJSON(), "param2": param2.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 48cfe7187b9a..d21c4a49d43d 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -7,6 +7,8 @@ import Foundation + + open class FakeClassnameTags123API { /** To test class name in snake case @@ -15,7 +17,7 @@ open class FakeClassnameTags123API { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index c938db720047..f5366f5832ba 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class PetAPI { /** Add a new pet to the store @@ -15,7 +17,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -55,7 +57,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -82,8 +84,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let nillableHeaders: [String: Any?] = [ "api_key": apiKey?.encodeToJSON() @@ -111,7 +113,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { + open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -135,8 +137,8 @@ open class PetAPI { open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "status": status.encodeToJSON() @@ -155,7 +157,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @available(*, deprecated, message: "This operation is deprecated.") - open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { + open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -180,8 +182,8 @@ open class PetAPI { open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "tags": tags.encodeToJSON() @@ -199,7 +201,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) { + open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?,_ error: Error?) -> Void)) { getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -226,8 +228,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -242,7 +244,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -283,7 +285,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -311,14 +313,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "name": name?.encodeToJSON(), "status": status?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -335,7 +337,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -363,14 +365,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "file": file?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -387,7 +389,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -415,14 +417,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "requiredFile": requiredFile.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index a8a83eda39a4..3848eda85ad6 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class StoreAPI { /** Delete purchase order by ID @@ -15,7 +17,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -39,8 +41,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -54,7 +56,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) { + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String:Int]?,_ error: Error?) -> Void)) { getInventoryWithRequestBuilder().execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -74,14 +76,14 @@ open class StoreAPI { - name: api_key - returns: RequestBuilder<[String:Int]> */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { + open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } @@ -93,7 +95,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { + open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -117,8 +119,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -133,7 +135,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { + open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 505ed1b0c5c9..546166841d9e 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class UserAPI { /** Create user @@ -15,7 +17,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -52,7 +54,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -88,7 +90,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -124,7 +126,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -148,8 +150,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -164,7 +166,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) { + open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?,_ error: Error?) -> Void)) { getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -187,8 +189,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -204,7 +206,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { + open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -226,11 +228,11 @@ open class UserAPI { open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username.encodeToJSON(), + "username": username.encodeToJSON(), "password": password.encodeToJSON() ]) @@ -245,7 +247,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { logoutUserWithRequestBuilder().execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -264,8 +266,8 @@ open class UserAPI { open class func logoutUserWithRequestBuilder() -> RequestBuilder { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -281,7 +283,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index ef971ebadc60..01b28a4bd42d 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -45,4 +45,4 @@ open class CodableHelper { open class func encode(_ value: T) -> Swift.Result where T: Encodable { return Swift.Result { try self.jsonEncoder.encode(value) } } -} +} \ No newline at end of file diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Configuration.swift index 627d9adb757e..f171525e4394 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -7,10 +7,10 @@ import Foundation open class Configuration { - + // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} + +} \ No newline at end of file diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 93ed6b90b376..6e279679c67a 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -108,24 +108,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { if let values = values { try encodeArray(values, forKey: key) } } - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -135,7 +135,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -147,8 +147,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { - var tmpArray: [T]? + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { + var tmpArray: [T]? = nil if contains(key) { tmpArray = try decodeArray(T.self, forKey: key) @@ -157,8 +157,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { + var map: [Self.Key : T] = [:] for key in allKeys { if !excludedKeys.contains(key) { @@ -177,3 +177,5 @@ extension HTTPURLResponse { return Array(200 ..< 300).contains(statusCode) } } + + diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift index b79e9f5e64d5..08f1ef334dff 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift @@ -41,7 +41,7 @@ public struct JSONDataEncoding { } public static func encodingParameters(jsonData: Data?) -> [String: Any]? { - var returnedParams: [String: Any]? + var returnedParams: [String: Any]? = nil if let jsonData = jsonData, !jsonData.isEmpty { var params: [String: Any] = [:] params[jsonDataKey] = jsonData diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 02f78ffb4705..314f1eff1f9b 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -9,8 +9,8 @@ import Foundation open class JSONEncodingHelper { - open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { - var params: [String: Any]? + open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { + var params: [String: Any]? = nil // Encode the Encodable object if let encodableObj = encodableObj { @@ -27,7 +27,7 @@ open class JSONEncodingHelper { } open class func encodingParameters(forEncodableObject encodableObj: Any?) -> [String: Any]? { - var params: [String: Any]? + var params: [String: Any]? = nil if let encodableObj = encodableObj { do { @@ -41,5 +41,5 @@ open class JSONEncodingHelper { return params } - + } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models.swift index c0542c14c081..11e81ffcc472 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,11 +10,11 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -public enum ErrorResponse: Error { +public enum ErrorResponse : Error { case error(Int, Data?, Error) } -public enum DownloadException: Error { +public enum DownloadException : Error { case responseDataMissing case responseFailed case requestMissing @@ -30,6 +30,7 @@ public enum DecodableRequestBuilderError: Error { case generalError(Error) } + open class Response { public let statusCode: Int public let header: [String: String] @@ -43,7 +44,7 @@ open class Response { public convenience init(response: HTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String: String]() + var header = [String:String]() for (key, value) in rawHeader { if let key = key.base as? String, let value = value as? String { header[key] = value diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 1af031535967..28ca8377b889 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -7,17 +7,19 @@ import Foundation -public struct AdditionalPropertiesClass: Codable { - public var mapString: [String: String]? - public var mapMapString: [String: [String: String]]? +public struct AdditionalPropertiesClass: Codable { - public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { + + public var mapString: [String:String]? + public var mapMapString: [String:[String:String]]? + + public init(mapString: [String:String]?, mapMapString: [String:[String:String]]?) { self.mapString = mapString self.mapMapString = mapMapString } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapString = "map_string" case mapMapString = "map_map_string" } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 5ed9f31e2a36..1050d79dbe9d 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -7,7 +7,9 @@ import Foundation -public struct Animal: Codable { + +public struct Animal: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift index e09b0e9efdc8..e7bea63f8ed2 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -7,4 +7,5 @@ import Foundation + public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index ec270da89074..4d0393b9ba45 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -7,7 +7,9 @@ import Foundation -public struct ApiResponse: Codable { + +public struct ApiResponse: Codable { + public var code: Int? public var type: String? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 6c252ed475b2..1363c96394ba 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayOfArrayOfNumberOnly: Codable { + +public struct ArrayOfArrayOfNumberOnly: Codable { + public var arrayArrayNumber: [[Double]]? @@ -15,7 +17,7 @@ public struct ArrayOfArrayOfNumberOnly: Codable { self.arrayArrayNumber = arrayArrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayArrayNumber = "ArrayArrayNumber" } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index e84eb5d65025..6b8873730c43 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayOfNumberOnly: Codable { + +public struct ArrayOfNumberOnly: Codable { + public var arrayNumber: [Double]? @@ -15,7 +17,7 @@ public struct ArrayOfNumberOnly: Codable { self.arrayNumber = arrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayNumber = "ArrayNumber" } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index d2140933d181..64f7c6d9db99 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayTest: Codable { + +public struct ArrayTest: Codable { + public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? @@ -19,7 +21,7 @@ public struct ArrayTest: Codable { self.arrayArrayOfModel = arrayArrayOfModel } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" case arrayArrayOfModel = "array_array_of_model" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index d1b3b27616ed..ddb669a59045 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -7,7 +7,9 @@ import Foundation -public struct Capitalization: Codable { + +public struct Capitalization: Codable { + public var smallCamel: String? public var capitalCamel: String? @@ -26,7 +28,7 @@ public struct Capitalization: Codable { self.ATT_NAME = ATT_NAME } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case smallCamel case capitalCamel = "CapitalCamel" case smallSnake = "small_Snake" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 7ab887f3113f..c4f6e0d488ca 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -7,7 +7,9 @@ import Foundation -public struct Cat: Codable { + +public struct Cat: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index a51ad0dffab1..7b1d7e32be80 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -7,7 +7,9 @@ import Foundation -public struct CatAllOf: Codable { + +public struct CatAllOf: Codable { + public var declawed: Bool? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index eb8f7e5e1974..3ec00f5ab10d 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,7 +7,9 @@ import Foundation -public struct Category: Codable { + +public struct Category: Codable { + public var id: Int64? public var name: String = "default-name" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index e2a7d4427a06..af030c3dd626 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model with \"_class\" property */ -public struct ClassModel: Codable { +public struct ClassModel: Codable { + public var _class: String? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 00245ca37280..0aae748c76b4 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -7,7 +7,9 @@ import Foundation -public struct Client: Codable { + +public struct Client: Codable { + public var client: String? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 492c1228008e..198e28b94dd6 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -7,7 +7,9 @@ import Foundation -public struct Dog: Codable { + +public struct Dog: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 7786f8acc5ae..8ff49b2af23f 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -7,7 +7,9 @@ import Foundation -public struct DogAllOf: Codable { + +public struct DogAllOf: Codable { + public var breed: String? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 9844e7c40e35..e2d3fa04f94b 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -7,7 +7,9 @@ import Foundation -public struct EnumArrays: Codable { + +public struct EnumArrays: Codable { + public enum JustSymbol: String, Codable, CaseIterable { case greaterThanOrEqualTo = ">=" @@ -25,7 +27,7 @@ public struct EnumArrays: Codable { self.arrayEnum = arrayEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justSymbol = "just_symbol" case arrayEnum = "array_enum" } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index d4029d73f8af..c2c639ba3246 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -7,6 +7,7 @@ import Foundation + public enum EnumClass: String, Codable, CaseIterable { case abc = "_abc" case efg = "-efg" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 789f583e1d77..a56e1f36389b 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct EnumTest: Codable { + +public struct EnumTest: Codable { + public enum EnumString: String, Codable, CaseIterable { case upper = "UPPER" @@ -41,7 +43,7 @@ public struct EnumTest: Codable { self.outerEnum = outerEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case enumString = "enum_string" case enumStringRequired = "enum_string_required" case enumInteger = "enum_integer" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/File.swift index abf3ccffc485..773b53b2cb76 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -8,7 +8,8 @@ import Foundation /** Must be named `File` for test. */ -public struct File: Codable { +public struct File: Codable { + /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 532f1457939a..83dc1148cfa3 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -7,7 +7,9 @@ import Foundation -public struct FileSchemaTestClass: Codable { + +public struct FileSchemaTestClass: Codable { + public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index 20bd6d103b3d..bccd3f9fb178 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct FormatTest: Codable { + +public struct FormatTest: Codable { + public var integer: Int? public var int32: Int? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 906ddb06fb17..566d71a35ef0 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct HasOnlyReadOnly: Codable { + +public struct HasOnlyReadOnly: Codable { + public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/List.swift index fe13d302ccbf..80cecab242f2 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -7,7 +7,9 @@ import Foundation -public struct List: Codable { + +public struct List: Codable { + public var _123list: String? @@ -15,7 +17,7 @@ public struct List: Codable { self._123list = _123list } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _123list = "123-list" } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 4b6037f378ee..f0c02de95f7a 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -7,25 +7,27 @@ import Foundation -public struct MapTest: Codable { + +public struct MapTest: Codable { + public enum MapOfEnumString: String, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" } - public var mapMapOfString: [String: [String: String]]? - public var mapOfEnumString: [String: String]? - public var directMap: [String: Bool]? + public var mapMapOfString: [String:[String:String]]? + public var mapOfEnumString: [String:String]? + public var directMap: [String:Bool]? public var indirectMap: StringBooleanMap? - public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { + public init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?, directMap: [String:Bool]?, indirectMap: StringBooleanMap?) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap self.indirectMap = indirectMap } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" case directMap = "direct_map" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c3deb2f28932..710e62a9b587 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,13 +7,15 @@ import Foundation -public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { + +public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { + public var uuid: UUID? public var dateTime: Date? - public var map: [String: Animal]? + public var map: [String:Animal]? - public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { + public init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { self.uuid = uuid self.dateTime = dateTime self.map = map diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index b61db7d6e716..450a53b918ca 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model name starting with number */ -public struct Model200Response: Codable { +public struct Model200Response: Codable { + public var name: Int? public var _class: String? @@ -18,7 +19,7 @@ public struct Model200Response: Codable { self._class = _class } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case _class = "class" } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 8ab4db44b73a..6deb69fcd731 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model name same as property name */ -public struct Name: Codable { +public struct Name: Codable { + public var name: Int public var snakeCase: Int? @@ -22,7 +23,7 @@ public struct Name: Codable { self._123number = _123number } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case snakeCase = "snake_case" case property diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 4d1dafcc2c1f..0c9ee2b7b9f4 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct NumberOnly: Codable { + +public struct NumberOnly: Codable { + public var justNumber: Double? @@ -15,7 +17,7 @@ public struct NumberOnly: Codable { self.justNumber = justNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justNumber = "JustNumber" } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 40c30cc8609c..ab0eac0b304e 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,7 +7,9 @@ import Foundation -public struct Order: Codable { + +public struct Order: Codable { + public enum Status: String, Codable, CaseIterable { case placed = "placed" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 18c3a024f122..4a7d22710441 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -7,7 +7,9 @@ import Foundation -public struct OuterComposite: Codable { + +public struct OuterComposite: Codable { + public var myNumber: Double? public var myString: String? @@ -19,7 +21,7 @@ public struct OuterComposite: Codable { self.myBoolean = myBoolean } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case myNumber = "my_number" case myString = "my_string" case myBoolean = "my_boolean" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index c3b778cbbed4..9e6b8d74e874 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -7,6 +7,7 @@ import Foundation + public enum OuterEnum: String, Codable, CaseIterable { case placed = "placed" case approved = "approved" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index b9ce0e933256..a973071d6c96 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,7 +7,9 @@ import Foundation -public struct Pet: Codable { + +public struct Pet: Codable { + public enum Status: String, Codable, CaseIterable { case available = "available" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 0acd21fd1000..b2a6b7e2b8a6 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -7,7 +7,9 @@ import Foundation -public struct ReadOnlyFirst: Codable { + +public struct ReadOnlyFirst: Codable { + public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index c223f993a69e..7e089dcee2b4 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing reserved words */ -public struct Return: Codable { +public struct Return: Codable { + public var _return: Int? @@ -16,7 +17,7 @@ public struct Return: Codable { self._return = _return } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _return = "return" } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index 6e8650f76d8e..e890ef952520 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -7,7 +7,9 @@ import Foundation -public struct SpecialModelName: Codable { + +public struct SpecialModelName: Codable { + public var specialPropertyName: Int64? @@ -15,7 +17,7 @@ public struct SpecialModelName: Codable { self.specialPropertyName = specialPropertyName } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case specialPropertyName = "$special[property.name]" } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index 3f1237fee477..f65ae0623d6e 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -7,9 +7,12 @@ import Foundation -public struct StringBooleanMap: Codable { - public var additionalProperties: [String: Bool] = [:] +public struct StringBooleanMap: Codable { + + + + public var additionalProperties: [String:Bool] = [:] public subscript(key: String) -> Bool? { get { @@ -42,4 +45,5 @@ public struct StringBooleanMap: Codable { additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } + } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 4dd8a9a9f5a0..a91b6061bcf7 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,7 +7,9 @@ import Foundation -public struct Tag: Codable { + +public struct Tag: Codable { + public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index a9e088808ed3..2d377c3edb02 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -7,7 +7,9 @@ import Foundation -public struct TypeHolderDefault: Codable { + +public struct TypeHolderDefault: Codable { + public var stringItem: String = "what" public var numberItem: Double @@ -23,7 +25,7 @@ public struct TypeHolderDefault: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index dff4083ae432..e5eb92da696e 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -7,7 +7,9 @@ import Foundation -public struct TypeHolderExample: Codable { + +public struct TypeHolderExample: Codable { + public var stringItem: String public var numberItem: Double @@ -23,7 +25,7 @@ public struct TypeHolderExample: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 79f271ed7356..f70328ca9e59 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,7 +7,9 @@ import Foundation -public struct User: Codable { + +public struct User: Codable { + public var id: Int64? public var username: String? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index 55d0eb421919..22261e2ce948 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -14,7 +14,7 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { return URLSessionRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return URLSessionDecodableRequestBuilder.self } } @@ -23,16 +23,16 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { private var urlSessionStore = SynchronizedDictionary() open class URLSessionRequestBuilder: RequestBuilder { - + private var observation: NSKeyValueObservation? - + deinit { observation?.invalidate() } - + // swiftlint:disable:next weak_delegate fileprivate let sessionDelegate = SessionDelegate() - + /** May be assigned if you want to control the authentication challenges. */ @@ -45,11 +45,11 @@ open class URLSessionRequestBuilder: RequestBuilder { - retry the request. */ public var taskCompletionShouldRetry: ((Data?, URLResponse?, Error?, @escaping (Bool) -> Void) -> Void)? - - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + + required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } - + /** May be overridden by a subclass if you want to control the URLSession configuration. @@ -77,40 +77,40 @@ open class URLSessionRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the URLRequest configuration (e.g. to override the cache policy). */ - open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) throws -> URLRequest { - + open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) throws -> URLRequest { + guard let url = URL(string: URLString) else { throw DownloadException.requestMissingURL } - + var originalRequest = URLRequest(url: url) - + originalRequest.httpMethod = method.rawValue - + buildHeaders().forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + headers.forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + let modifiedRequest = try encoding.encode(originalRequest, with: parameters) - + return modifiedRequest } override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, Error>) -> Void) { - let urlSessionId: String = UUID().uuidString + let urlSessionId:String = UUID().uuidString // Create a new manager for each request to customize its request header let urlSession = createURLSession() urlSessionStore[urlSessionId] = urlSession - + let parameters: [String: Any] = self.parameters ?? [:] - + let fileKeys = parameters.filter { $1 is URL } .map { $0.0 } - + let encoding: ParameterEncoding if fileKeys.count > 0 { encoding = FileUploadEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) @@ -119,29 +119,29 @@ open class URLSessionRequestBuilder: RequestBuilder { } else { encoding = URLEncoding() } - + guard let xMethod = HTTPMethod(rawValue: method) else { fatalError("Unsuported Http method - \(method)") } - + let cleanupRequest = { urlSessionStore[urlSessionId] = nil self.observation?.invalidate() } - + do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) - + let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in - + guard let self = self else { return } - + if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - + taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in - + guard let self = self else { return } - + if shouldRetry { cleanupRequest() self.execute(apiResponseQueue, completion) @@ -157,13 +157,13 @@ open class URLSessionRequestBuilder: RequestBuilder { } } } - + if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { onProgressReady?(dataTask.progress) } - + dataTask.resume() - + } catch { apiResponseQueue.async { cleanupRequest() @@ -172,7 +172,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - + fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, Error>) -> Void) { if let error = error { @@ -192,52 +192,52 @@ open class URLSessionRequestBuilder: RequestBuilder { switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is URL.Type: do { - + guard error == nil else { throw DownloadException.responseFailed } - + guard let data = data else { throw DownloadException.responseDataMissing } - + let fileManager = FileManager.default let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] let requestURL = try self.getURL(from: urlRequest) - + var requestPath = try self.getPath(from: requestURL) - + if let headerFileName = self.getFileName(fromContentDisposition: httpResponse.allHeaderFields["Content-Disposition"] as? String) { requestPath = requestPath.appending("/\(headerFileName)") } - + let filePath = documentsDirectory.appendingPathComponent(requestPath) let directoryPath = filePath.deletingLastPathComponent().path - + try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) try data.write(to: filePath, options: .atomic) - + completion(.success(Response(response: httpResponse, body: filePath as? T))) - + } catch let requestParserError as DownloadException { completion(.failure(ErrorResponse.error(400, data, requestParserError))) } catch let error { completion(.failure(ErrorResponse.error(400, data, error))) } - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + default: - + completion(.success(Response(response: httpResponse, body: data as? T))) } @@ -251,7 +251,7 @@ open class URLSessionRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -270,7 +270,7 @@ open class URLSessionRequestBuilder: RequestBuilder { filename = contentItem return filename? - .replacingCharacters(in: range, with: "") + .replacingCharacters(in: range, with:"") .replacingOccurrences(of: "\"", with: "") .trimmingCharacters(in: .whitespacesAndNewlines) } @@ -279,7 +279,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url: URL) throws -> String { + fileprivate func getPath(from url : URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -293,7 +293,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -304,7 +304,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } -open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { +open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, Error>) -> Void) { if let error = error { @@ -324,28 +324,28 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + case is Data.Type: - + completion(.success(Response(response: httpResponse, body: data as? T))) - + default: - + guard let data = data, !data.isEmpty else { completion(.failure(ErrorResponse.error(httpResponse.statusCode, nil, DecodableRequestBuilderError.emptyDataResponse))) return } - + let decodeResult = CodableHelper.decode(T.self, from: data) - + switch decodeResult { case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) @@ -356,10 +356,10 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui } } -private class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { - +fileprivate class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { + var credential: URLCredential? - + var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { @@ -402,13 +402,13 @@ public protocol ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest } -private class URLEncoding: ParameterEncoding { - func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { - +fileprivate class URLEncoding: ParameterEncoding { + func encode(_ urlRequest: URLRequest, with parameters: [String : Any]?) throws -> URLRequest { + var urlRequest = urlRequest - + guard let parameters = parameters else { return urlRequest } - + guard let url = urlRequest.url else { throw DownloadException.requestMissingURL } @@ -417,12 +417,12 @@ private class URLEncoding: ParameterEncoding { urlComponents.queryItems = APIHelper.mapValuesToQueryItems(parameters) urlRequest.url = urlComponents.url } - + return urlRequest } } -private class FileUploadEncoding: ParameterEncoding { +fileprivate class FileUploadEncoding: ParameterEncoding { let contentTypeForFormPart: (_ fileURL: URL) -> String? @@ -433,13 +433,13 @@ private class FileUploadEncoding: ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { var urlRequest = urlRequest - + guard let parameters = parameters, !parameters.isEmpty else { return urlRequest } - + let boundary = "Boundary-\(UUID().uuidString)" - + urlRequest.setValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type") for (key, value) in parameters { @@ -479,7 +479,7 @@ private class FileUploadEncoding: ParameterEncoding { fatalError("Unprocessable value \(value) with key \(key)") } } - + var body = urlRequest.httpBody.orEmpty body.append("\r\n--\(boundary)--\r\n") @@ -494,7 +494,7 @@ private class FileUploadEncoding: ParameterEncoding { var urlRequest = urlRequest var body = urlRequest.httpBody.orEmpty - + let fileData = try Data(contentsOf: fileURL) let mimetype = self.contentTypeForFormPart(fileURL) ?? mimeType(for: fileURL) @@ -502,7 +502,7 @@ private class FileUploadEncoding: ParameterEncoding { let fileName = fileURL.lastPathComponent // If we already added something then we need an additional newline. - if body.count > 0 { + if (body.count > 0) { body.append("\r\n") } @@ -518,20 +518,20 @@ private class FileUploadEncoding: ParameterEncoding { // The value data. body.append(fileData) - + urlRequest.httpBody = body return urlRequest } - + private func configureDataUploadRequest(urlRequest: URLRequest, boundary: String, name: String, data: Data) -> URLRequest { var urlRequest = urlRequest - + var body = urlRequest.httpBody.orEmpty // If we already added something then we need an additional newline. - if body.count > 0 { + if (body.count > 0) { body.append("\r\n") } diff --git a/samples/client/petstore/swift5/deprecated/Package.swift b/samples/client/petstore/swift5/deprecated/Package.swift index 96dfff54edf4..79f6f8188738 100644 --- a/samples/client/petstore/swift5/deprecated/Package.swift +++ b/samples/client/petstore/swift5/deprecated/Package.swift @@ -14,7 +14,7 @@ let package = Package( // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "PetstoreClient", - targets: ["PetstoreClient"]) + targets: ["PetstoreClient"]), ], dependencies: [ // Dependencies declare other packages that this package depends on. @@ -26,6 +26,6 @@ let package = Package( name: "PetstoreClient", dependencies: [], path: "PetstoreClient/Classes" - ) + ), ] ) diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 5b09f9557113..2404bc8ffc6d 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { + public static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { let destination = source.reduce(into: [String: Any]()) { (result, item) in if let value = item.value { result[item.key] = value @@ -20,17 +20,17 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { + public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? [Any?] { - result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") + if let collection = item.value as? Array { + result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { + public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { guard let source = source else { return nil } @@ -46,15 +46,15 @@ public struct APIHelper { } public static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? [Any?] { + if let collection = source as? Array { return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") } return source } - public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { + public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? [Any?] { + if let collection = item.value as? Array { collection.filter({ $0 != nil }).map({"\($0!)"}).forEach { value in result.append(URLQueryItem(name: item.key, value: value)) } @@ -69,3 +69,4 @@ public struct APIHelper { return destination } } + diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs.swift index 74babd69f97c..92d547e0d69d 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,15 +9,15 @@ import Foundation open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io/v2" public static var credential: URLCredential? - public static var customHeaders: [String: String] = [:] + public static var customHeaders: [String:String] = [:] public static var requestBuilderFactory: RequestBuilderFactory = URLSessionRequestBuilderFactory() public static var apiResponseQueue: DispatchQueue = .main } open class RequestBuilder { var credential: URLCredential? - var headers: [String: String] - public let parameters: [String: Any]? + var headers: [String:String] + public let parameters: [String:Any]? public let isBody: Bool public let method: String public let URLString: String @@ -25,9 +25,9 @@ open class RequestBuilder { /// Optional block to obtain a reference to the request's progress instance when available. /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. /// If you need to get the request's progress in older OS versions, please use Alamofire http client. - public var onProgressReady: ((Progress) -> Void)? + public var onProgressReady: ((Progress) -> ())? - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -37,7 +37,7 @@ open class RequestBuilder { addHeaders(PetstoreClientAPI.customHeaders) } - open func addHeaders(_ aHeaders: [String: String]) { + open func addHeaders(_ aHeaders:[String:String]) { for (header, value) in aHeaders { headers[header] = value } @@ -60,5 +60,5 @@ open class RequestBuilder { public protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 06a266aab47c..dbbbd66db265 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class PetAPI { /** Add a new pet to the store @@ -15,7 +17,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func addPet(pet: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func addPet(pet: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { addPetWithRequestBuilder(pet: pet).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -55,7 +57,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -82,8 +84,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let nillableHeaders: [String: Any?] = [ "api_key": apiKey?.encodeToJSON() @@ -111,7 +113,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { + open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -135,8 +137,8 @@ open class PetAPI { open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "status": status.encodeToJSON() @@ -155,7 +157,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @available(*, deprecated, message: "This operation is deprecated.") - open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { + open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -180,8 +182,8 @@ open class PetAPI { open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "tags": tags.encodeToJSON() @@ -199,7 +201,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) { + open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?,_ error: Error?) -> Void)) { getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -226,8 +228,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -242,7 +244,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePet(pet: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func updatePet(pet: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { updatePetWithRequestBuilder(pet: pet).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -283,7 +285,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -311,14 +313,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "name": name?.encodeToJSON(), "status": status?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -335,7 +337,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -363,14 +365,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "file": file?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index ff1100159542..16fb9c207a4f 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class StoreAPI { /** Delete purchase order by ID @@ -15,7 +17,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -39,8 +41,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{orderId}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -54,7 +56,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) { + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String:Int]?,_ error: Error?) -> Void)) { getInventoryWithRequestBuilder().execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -74,14 +76,14 @@ open class StoreAPI { - name: api_key - returns: RequestBuilder<[String:Int]> */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { + open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } @@ -93,7 +95,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { + open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -117,8 +119,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{orderId}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -133,7 +135,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func placeOrder(order: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { + open class func placeOrder(order: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { placeOrderWithRequestBuilder(order: order).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 04a9b99643c0..8220640259af 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class UserAPI { /** Create user @@ -15,7 +17,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func createUser(user: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func createUser(user: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { createUserWithRequestBuilder(user: user).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -55,7 +57,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithArrayInput(user: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func createUsersWithArrayInput(user: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { createUsersWithArrayInputWithRequestBuilder(user: user).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -94,7 +96,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithListInput(user: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func createUsersWithListInput(user: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { createUsersWithListInputWithRequestBuilder(user: user).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -133,7 +135,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -160,8 +162,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -176,7 +178,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) { + open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?,_ error: Error?) -> Void)) { getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -199,8 +201,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -216,7 +218,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { + open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -238,11 +240,11 @@ open class UserAPI { open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username.encodeToJSON(), + "username": username.encodeToJSON(), "password": password.encodeToJSON() ]) @@ -257,7 +259,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { logoutUserWithRequestBuilder().execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -279,8 +281,8 @@ open class UserAPI { open class func logoutUserWithRequestBuilder() -> RequestBuilder { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -296,7 +298,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func updateUser(username: String, user: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func updateUser(username: String, user: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { updateUserWithRequestBuilder(username: username, user: user).execute(apiResponseQueue) { result -> Void in switch result { case .success: diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index ef971ebadc60..01b28a4bd42d 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -45,4 +45,4 @@ open class CodableHelper { open class func encode(_ value: T) -> Swift.Result where T: Encodable { return Swift.Result { try self.jsonEncoder.encode(value) } } -} +} \ No newline at end of file diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Configuration.swift index 627d9adb757e..f171525e4394 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -7,10 +7,10 @@ import Foundation open class Configuration { - + // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} + +} \ No newline at end of file diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 93ed6b90b376..6e279679c67a 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -108,24 +108,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { if let values = values { try encodeArray(values, forKey: key) } } - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -135,7 +135,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -147,8 +147,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { - var tmpArray: [T]? + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { + var tmpArray: [T]? = nil if contains(key) { tmpArray = try decodeArray(T.self, forKey: key) @@ -157,8 +157,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { + var map: [Self.Key : T] = [:] for key in allKeys { if !excludedKeys.contains(key) { @@ -177,3 +177,5 @@ extension HTTPURLResponse { return Array(200 ..< 300).contains(statusCode) } } + + diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift index b79e9f5e64d5..08f1ef334dff 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift @@ -41,7 +41,7 @@ public struct JSONDataEncoding { } public static func encodingParameters(jsonData: Data?) -> [String: Any]? { - var returnedParams: [String: Any]? + var returnedParams: [String: Any]? = nil if let jsonData = jsonData, !jsonData.isEmpty { var params: [String: Any] = [:] params[jsonDataKey] = jsonData diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 02f78ffb4705..314f1eff1f9b 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -9,8 +9,8 @@ import Foundation open class JSONEncodingHelper { - open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { - var params: [String: Any]? + open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { + var params: [String: Any]? = nil // Encode the Encodable object if let encodableObj = encodableObj { @@ -27,7 +27,7 @@ open class JSONEncodingHelper { } open class func encodingParameters(forEncodableObject encodableObj: Any?) -> [String: Any]? { - var params: [String: Any]? + var params: [String: Any]? = nil if let encodableObj = encodableObj { do { @@ -41,5 +41,5 @@ open class JSONEncodingHelper { return params } - + } diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models.swift index c0542c14c081..11e81ffcc472 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,11 +10,11 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -public enum ErrorResponse: Error { +public enum ErrorResponse : Error { case error(Int, Data?, Error) } -public enum DownloadException: Error { +public enum DownloadException : Error { case responseDataMissing case responseFailed case requestMissing @@ -30,6 +30,7 @@ public enum DecodableRequestBuilderError: Error { case generalError(Error) } + open class Response { public let statusCode: Int public let header: [String: String] @@ -43,7 +44,7 @@ open class Response { public convenience init(response: HTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String: String]() + var header = [String:String]() for (key, value) in rawHeader { if let key = key.base as? String, let value = value as? String { header[key] = value diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index e74820fd28ac..cab2fbb07782 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -8,7 +8,8 @@ import Foundation /** Describes the result of uploading an image resource */ -public struct ApiResponse: Codable { +public struct ApiResponse: Codable { + public var code: Int? public var type: String? diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index fec18cc7a6c7..7006e56507f5 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -8,7 +8,8 @@ import Foundation /** A category for a pet */ -public struct Category: Codable { +public struct Category: Codable { + public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/InlineObject.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/InlineObject.swift index ac5216fe6876..1c8072f6bada 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/InlineObject.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/InlineObject.swift @@ -7,7 +7,9 @@ import Foundation -public struct InlineObject: Codable { + +public struct InlineObject: Codable { + /** Updated name of the pet */ public var name: String? diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/InlineObject1.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/InlineObject1.swift index 1c2fd3255dd1..fa806b07294d 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/InlineObject1.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/InlineObject1.swift @@ -7,7 +7,9 @@ import Foundation -public struct InlineObject1: Codable { + +public struct InlineObject1: Codable { + /** Additional data to pass to server */ public var additionalMetadata: String? diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 1fa6995d1c7b..1adf3d7acc7e 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -9,7 +9,8 @@ import Foundation /** An order for a pets from the pet store */ @available(*, deprecated, message: "This schema is deprecated.") -public struct Order: Codable { +public struct Order: Codable { + public enum Status: String, Codable, CaseIterable { case placed = "placed" diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index 622f2c9bd432..ffd5eb5d9165 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -8,7 +8,8 @@ import Foundation /** A pet for sale in the pet store */ -public struct Pet: Codable { +public struct Pet: Codable { + public enum Status: String, Codable, CaseIterable { case available = "available" @@ -18,7 +19,7 @@ public struct Pet: Codable { public var id: Int64? public var category: Category? public var name: String? - + @available(*, deprecated, message: "This property is deprecated.") public var photoUrls: [String] public var tags: [Tag]? diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 98a78982e592..55993174744a 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -8,7 +8,8 @@ import Foundation /** A tag for a pet */ -public struct Tag: Codable { +public struct Tag: Codable { + public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 4e42f6f28595..ddf682b7dde2 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -8,7 +8,8 @@ import Foundation /** A User who is purchasing from the pet store */ -public struct User: Codable { +public struct User: Codable { + public var id: Int64? public var username: String? diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index 55d0eb421919..22261e2ce948 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -14,7 +14,7 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { return URLSessionRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return URLSessionDecodableRequestBuilder.self } } @@ -23,16 +23,16 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { private var urlSessionStore = SynchronizedDictionary() open class URLSessionRequestBuilder: RequestBuilder { - + private var observation: NSKeyValueObservation? - + deinit { observation?.invalidate() } - + // swiftlint:disable:next weak_delegate fileprivate let sessionDelegate = SessionDelegate() - + /** May be assigned if you want to control the authentication challenges. */ @@ -45,11 +45,11 @@ open class URLSessionRequestBuilder: RequestBuilder { - retry the request. */ public var taskCompletionShouldRetry: ((Data?, URLResponse?, Error?, @escaping (Bool) -> Void) -> Void)? - - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + + required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } - + /** May be overridden by a subclass if you want to control the URLSession configuration. @@ -77,40 +77,40 @@ open class URLSessionRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the URLRequest configuration (e.g. to override the cache policy). */ - open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) throws -> URLRequest { - + open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) throws -> URLRequest { + guard let url = URL(string: URLString) else { throw DownloadException.requestMissingURL } - + var originalRequest = URLRequest(url: url) - + originalRequest.httpMethod = method.rawValue - + buildHeaders().forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + headers.forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + let modifiedRequest = try encoding.encode(originalRequest, with: parameters) - + return modifiedRequest } override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, Error>) -> Void) { - let urlSessionId: String = UUID().uuidString + let urlSessionId:String = UUID().uuidString // Create a new manager for each request to customize its request header let urlSession = createURLSession() urlSessionStore[urlSessionId] = urlSession - + let parameters: [String: Any] = self.parameters ?? [:] - + let fileKeys = parameters.filter { $1 is URL } .map { $0.0 } - + let encoding: ParameterEncoding if fileKeys.count > 0 { encoding = FileUploadEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) @@ -119,29 +119,29 @@ open class URLSessionRequestBuilder: RequestBuilder { } else { encoding = URLEncoding() } - + guard let xMethod = HTTPMethod(rawValue: method) else { fatalError("Unsuported Http method - \(method)") } - + let cleanupRequest = { urlSessionStore[urlSessionId] = nil self.observation?.invalidate() } - + do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) - + let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in - + guard let self = self else { return } - + if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - + taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in - + guard let self = self else { return } - + if shouldRetry { cleanupRequest() self.execute(apiResponseQueue, completion) @@ -157,13 +157,13 @@ open class URLSessionRequestBuilder: RequestBuilder { } } } - + if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { onProgressReady?(dataTask.progress) } - + dataTask.resume() - + } catch { apiResponseQueue.async { cleanupRequest() @@ -172,7 +172,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - + fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, Error>) -> Void) { if let error = error { @@ -192,52 +192,52 @@ open class URLSessionRequestBuilder: RequestBuilder { switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is URL.Type: do { - + guard error == nil else { throw DownloadException.responseFailed } - + guard let data = data else { throw DownloadException.responseDataMissing } - + let fileManager = FileManager.default let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] let requestURL = try self.getURL(from: urlRequest) - + var requestPath = try self.getPath(from: requestURL) - + if let headerFileName = self.getFileName(fromContentDisposition: httpResponse.allHeaderFields["Content-Disposition"] as? String) { requestPath = requestPath.appending("/\(headerFileName)") } - + let filePath = documentsDirectory.appendingPathComponent(requestPath) let directoryPath = filePath.deletingLastPathComponent().path - + try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) try data.write(to: filePath, options: .atomic) - + completion(.success(Response(response: httpResponse, body: filePath as? T))) - + } catch let requestParserError as DownloadException { completion(.failure(ErrorResponse.error(400, data, requestParserError))) } catch let error { completion(.failure(ErrorResponse.error(400, data, error))) } - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + default: - + completion(.success(Response(response: httpResponse, body: data as? T))) } @@ -251,7 +251,7 @@ open class URLSessionRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -270,7 +270,7 @@ open class URLSessionRequestBuilder: RequestBuilder { filename = contentItem return filename? - .replacingCharacters(in: range, with: "") + .replacingCharacters(in: range, with:"") .replacingOccurrences(of: "\"", with: "") .trimmingCharacters(in: .whitespacesAndNewlines) } @@ -279,7 +279,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url: URL) throws -> String { + fileprivate func getPath(from url : URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -293,7 +293,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -304,7 +304,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } -open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { +open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, Error>) -> Void) { if let error = error { @@ -324,28 +324,28 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + case is Data.Type: - + completion(.success(Response(response: httpResponse, body: data as? T))) - + default: - + guard let data = data, !data.isEmpty else { completion(.failure(ErrorResponse.error(httpResponse.statusCode, nil, DecodableRequestBuilderError.emptyDataResponse))) return } - + let decodeResult = CodableHelper.decode(T.self, from: data) - + switch decodeResult { case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) @@ -356,10 +356,10 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui } } -private class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { - +fileprivate class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { + var credential: URLCredential? - + var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { @@ -402,13 +402,13 @@ public protocol ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest } -private class URLEncoding: ParameterEncoding { - func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { - +fileprivate class URLEncoding: ParameterEncoding { + func encode(_ urlRequest: URLRequest, with parameters: [String : Any]?) throws -> URLRequest { + var urlRequest = urlRequest - + guard let parameters = parameters else { return urlRequest } - + guard let url = urlRequest.url else { throw DownloadException.requestMissingURL } @@ -417,12 +417,12 @@ private class URLEncoding: ParameterEncoding { urlComponents.queryItems = APIHelper.mapValuesToQueryItems(parameters) urlRequest.url = urlComponents.url } - + return urlRequest } } -private class FileUploadEncoding: ParameterEncoding { +fileprivate class FileUploadEncoding: ParameterEncoding { let contentTypeForFormPart: (_ fileURL: URL) -> String? @@ -433,13 +433,13 @@ private class FileUploadEncoding: ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { var urlRequest = urlRequest - + guard let parameters = parameters, !parameters.isEmpty else { return urlRequest } - + let boundary = "Boundary-\(UUID().uuidString)" - + urlRequest.setValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type") for (key, value) in parameters { @@ -479,7 +479,7 @@ private class FileUploadEncoding: ParameterEncoding { fatalError("Unprocessable value \(value) with key \(key)") } } - + var body = urlRequest.httpBody.orEmpty body.append("\r\n--\(boundary)--\r\n") @@ -494,7 +494,7 @@ private class FileUploadEncoding: ParameterEncoding { var urlRequest = urlRequest var body = urlRequest.httpBody.orEmpty - + let fileData = try Data(contentsOf: fileURL) let mimetype = self.contentTypeForFormPart(fileURL) ?? mimeType(for: fileURL) @@ -502,7 +502,7 @@ private class FileUploadEncoding: ParameterEncoding { let fileName = fileURL.lastPathComponent // If we already added something then we need an additional newline. - if body.count > 0 { + if (body.count > 0) { body.append("\r\n") } @@ -518,20 +518,20 @@ private class FileUploadEncoding: ParameterEncoding { // The value data. body.append(fileData) - + urlRequest.httpBody = body return urlRequest } - + private func configureDataUploadRequest(urlRequest: URLRequest, boundary: String, name: String, data: Data) -> URLRequest { var urlRequest = urlRequest - + var body = urlRequest.httpBody.orEmpty // If we already added something then we need an additional newline. - if body.count > 0 { + if (body.count > 0) { body.append("\r\n") } diff --git a/samples/client/petstore/swift5/nonPublicApi/Package.swift b/samples/client/petstore/swift5/nonPublicApi/Package.swift index 96dfff54edf4..79f6f8188738 100644 --- a/samples/client/petstore/swift5/nonPublicApi/Package.swift +++ b/samples/client/petstore/swift5/nonPublicApi/Package.swift @@ -14,7 +14,7 @@ let package = Package( // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "PetstoreClient", - targets: ["PetstoreClient"]) + targets: ["PetstoreClient"]), ], dependencies: [ // Dependencies declare other packages that this package depends on. @@ -26,6 +26,6 @@ let package = Package( name: "PetstoreClient", dependencies: [], path: "PetstoreClient/Classes" - ) + ), ] ) diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 1a1716eb8a3a..799478f138f9 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation internal struct APIHelper { - internal static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { + internal static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { let destination = source.reduce(into: [String: Any]()) { (result, item) in if let value = item.value { result[item.key] = value @@ -20,17 +20,17 @@ internal struct APIHelper { return destination } - internal static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { + internal static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? [Any?] { - result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") + if let collection = item.value as? Array { + result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - internal static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { + internal static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { guard let source = source else { return nil } @@ -46,15 +46,15 @@ internal struct APIHelper { } internal static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? [Any?] { + if let collection = source as? Array { return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") } return source } - internal static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { + internal static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? [Any?] { + if let collection = item.value as? Array { collection.filter({ $0 != nil }).map({"\($0!)"}).forEach { value in result.append(URLQueryItem(name: item.key, value: value)) } @@ -69,3 +69,4 @@ internal struct APIHelper { return destination } } + diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs.swift index 5dfbd9cea8d9..7fa1e45632eb 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,15 +9,15 @@ import Foundation internal class PetstoreClientAPI { internal static var basePath = "http://petstore.swagger.io:80/v2" internal static var credential: URLCredential? - internal static var customHeaders: [String: String] = [:] + internal static var customHeaders: [String:String] = [:] internal static var requestBuilderFactory: RequestBuilderFactory = URLSessionRequestBuilderFactory() internal static var apiResponseQueue: DispatchQueue = .main } internal class RequestBuilder { var credential: URLCredential? - var headers: [String: String] - internal let parameters: [String: Any]? + var headers: [String:String] + internal let parameters: [String:Any]? internal let isBody: Bool internal let method: String internal let URLString: String @@ -25,9 +25,9 @@ internal class RequestBuilder { /// Optional block to obtain a reference to the request's progress instance when available. /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. /// If you need to get the request's progress in older OS versions, please use Alamofire http client. - internal var onProgressReady: ((Progress) -> Void)? + internal var onProgressReady: ((Progress) -> ())? - required internal init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + required internal init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -37,7 +37,7 @@ internal class RequestBuilder { addHeaders(PetstoreClientAPI.customHeaders) } - internal func addHeaders(_ aHeaders: [String: String]) { + internal func addHeaders(_ aHeaders:[String:String]) { for (header, value) in aHeaders { headers[header] = value } @@ -60,5 +60,5 @@ internal class RequestBuilder { internal protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 174e6c12aedd..81f23f107ad6 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -7,6 +7,8 @@ import Foundation + + internal class AnotherFakeAPI { /** To test special tags @@ -15,7 +17,7 @@ internal class AnotherFakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + internal class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index ab1b8f092475..e52322c01c51 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -7,6 +7,8 @@ import Foundation + + internal class FakeAPI { /** @@ -14,7 +16,7 @@ internal class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) { + internal class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?,_ error: Error?) -> Void)) { fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -49,7 +51,7 @@ internal class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) { + internal class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?,_ error: Error?) -> Void)) { fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -84,7 +86,7 @@ internal class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) { + internal class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?,_ error: Error?) -> Void)) { fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -119,7 +121,7 @@ internal class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { + internal class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -154,7 +156,7 @@ internal class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + internal class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -190,7 +192,7 @@ internal class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + internal class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -229,7 +231,7 @@ internal class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + internal class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -279,7 +281,7 @@ internal class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func testEndpointParameters(integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, number: Double, float: Float? = nil, double: Double, string: String? = nil, patternWithoutDelimiter: String, byte: Data, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + internal class func testEndpointParameters(integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, number: Double, float: Float? = nil, double: Double, string: String? = nil, patternWithoutDelimiter: String, byte: Data, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testEndpointParametersWithRequestBuilder(integer: integer, int32: int32, int64: int64, number: number, float: float, double: double, string: string, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -316,7 +318,7 @@ internal class FakeAPI { internal class func testEndpointParametersWithRequestBuilder(integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, number: Double, float: Float? = nil, double: Double, string: String? = nil, patternWithoutDelimiter: String, byte: Data, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "integer": integer?.encodeToJSON(), "int32": int32?.encodeToJSON(), "int64": int64?.encodeToJSON(), @@ -335,7 +337,7 @@ internal class FakeAPI { let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -424,7 +426,7 @@ internal class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + internal class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -452,19 +454,19 @@ internal class FakeAPI { internal class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "enum_form_string_array": enumFormStringArray?.encodeToJSON(), "enum_form_string": enumFormString?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), - "enum_query_string": enumQueryString?.encodeToJSON(), - "enum_query_integer": enumQueryInteger?.encodeToJSON(), + "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), + "enum_query_string": enumQueryString?.encodeToJSON(), + "enum_query_integer": enumQueryInteger?.encodeToJSON(), "enum_query_double": enumQueryDouble?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -490,7 +492,7 @@ internal class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + internal class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -516,13 +518,13 @@ internal class FakeAPI { internal class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), "int64_group": int64Group?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -543,7 +545,7 @@ internal class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + internal class func testInlineAdditionalProperties(param: [String:String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -560,7 +562,7 @@ internal class FakeAPI { - parameter param: (body) request body - returns: RequestBuilder */ - internal class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { + internal class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { let path = "/fake/inline-additionalProperties" let URLString = PetstoreClientAPI.basePath + path let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) @@ -580,7 +582,7 @@ internal class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + internal class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -601,14 +603,14 @@ internal class FakeAPI { internal class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { let path = "/fake/jsonFormData" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "param": param.encodeToJSON(), "param2": param2.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 548c5fb35236..969fc92e025d 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -7,6 +7,8 @@ import Foundation + + internal class FakeClassnameTags123API { /** To test class name in snake case @@ -15,7 +17,7 @@ internal class FakeClassnameTags123API { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + internal class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index cb54fce0dcb1..d4b32bb967e5 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -7,6 +7,8 @@ import Foundation + + internal class PetAPI { /** Add a new pet to the store @@ -15,7 +17,7 @@ internal class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + internal class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -55,7 +57,7 @@ internal class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func deletePet(apiKey: String? = nil, petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + internal class func deletePet(apiKey: String? = nil, petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { deletePetWithRequestBuilder(apiKey: apiKey, petId: petId).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -82,8 +84,8 @@ internal class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let nillableHeaders: [String: Any?] = [ "api_key": apiKey?.encodeToJSON() @@ -111,7 +113,7 @@ internal class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { + internal class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -135,8 +137,8 @@ internal class PetAPI { internal class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "status": status.encodeToJSON() @@ -155,7 +157,7 @@ internal class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @available(*, deprecated, message: "This operation is deprecated.") - internal class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { + internal class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -180,8 +182,8 @@ internal class PetAPI { internal class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "tags": tags.encodeToJSON() @@ -199,7 +201,7 @@ internal class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) { + internal class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?,_ error: Error?) -> Void)) { getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -226,8 +228,8 @@ internal class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -242,7 +244,7 @@ internal class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + internal class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -283,7 +285,7 @@ internal class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + internal class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -311,14 +313,14 @@ internal class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "name": name?.encodeToJSON(), "status": status?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -335,7 +337,7 @@ internal class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { + internal class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -363,14 +365,14 @@ internal class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "file": file?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -387,7 +389,7 @@ internal class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func uploadFileWithRequiredFile(petId: Int64, additionalMetadata: String? = nil, requiredFile: URL, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { + internal class func uploadFileWithRequiredFile(petId: Int64, additionalMetadata: String? = nil, requiredFile: URL, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { uploadFileWithRequiredFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, requiredFile: requiredFile).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -415,14 +417,14 @@ internal class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "requiredFile": requiredFile.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index f1e423111d09..528a19a9032b 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -7,6 +7,8 @@ import Foundation + + internal class StoreAPI { /** Delete purchase order by ID @@ -15,7 +17,7 @@ internal class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + internal class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -39,8 +41,8 @@ internal class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -54,7 +56,7 @@ internal class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) { + internal class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String:Int]?,_ error: Error?) -> Void)) { getInventoryWithRequestBuilder().execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -74,14 +76,14 @@ internal class StoreAPI { - name: api_key - returns: RequestBuilder<[String:Int]> */ - internal class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { + internal class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } @@ -93,7 +95,7 @@ internal class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { + internal class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -117,8 +119,8 @@ internal class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -133,7 +135,7 @@ internal class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { + internal class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index c8d714e89916..298a7fee4850 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -7,6 +7,8 @@ import Foundation + + internal class UserAPI { /** Create user @@ -15,7 +17,7 @@ internal class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + internal class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -52,7 +54,7 @@ internal class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + internal class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -88,7 +90,7 @@ internal class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + internal class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -124,7 +126,7 @@ internal class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + internal class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -148,8 +150,8 @@ internal class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -164,7 +166,7 @@ internal class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) { + internal class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?,_ error: Error?) -> Void)) { getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -187,8 +189,8 @@ internal class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -204,7 +206,7 @@ internal class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { + internal class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -226,11 +228,11 @@ internal class UserAPI { internal class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username.encodeToJSON(), + "username": username.encodeToJSON(), "password": password.encodeToJSON() ]) @@ -245,7 +247,7 @@ internal class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + internal class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { logoutUserWithRequestBuilder().execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -264,8 +266,8 @@ internal class UserAPI { internal class func logoutUserWithRequestBuilder() -> RequestBuilder { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -281,7 +283,7 @@ internal class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + internal class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index 280238b8263d..1fcfa109860d 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -45,4 +45,4 @@ internal class CodableHelper { internal class func encode(_ value: T) -> Swift.Result where T: Encodable { return Swift.Result { try self.jsonEncoder.encode(value) } } -} +} \ No newline at end of file diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Configuration.swift index 4dfbe7b0cde7..400d8bd126c7 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -7,10 +7,10 @@ import Foundation internal class Configuration { - + // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") internal static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} + +} \ No newline at end of file diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Extensions.swift index e5511b3aa373..f7550a684a7a 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -108,24 +108,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - internal mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { + internal mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - internal mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { + internal mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { if let values = values { try encodeArray(values, forKey: key) } } - internal mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { + internal mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - internal mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { + internal mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -135,7 +135,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - internal func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { + internal func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -147,8 +147,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - internal func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { - var tmpArray: [T]? + internal func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { + var tmpArray: [T]? = nil if contains(key) { tmpArray = try decodeArray(T.self, forKey: key) @@ -157,8 +157,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - internal func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] + internal func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { + var map: [Self.Key : T] = [:] for key in allKeys { if !excludedKeys.contains(key) { @@ -177,3 +177,5 @@ extension HTTPURLResponse { return Array(200 ..< 300).contains(statusCode) } } + + diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift index 6b69f3b1bd50..332e960ac68c 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift @@ -41,7 +41,7 @@ internal struct JSONDataEncoding { } internal static func encodingParameters(jsonData: Data?) -> [String: Any]? { - var returnedParams: [String: Any]? + var returnedParams: [String: Any]? = nil if let jsonData = jsonData, !jsonData.isEmpty { var params: [String: Any] = [:] params[jsonDataKey] = jsonData diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 7d8f433dfea7..47329d53ee41 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -9,8 +9,8 @@ import Foundation internal class JSONEncodingHelper { - internal class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { - var params: [String: Any]? + internal class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { + var params: [String: Any]? = nil // Encode the Encodable object if let encodableObj = encodableObj { @@ -27,7 +27,7 @@ internal class JSONEncodingHelper { } internal class func encodingParameters(forEncodableObject encodableObj: Any?) -> [String: Any]? { - var params: [String: Any]? + var params: [String: Any]? = nil if let encodableObj = encodableObj { do { @@ -41,5 +41,5 @@ internal class JSONEncodingHelper { return params } - + } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models.swift index 6089ac67d0d8..236120acc15e 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,11 +10,11 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -internal enum ErrorResponse: Error { +internal enum ErrorResponse : Error { case error(Int, Data?, Error) } -internal enum DownloadException: Error { +internal enum DownloadException : Error { case responseDataMissing case responseFailed case requestMissing @@ -30,6 +30,7 @@ internal enum DecodableRequestBuilderError: Error { case generalError(Error) } + internal class Response { internal let statusCode: Int internal let header: [String: String] @@ -43,7 +44,7 @@ internal class Response { internal convenience init(response: HTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String: String]() + var header = [String:String]() for (key, value) in rawHeader { if let key = key.base as? String, let value = value as? String { header[key] = value diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index b4d5ae6faf93..c8876320f47a 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -7,17 +7,19 @@ import Foundation -internal struct AdditionalPropertiesClass: Codable { - internal var mapString: [String: String]? - internal var mapMapString: [String: [String: String]]? +internal struct AdditionalPropertiesClass: Codable { - internal init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { + + internal var mapString: [String:String]? + internal var mapMapString: [String:[String:String]]? + + internal init(mapString: [String:String]?, mapMapString: [String:[String:String]]?) { self.mapString = mapString self.mapMapString = mapMapString } - internal enum CodingKeys: String, CodingKey, CaseIterable { + internal enum CodingKeys: String, CodingKey, CaseIterable { case mapString = "map_string" case mapMapString = "map_map_string" } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index ada7f86de509..20d157f4ebcb 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -7,7 +7,9 @@ import Foundation -internal struct Animal: Codable { + +internal struct Animal: Codable { + internal var className: String internal var color: String? = "red" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift index 3ebe9e9a5dea..9c570350859f 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -7,4 +7,5 @@ import Foundation + internal typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index b60d8999b4b2..88b4b69c1668 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -7,7 +7,9 @@ import Foundation -internal struct ApiResponse: Codable { + +internal struct ApiResponse: Codable { + internal var code: Int? internal var type: String? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 67371b816b30..3e8bc3da83b1 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -internal struct ArrayOfArrayOfNumberOnly: Codable { + +internal struct ArrayOfArrayOfNumberOnly: Codable { + internal var arrayArrayNumber: [[Double]]? @@ -15,7 +17,7 @@ internal struct ArrayOfArrayOfNumberOnly: Codable { self.arrayArrayNumber = arrayArrayNumber } - internal enum CodingKeys: String, CodingKey, CaseIterable { + internal enum CodingKeys: String, CodingKey, CaseIterable { case arrayArrayNumber = "ArrayArrayNumber" } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index 2c7047eac4b0..8e92c78e4da3 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -internal struct ArrayOfNumberOnly: Codable { + +internal struct ArrayOfNumberOnly: Codable { + internal var arrayNumber: [Double]? @@ -15,7 +17,7 @@ internal struct ArrayOfNumberOnly: Codable { self.arrayNumber = arrayNumber } - internal enum CodingKeys: String, CodingKey, CaseIterable { + internal enum CodingKeys: String, CodingKey, CaseIterable { case arrayNumber = "ArrayNumber" } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index 9c3a3a9f5e1f..d7916cf20b9c 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -7,7 +7,9 @@ import Foundation -internal struct ArrayTest: Codable { + +internal struct ArrayTest: Codable { + internal var arrayOfString: [String]? internal var arrayArrayOfInteger: [[Int64]]? @@ -19,7 +21,7 @@ internal struct ArrayTest: Codable { self.arrayArrayOfModel = arrayArrayOfModel } - internal enum CodingKeys: String, CodingKey, CaseIterable { + internal enum CodingKeys: String, CodingKey, CaseIterable { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" case arrayArrayOfModel = "array_array_of_model" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index 965ec5aefba3..17221a54edb6 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -7,7 +7,9 @@ import Foundation -internal struct Capitalization: Codable { + +internal struct Capitalization: Codable { + internal var smallCamel: String? internal var capitalCamel: String? @@ -26,7 +28,7 @@ internal struct Capitalization: Codable { self.ATT_NAME = ATT_NAME } - internal enum CodingKeys: String, CodingKey, CaseIterable { + internal enum CodingKeys: String, CodingKey, CaseIterable { case smallCamel case capitalCamel = "CapitalCamel" case smallSnake = "small_Snake" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 8a603dee5f1f..28292469ddae 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -7,7 +7,9 @@ import Foundation -internal struct Cat: Codable { + +internal struct Cat: Codable { + internal var className: String internal var color: String? = "red" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index 45b7dbb26dcf..cdcb1aa14b57 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -7,7 +7,9 @@ import Foundation -internal struct CatAllOf: Codable { + +internal struct CatAllOf: Codable { + internal var declawed: Bool? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index 849bf788dfb3..9b061937e091 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,7 +7,9 @@ import Foundation -internal struct Category: Codable { + +internal struct Category: Codable { + internal var id: Int64? internal var name: String = "default-name" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index 0f1bc19fe595..034cbadc8dd6 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model with \"_class\" property */ -internal struct ClassModel: Codable { +internal struct ClassModel: Codable { + internal var _class: String? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index ddee836043fa..e33907ca3a3c 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -7,7 +7,9 @@ import Foundation -internal struct Client: Codable { + +internal struct Client: Codable { + internal var client: String? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 6b5250de4a4a..3d45b8ac7a13 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -7,7 +7,9 @@ import Foundation -internal struct Dog: Codable { + +internal struct Dog: Codable { + internal var className: String internal var color: String? = "red" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index ef3ff7f1d78b..6fb9a0505161 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -7,7 +7,9 @@ import Foundation -internal struct DogAllOf: Codable { + +internal struct DogAllOf: Codable { + internal var breed: String? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index bb9f64cfb438..8aa9c2bd58d2 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -7,7 +7,9 @@ import Foundation -internal struct EnumArrays: Codable { + +internal struct EnumArrays: Codable { + internal enum JustSymbol: String, Codable, CaseIterable { case greaterThanOrEqualTo = ">=" @@ -25,7 +27,7 @@ internal struct EnumArrays: Codable { self.arrayEnum = arrayEnum } - internal enum CodingKeys: String, CodingKey, CaseIterable { + internal enum CodingKeys: String, CodingKey, CaseIterable { case justSymbol = "just_symbol" case arrayEnum = "array_enum" } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index 71fd29e0d2a5..07dfc16a69f2 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -7,6 +7,7 @@ import Foundation + internal enum EnumClass: String, Codable, CaseIterable { case abc = "_abc" case efg = "-efg" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 421aa5436b04..4081beae4c0a 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -7,7 +7,9 @@ import Foundation -internal struct EnumTest: Codable { + +internal struct EnumTest: Codable { + internal enum EnumString: String, Codable, CaseIterable { case upper = "UPPER" @@ -41,7 +43,7 @@ internal struct EnumTest: Codable { self.outerEnum = outerEnum } - internal enum CodingKeys: String, CodingKey, CaseIterable { + internal enum CodingKeys: String, CodingKey, CaseIterable { case enumString = "enum_string" case enumStringRequired = "enum_string_required" case enumInteger = "enum_integer" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/File.swift index 632402fb9e03..166138041ecf 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -8,7 +8,8 @@ import Foundation /** Must be named `File` for test. */ -internal struct File: Codable { +internal struct File: Codable { + /** Test capitalization */ internal var sourceURI: String? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index e478e6c4b7d1..2245e94bcc90 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -7,7 +7,9 @@ import Foundation -internal struct FileSchemaTestClass: Codable { + +internal struct FileSchemaTestClass: Codable { + internal var file: File? internal var files: [File]? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index 23395c93b569..30b11efb2e19 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -7,7 +7,9 @@ import Foundation -internal struct FormatTest: Codable { + +internal struct FormatTest: Codable { + internal var integer: Int? internal var int32: Int? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 831963ba2ed2..d51b4421dfe6 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -7,7 +7,9 @@ import Foundation -internal struct HasOnlyReadOnly: Codable { + +internal struct HasOnlyReadOnly: Codable { + internal var bar: String? internal var foo: String? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/List.swift index c5960de21513..0a76cba0ed92 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -7,7 +7,9 @@ import Foundation -internal struct List: Codable { + +internal struct List: Codable { + internal var _123list: String? @@ -15,7 +17,7 @@ internal struct List: Codable { self._123list = _123list } - internal enum CodingKeys: String, CodingKey, CaseIterable { + internal enum CodingKeys: String, CodingKey, CaseIterable { case _123list = "123-list" } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index db4f8f436aa5..b0a860092bc6 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -7,25 +7,27 @@ import Foundation -internal struct MapTest: Codable { + +internal struct MapTest: Codable { + internal enum MapOfEnumString: String, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" } - internal var mapMapOfString: [String: [String: String]]? - internal var mapOfEnumString: [String: String]? - internal var directMap: [String: Bool]? + internal var mapMapOfString: [String:[String:String]]? + internal var mapOfEnumString: [String:String]? + internal var directMap: [String:Bool]? internal var indirectMap: StringBooleanMap? - internal init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { + internal init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?, directMap: [String:Bool]?, indirectMap: StringBooleanMap?) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap self.indirectMap = indirectMap } - internal enum CodingKeys: String, CodingKey, CaseIterable { + internal enum CodingKeys: String, CodingKey, CaseIterable { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" case directMap = "direct_map" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c71bb9256b0a..c6fa4baaecd7 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,13 +7,15 @@ import Foundation -internal struct MixedPropertiesAndAdditionalPropertiesClass: Codable { + +internal struct MixedPropertiesAndAdditionalPropertiesClass: Codable { + internal var uuid: UUID? internal var dateTime: Date? - internal var map: [String: Animal]? + internal var map: [String:Animal]? - internal init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { + internal init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { self.uuid = uuid self.dateTime = dateTime self.map = map diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 5d31a885f751..2a81b0ac9273 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model name starting with number */ -internal struct Model200Response: Codable { +internal struct Model200Response: Codable { + internal var name: Int? internal var _class: String? @@ -18,7 +19,7 @@ internal struct Model200Response: Codable { self._class = _class } - internal enum CodingKeys: String, CodingKey, CaseIterable { + internal enum CodingKeys: String, CodingKey, CaseIterable { case name case _class = "class" } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 2aa8fb1524c3..5c7df2148768 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model name same as property name */ -internal struct Name: Codable { +internal struct Name: Codable { + internal var name: Int internal var snakeCase: Int? @@ -22,7 +23,7 @@ internal struct Name: Codable { self._123number = _123number } - internal enum CodingKeys: String, CodingKey, CaseIterable { + internal enum CodingKeys: String, CodingKey, CaseIterable { case name case snakeCase = "snake_case" case property diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 49d73706e398..3473e7016447 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -internal struct NumberOnly: Codable { + +internal struct NumberOnly: Codable { + internal var justNumber: Double? @@ -15,7 +17,7 @@ internal struct NumberOnly: Codable { self.justNumber = justNumber } - internal enum CodingKeys: String, CodingKey, CaseIterable { + internal enum CodingKeys: String, CodingKey, CaseIterable { case justNumber = "JustNumber" } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index dcefb40efa2b..b6fd07e148b5 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,7 +7,9 @@ import Foundation -internal struct Order: Codable { + +internal struct Order: Codable { + internal enum Status: String, Codable, CaseIterable { case placed = "placed" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index c61c2c4a4620..592f9a849ce3 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -7,7 +7,9 @@ import Foundation -internal struct OuterComposite: Codable { + +internal struct OuterComposite: Codable { + internal var myNumber: Double? internal var myString: String? @@ -19,7 +21,7 @@ internal struct OuterComposite: Codable { self.myBoolean = myBoolean } - internal enum CodingKeys: String, CodingKey, CaseIterable { + internal enum CodingKeys: String, CodingKey, CaseIterable { case myNumber = "my_number" case myString = "my_string" case myBoolean = "my_boolean" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index e0cdcbea0558..ab1397d4f31d 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -7,6 +7,7 @@ import Foundation + internal enum OuterEnum: String, Codable, CaseIterable { case placed = "placed" case approved = "approved" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index b71700544d06..0cf0f0d3b4b5 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,7 +7,9 @@ import Foundation -internal struct Pet: Codable { + +internal struct Pet: Codable { + internal enum Status: String, Codable, CaseIterable { case available = "available" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index d02c6cc5fd9f..8792cf4aa754 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -7,7 +7,9 @@ import Foundation -internal struct ReadOnlyFirst: Codable { + +internal struct ReadOnlyFirst: Codable { + internal var bar: String? internal var baz: String? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index 95a18b571ade..82b73db4b37e 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing reserved words */ -internal struct Return: Codable { +internal struct Return: Codable { + internal var _return: Int? @@ -16,7 +17,7 @@ internal struct Return: Codable { self._return = _return } - internal enum CodingKeys: String, CodingKey, CaseIterable { + internal enum CodingKeys: String, CodingKey, CaseIterable { case _return = "return" } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index b6ac3651f0e7..e98a8fd7955c 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -7,7 +7,9 @@ import Foundation -internal struct SpecialModelName: Codable { + +internal struct SpecialModelName: Codable { + internal var specialPropertyName: Int64? @@ -15,7 +17,7 @@ internal struct SpecialModelName: Codable { self.specialPropertyName = specialPropertyName } - internal enum CodingKeys: String, CodingKey, CaseIterable { + internal enum CodingKeys: String, CodingKey, CaseIterable { case specialPropertyName = "$special[property.name]" } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index dc3d00e13014..d1afe6732a46 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -7,9 +7,12 @@ import Foundation -internal struct StringBooleanMap: Codable { - internal var additionalProperties: [String: Bool] = [:] +internal struct StringBooleanMap: Codable { + + + + internal var additionalProperties: [String:Bool] = [:] internal subscript(key: String) -> Bool? { get { @@ -42,4 +45,5 @@ internal struct StringBooleanMap: Codable { additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } + } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 1e4de951fb2c..923acc9b1f69 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,7 +7,9 @@ import Foundation -internal struct Tag: Codable { + +internal struct Tag: Codable { + internal var id: Int64? internal var name: String? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index 83908bb4fc94..e78ae839f503 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -7,7 +7,9 @@ import Foundation -internal struct TypeHolderDefault: Codable { + +internal struct TypeHolderDefault: Codable { + internal var stringItem: String = "what" internal var numberItem: Double @@ -23,7 +25,7 @@ internal struct TypeHolderDefault: Codable { self.arrayItem = arrayItem } - internal enum CodingKeys: String, CodingKey, CaseIterable { + internal enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index 3e2c6193aa3e..c829014f0d44 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -7,7 +7,9 @@ import Foundation -internal struct TypeHolderExample: Codable { + +internal struct TypeHolderExample: Codable { + internal var stringItem: String internal var numberItem: Double @@ -23,7 +25,7 @@ internal struct TypeHolderExample: Codable { self.arrayItem = arrayItem } - internal enum CodingKeys: String, CodingKey, CaseIterable { + internal enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/User.swift index ada8a7f82d96..c2865a579220 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,7 +7,9 @@ import Foundation -internal struct User: Codable { + +internal struct User: Codable { + internal var id: Int64? internal var username: String? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index a907ec1d345e..bf6cc62224b2 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -14,7 +14,7 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { return URLSessionRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return URLSessionDecodableRequestBuilder.self } } @@ -23,16 +23,16 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { private var urlSessionStore = SynchronizedDictionary() internal class URLSessionRequestBuilder: RequestBuilder { - + private var observation: NSKeyValueObservation? - + deinit { observation?.invalidate() } - + // swiftlint:disable:next weak_delegate fileprivate let sessionDelegate = SessionDelegate() - + /** May be assigned if you want to control the authentication challenges. */ @@ -45,11 +45,11 @@ internal class URLSessionRequestBuilder: RequestBuilder { - retry the request. */ internal var taskCompletionShouldRetry: ((Data?, URLResponse?, Error?, @escaping (Bool) -> Void) -> Void)? - - required internal init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + + required internal init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } - + /** May be overridden by a subclass if you want to control the URLSession configuration. @@ -77,40 +77,40 @@ internal class URLSessionRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the URLRequest configuration (e.g. to override the cache policy). */ - internal func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) throws -> URLRequest { - + internal func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) throws -> URLRequest { + guard let url = URL(string: URLString) else { throw DownloadException.requestMissingURL } - + var originalRequest = URLRequest(url: url) - + originalRequest.httpMethod = method.rawValue - + buildHeaders().forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + headers.forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + let modifiedRequest = try encoding.encode(originalRequest, with: parameters) - + return modifiedRequest } override internal func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, Error>) -> Void) { - let urlSessionId: String = UUID().uuidString + let urlSessionId:String = UUID().uuidString // Create a new manager for each request to customize its request header let urlSession = createURLSession() urlSessionStore[urlSessionId] = urlSession - + let parameters: [String: Any] = self.parameters ?? [:] - + let fileKeys = parameters.filter { $1 is URL } .map { $0.0 } - + let encoding: ParameterEncoding if fileKeys.count > 0 { encoding = FileUploadEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) @@ -119,29 +119,29 @@ internal class URLSessionRequestBuilder: RequestBuilder { } else { encoding = URLEncoding() } - + guard let xMethod = HTTPMethod(rawValue: method) else { fatalError("Unsuported Http method - \(method)") } - + let cleanupRequest = { urlSessionStore[urlSessionId] = nil self.observation?.invalidate() } - + do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) - + let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in - + guard let self = self else { return } - + if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - + taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in - + guard let self = self else { return } - + if shouldRetry { cleanupRequest() self.execute(apiResponseQueue, completion) @@ -157,13 +157,13 @@ internal class URLSessionRequestBuilder: RequestBuilder { } } } - + if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { onProgressReady?(dataTask.progress) } - + dataTask.resume() - + } catch { apiResponseQueue.async { cleanupRequest() @@ -172,7 +172,7 @@ internal class URLSessionRequestBuilder: RequestBuilder { } } - + fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, Error>) -> Void) { if let error = error { @@ -192,52 +192,52 @@ internal class URLSessionRequestBuilder: RequestBuilder { switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is URL.Type: do { - + guard error == nil else { throw DownloadException.responseFailed } - + guard let data = data else { throw DownloadException.responseDataMissing } - + let fileManager = FileManager.default let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] let requestURL = try self.getURL(from: urlRequest) - + var requestPath = try self.getPath(from: requestURL) - + if let headerFileName = self.getFileName(fromContentDisposition: httpResponse.allHeaderFields["Content-Disposition"] as? String) { requestPath = requestPath.appending("/\(headerFileName)") } - + let filePath = documentsDirectory.appendingPathComponent(requestPath) let directoryPath = filePath.deletingLastPathComponent().path - + try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) try data.write(to: filePath, options: .atomic) - + completion(.success(Response(response: httpResponse, body: filePath as? T))) - + } catch let requestParserError as DownloadException { completion(.failure(ErrorResponse.error(400, data, requestParserError))) } catch let error { completion(.failure(ErrorResponse.error(400, data, error))) } - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + default: - + completion(.success(Response(response: httpResponse, body: data as? T))) } @@ -251,7 +251,7 @@ internal class URLSessionRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -270,7 +270,7 @@ internal class URLSessionRequestBuilder: RequestBuilder { filename = contentItem return filename? - .replacingCharacters(in: range, with: "") + .replacingCharacters(in: range, with:"") .replacingOccurrences(of: "\"", with: "") .trimmingCharacters(in: .whitespacesAndNewlines) } @@ -279,7 +279,7 @@ internal class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url: URL) throws -> String { + fileprivate func getPath(from url : URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -293,7 +293,7 @@ internal class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -304,7 +304,7 @@ internal class URLSessionRequestBuilder: RequestBuilder { } -internal class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { +internal class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, Error>) -> Void) { if let error = error { @@ -324,28 +324,28 @@ internal class URLSessionDecodableRequestBuilder: URLSessionReques switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + case is Data.Type: - + completion(.success(Response(response: httpResponse, body: data as? T))) - + default: - + guard let data = data, !data.isEmpty else { completion(.failure(ErrorResponse.error(httpResponse.statusCode, nil, DecodableRequestBuilderError.emptyDataResponse))) return } - + let decodeResult = CodableHelper.decode(T.self, from: data) - + switch decodeResult { case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) @@ -356,10 +356,10 @@ internal class URLSessionDecodableRequestBuilder: URLSessionReques } } -private class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { - +fileprivate class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { + var credential: URLCredential? - + var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { @@ -402,13 +402,13 @@ internal protocol ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest } -private class URLEncoding: ParameterEncoding { - func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { - +fileprivate class URLEncoding: ParameterEncoding { + func encode(_ urlRequest: URLRequest, with parameters: [String : Any]?) throws -> URLRequest { + var urlRequest = urlRequest - + guard let parameters = parameters else { return urlRequest } - + guard let url = urlRequest.url else { throw DownloadException.requestMissingURL } @@ -417,12 +417,12 @@ private class URLEncoding: ParameterEncoding { urlComponents.queryItems = APIHelper.mapValuesToQueryItems(parameters) urlRequest.url = urlComponents.url } - + return urlRequest } } -private class FileUploadEncoding: ParameterEncoding { +fileprivate class FileUploadEncoding: ParameterEncoding { let contentTypeForFormPart: (_ fileURL: URL) -> String? @@ -433,13 +433,13 @@ private class FileUploadEncoding: ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { var urlRequest = urlRequest - + guard let parameters = parameters, !parameters.isEmpty else { return urlRequest } - + let boundary = "Boundary-\(UUID().uuidString)" - + urlRequest.setValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type") for (key, value) in parameters { @@ -479,7 +479,7 @@ private class FileUploadEncoding: ParameterEncoding { fatalError("Unprocessable value \(value) with key \(key)") } } - + var body = urlRequest.httpBody.orEmpty body.append("\r\n--\(boundary)--\r\n") @@ -494,7 +494,7 @@ private class FileUploadEncoding: ParameterEncoding { var urlRequest = urlRequest var body = urlRequest.httpBody.orEmpty - + let fileData = try Data(contentsOf: fileURL) let mimetype = self.contentTypeForFormPart(fileURL) ?? mimeType(for: fileURL) @@ -502,7 +502,7 @@ private class FileUploadEncoding: ParameterEncoding { let fileName = fileURL.lastPathComponent // If we already added something then we need an additional newline. - if body.count > 0 { + if (body.count > 0) { body.append("\r\n") } @@ -518,20 +518,20 @@ private class FileUploadEncoding: ParameterEncoding { // The value data. body.append(fileData) - + urlRequest.httpBody = body return urlRequest } - + private func configureDataUploadRequest(urlRequest: URLRequest, boundary: String, name: String, data: Data) -> URLRequest { var urlRequest = urlRequest - + var body = urlRequest.httpBody.orEmpty // If we already added something then we need an additional newline. - if body.count > 0 { + if (body.count > 0) { body.append("\r\n") } diff --git a/samples/client/petstore/swift5/objcCompatible/Package.swift b/samples/client/petstore/swift5/objcCompatible/Package.swift index 96dfff54edf4..79f6f8188738 100644 --- a/samples/client/petstore/swift5/objcCompatible/Package.swift +++ b/samples/client/petstore/swift5/objcCompatible/Package.swift @@ -14,7 +14,7 @@ let package = Package( // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "PetstoreClient", - targets: ["PetstoreClient"]) + targets: ["PetstoreClient"]), ], dependencies: [ // Dependencies declare other packages that this package depends on. @@ -26,6 +26,6 @@ let package = Package( name: "PetstoreClient", dependencies: [], path: "PetstoreClient/Classes" - ) + ), ] ) diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 5b09f9557113..2404bc8ffc6d 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { + public static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { let destination = source.reduce(into: [String: Any]()) { (result, item) in if let value = item.value { result[item.key] = value @@ -20,17 +20,17 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { + public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? [Any?] { - result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") + if let collection = item.value as? Array { + result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { + public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { guard let source = source else { return nil } @@ -46,15 +46,15 @@ public struct APIHelper { } public static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? [Any?] { + if let collection = source as? Array { return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") } return source } - public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { + public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? [Any?] { + if let collection = item.value as? Array { collection.filter({ $0 != nil }).map({"\($0!)"}).forEach { value in result.append(URLQueryItem(name: item.key, value: value)) } @@ -69,3 +69,4 @@ public struct APIHelper { return destination } } + diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs.swift index a5c2d605dff6..c5d1b9b42df3 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,15 +9,15 @@ import Foundation open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var credential: URLCredential? - public static var customHeaders: [String: String] = [:] + public static var customHeaders: [String:String] = [:] public static var requestBuilderFactory: RequestBuilderFactory = URLSessionRequestBuilderFactory() public static var apiResponseQueue: DispatchQueue = .main } open class RequestBuilder { var credential: URLCredential? - var headers: [String: String] - public let parameters: [String: Any]? + var headers: [String:String] + public let parameters: [String:Any]? public let isBody: Bool public let method: String public let URLString: String @@ -25,9 +25,9 @@ open class RequestBuilder { /// Optional block to obtain a reference to the request's progress instance when available. /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. /// If you need to get the request's progress in older OS versions, please use Alamofire http client. - public var onProgressReady: ((Progress) -> Void)? + public var onProgressReady: ((Progress) -> ())? - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -37,7 +37,7 @@ open class RequestBuilder { addHeaders(PetstoreClientAPI.customHeaders) } - open func addHeaders(_ aHeaders: [String: String]) { + open func addHeaders(_ aHeaders:[String:String]) { for (header, value) in aHeaders { headers[header] = value } @@ -60,5 +60,5 @@ open class RequestBuilder { public protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 2e9ad96a66b5..41731036ab60 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -7,7 +7,9 @@ import Foundation -@objc open class AnotherFakeAPI: NSObject { + + +@objc open class AnotherFakeAPI : NSObject { /** To test special tags @@ -15,7 +17,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 6483ab29bcc3..fc51b0022277 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -7,14 +7,16 @@ import Foundation -@objc open class FakeAPI: NSObject { + + +@objc open class FakeAPI : NSObject { /** - parameter body: (body) Input boolean as post body (optional) - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) { + open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?,_ error: Error?) -> Void)) { fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -49,7 +51,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) { + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?,_ error: Error?) -> Void)) { fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -84,7 +86,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) { + open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?,_ error: Error?) -> Void)) { fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -119,7 +121,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { + open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -154,7 +156,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -190,7 +192,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -229,7 +231,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -279,7 +281,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testEndpointParametersWithRequestBuilder(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -316,7 +318,7 @@ import Foundation open class func testEndpointParametersWithRequestBuilder(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "integer": integer?.encodeToJSON(), "int32": int32?.encodeToJSON(), "int64": int64?.encodeToJSON(), @@ -335,7 +337,7 @@ import Foundation let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -424,7 +426,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -452,19 +454,19 @@ import Foundation open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "enum_form_string_array": enumFormStringArray?.encodeToJSON(), "enum_form_string": enumFormString?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), - "enum_query_string": enumQueryString?.encodeToJSON(), - "enum_query_integer": enumQueryInteger?.encodeToJSON(), + "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), + "enum_query_string": enumQueryString?.encodeToJSON(), + "enum_query_integer": enumQueryInteger?.encodeToJSON(), "enum_query_double": enumQueryDouble?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -490,7 +492,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -516,13 +518,13 @@ import Foundation open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), "int64_group": int64Group?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -543,7 +545,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testInlineAdditionalProperties(param: [String:String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -560,7 +562,7 @@ import Foundation - parameter param: (body) request body - returns: RequestBuilder */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { let path = "/fake/inline-additionalProperties" let URLString = PetstoreClientAPI.basePath + path let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) @@ -580,7 +582,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -601,14 +603,14 @@ import Foundation open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { let path = "/fake/jsonFormData" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "param": param.encodeToJSON(), "param2": param2.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index b9cfc75eeb4c..3793f6dc4128 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -7,7 +7,9 @@ import Foundation -@objc open class FakeClassnameTags123API: NSObject { + + +@objc open class FakeClassnameTags123API : NSObject { /** To test class name in snake case @@ -15,7 +17,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index d022b687736e..86c6dcc9778f 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -7,7 +7,9 @@ import Foundation -@objc open class PetAPI: NSObject { + + +@objc open class PetAPI : NSObject { /** Add a new pet to the store @@ -15,7 +17,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -55,7 +57,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -82,8 +84,8 @@ import Foundation let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let nillableHeaders: [String: Any?] = [ "api_key": apiKey?.encodeToJSON() @@ -111,7 +113,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { + open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -135,8 +137,8 @@ import Foundation open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "status": status.encodeToJSON() @@ -155,7 +157,7 @@ import Foundation - parameter completion: completion handler to receive the data and the error objects */ @available(*, deprecated, message: "This operation is deprecated.") - open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { + open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -180,8 +182,8 @@ import Foundation open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "tags": tags.encodeToJSON() @@ -199,7 +201,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) { + open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?,_ error: Error?) -> Void)) { getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -226,8 +228,8 @@ import Foundation let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -242,7 +244,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -283,7 +285,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -311,14 +313,14 @@ import Foundation let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "name": name?.encodeToJSON(), "status": status?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -335,7 +337,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -363,14 +365,14 @@ import Foundation let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "file": file?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -387,7 +389,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -415,14 +417,14 @@ import Foundation let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "requiredFile": requiredFile.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index a19d12c7d24b..cc15cd3ae88c 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -7,7 +7,9 @@ import Foundation -@objc open class StoreAPI: NSObject { + + +@objc open class StoreAPI : NSObject { /** Delete purchase order by ID @@ -15,7 +17,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -39,8 +41,8 @@ import Foundation let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -54,7 +56,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) { + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String:Int]?,_ error: Error?) -> Void)) { getInventoryWithRequestBuilder().execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -74,14 +76,14 @@ import Foundation - name: api_key - returns: RequestBuilder<[String:Int]> */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { + open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } @@ -93,7 +95,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { + open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -117,8 +119,8 @@ import Foundation let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -133,7 +135,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { + open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 4dfe4da1a021..6e0e10bc7b22 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -7,7 +7,9 @@ import Foundation -@objc open class UserAPI: NSObject { + + +@objc open class UserAPI : NSObject { /** Create user @@ -15,7 +17,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -52,7 +54,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -88,7 +90,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -124,7 +126,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -148,8 +150,8 @@ import Foundation let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -164,7 +166,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) { + open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?,_ error: Error?) -> Void)) { getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -187,8 +189,8 @@ import Foundation let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -204,7 +206,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { + open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -226,11 +228,11 @@ import Foundation open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username.encodeToJSON(), + "username": username.encodeToJSON(), "password": password.encodeToJSON() ]) @@ -245,7 +247,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { logoutUserWithRequestBuilder().execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -264,8 +266,8 @@ import Foundation open class func logoutUserWithRequestBuilder() -> RequestBuilder { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -281,7 +283,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index ef971ebadc60..01b28a4bd42d 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -45,4 +45,4 @@ open class CodableHelper { open class func encode(_ value: T) -> Swift.Result where T: Encodable { return Swift.Result { try self.jsonEncoder.encode(value) } } -} +} \ No newline at end of file diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Configuration.swift index 627d9adb757e..f171525e4394 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -7,10 +7,10 @@ import Foundation open class Configuration { - + // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} + +} \ No newline at end of file diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 93ed6b90b376..6e279679c67a 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -108,24 +108,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { if let values = values { try encodeArray(values, forKey: key) } } - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -135,7 +135,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -147,8 +147,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { - var tmpArray: [T]? + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { + var tmpArray: [T]? = nil if contains(key) { tmpArray = try decodeArray(T.self, forKey: key) @@ -157,8 +157,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { + var map: [Self.Key : T] = [:] for key in allKeys { if !excludedKeys.contains(key) { @@ -177,3 +177,5 @@ extension HTTPURLResponse { return Array(200 ..< 300).contains(statusCode) } } + + diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift index b79e9f5e64d5..08f1ef334dff 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift @@ -41,7 +41,7 @@ public struct JSONDataEncoding { } public static func encodingParameters(jsonData: Data?) -> [String: Any]? { - var returnedParams: [String: Any]? + var returnedParams: [String: Any]? = nil if let jsonData = jsonData, !jsonData.isEmpty { var params: [String: Any] = [:] params[jsonDataKey] = jsonData diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 02f78ffb4705..314f1eff1f9b 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -9,8 +9,8 @@ import Foundation open class JSONEncodingHelper { - open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { - var params: [String: Any]? + open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { + var params: [String: Any]? = nil // Encode the Encodable object if let encodableObj = encodableObj { @@ -27,7 +27,7 @@ open class JSONEncodingHelper { } open class func encodingParameters(forEncodableObject encodableObj: Any?) -> [String: Any]? { - var params: [String: Any]? + var params: [String: Any]? = nil if let encodableObj = encodableObj { do { @@ -41,5 +41,5 @@ open class JSONEncodingHelper { return params } - + } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift index c0542c14c081..11e81ffcc472 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,11 +10,11 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -public enum ErrorResponse: Error { +public enum ErrorResponse : Error { case error(Int, Data?, Error) } -public enum DownloadException: Error { +public enum DownloadException : Error { case responseDataMissing case responseFailed case requestMissing @@ -30,6 +30,7 @@ public enum DecodableRequestBuilderError: Error { case generalError(Error) } + open class Response { public let statusCode: Int public let header: [String: String] @@ -43,7 +44,7 @@ open class Response { public convenience init(response: HTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String: String]() + var header = [String:String]() for (key, value) in rawHeader { if let key = key.base as? String, let value = value as? String { header[key] = value diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index e184d7691799..d4e1b3697e71 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -7,17 +7,19 @@ import Foundation -@objc public class AdditionalPropertiesClass: NSObject, Codable { - public var mapString: [String: String]? - public var mapMapString: [String: [String: String]]? - public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { +@objc public class AdditionalPropertiesClass: NSObject, Codable { + + public var mapString: [String:String]? + public var mapMapString: [String:[String:String]]? + + public init(mapString: [String:String]?, mapMapString: [String:[String:String]]?) { self.mapString = mapString self.mapMapString = mapMapString } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapString = "map_string" case mapMapString = "map_map_string" } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 88152934da2b..f34ba3bb63e7 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class Animal: NSObject, Codable { + + +@objc public class Animal: NSObject, Codable { public var _className: String public var color: String? = "red" @@ -17,7 +19,7 @@ import Foundation self.color = color } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _className = "className" case color } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift index e09b0e9efdc8..e7bea63f8ed2 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -7,4 +7,5 @@ import Foundation + public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index d0fcd4368854..d9a7fae21446 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class ApiResponse: NSObject, Codable { + + +@objc public class ApiResponse: NSObject, Codable { public var code: Int? public var codeNum: NSNumber? { diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 9e3f3aba246a..e57e63b6ed28 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class ArrayOfArrayOfNumberOnly: NSObject, Codable { + + +@objc public class ArrayOfArrayOfNumberOnly: NSObject, Codable { public var arrayArrayNumber: [[Double]]? @@ -15,7 +17,7 @@ import Foundation self.arrayArrayNumber = arrayArrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayArrayNumber = "ArrayArrayNumber" } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index d287cc1563aa..e087329fdc44 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class ArrayOfNumberOnly: NSObject, Codable { + + +@objc public class ArrayOfNumberOnly: NSObject, Codable { public var arrayNumber: [Double]? @@ -15,7 +17,7 @@ import Foundation self.arrayNumber = arrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayNumber = "ArrayNumber" } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index dcc3e9c3dd51..c7e6b0b27a4b 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class ArrayTest: NSObject, Codable { + + +@objc public class ArrayTest: NSObject, Codable { public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? @@ -19,7 +21,7 @@ import Foundation self.arrayArrayOfModel = arrayArrayOfModel } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" case arrayArrayOfModel = "array_array_of_model" diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index 80a5667445f2..e472eaaa7916 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class Capitalization: NSObject, Codable { + + +@objc public class Capitalization: NSObject, Codable { public var smallCamel: String? public var capitalCamel: String? @@ -26,7 +28,7 @@ import Foundation self.ATT_NAME = ATT_NAME } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case smallCamel case capitalCamel = "CapitalCamel" case smallSnake = "small_Snake" diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 78de5a909f54..1b19800ae3c3 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class Cat: NSObject, Codable { + + +@objc public class Cat: NSObject, Codable { public var _className: String public var color: String? = "red" @@ -24,7 +26,7 @@ import Foundation self.declawed = declawed } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _className = "className" case color case declawed diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index ef8cec45aff1..8758762c40bf 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class CatAllOf: NSObject, Codable { + + +@objc public class CatAllOf: NSObject, Codable { public var declawed: Bool? public var declawedNum: NSNumber? { diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index 0610c10c982f..df7771efc457 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class Category: NSObject, Codable { + + +@objc public class Category: NSObject, Codable { public var _id: Int64? public var _idNum: NSNumber? { @@ -22,7 +24,7 @@ import Foundation self.name = name } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _id = "id" case name } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index 4197ffcaed6c..c221ccf2a0de 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -9,7 +9,7 @@ import Foundation /** Model for testing model with \"_class\" property */ -@objc public class ClassModel: NSObject, Codable { +@objc public class ClassModel: NSObject, Codable { public var _class: String? diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 517dbbba2ec2..5aea86fbb06e 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class Client: NSObject, Codable { + + +@objc public class Client: NSObject, Codable { public var client: String? diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 37733cd1f3be..464f0c7ae4e7 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class Dog: NSObject, Codable { + + +@objc public class Dog: NSObject, Codable { public var _className: String public var color: String? = "red" @@ -19,7 +21,7 @@ import Foundation self.breed = breed } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _className = "className" case color case breed diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 73fd1822725c..efcd880f10b3 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class DogAllOf: NSObject, Codable { + + +@objc public class DogAllOf: NSObject, Codable { public var breed: String? diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 034a58c6c0eb..3c1c26139314 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class EnumArrays: NSObject, Codable { + + +@objc public class EnumArrays: NSObject, Codable { public enum JustSymbol: String, Codable, CaseIterable { case greaterThanOrEqualTo = ">=" @@ -25,7 +27,7 @@ import Foundation self.arrayEnum = arrayEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justSymbol = "just_symbol" case arrayEnum = "array_enum" } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index d4029d73f8af..c2c639ba3246 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -7,6 +7,7 @@ import Foundation + public enum EnumClass: String, Codable, CaseIterable { case abc = "_abc" case efg = "-efg" diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index ce3a03006097..60b754914d42 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class EnumTest: NSObject, Codable { + + +@objc public class EnumTest: NSObject, Codable { public enum EnumString: String, Codable, CaseIterable { case upper = "UPPER" @@ -41,7 +43,7 @@ import Foundation self.outerEnum = outerEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case enumString = "enum_string" case enumStringRequired = "enum_string_required" case enumInteger = "enum_integer" diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/File.swift index 7a320c177d38..120d5bb78797 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -9,7 +9,7 @@ import Foundation /** Must be named `File` for test. */ -@objc public class File: NSObject, Codable { +@objc public class File: NSObject, Codable { /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index a6437b4fe901..e60109a85334 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class FileSchemaTestClass: NSObject, Codable { + + +@objc public class FileSchemaTestClass: NSObject, Codable { public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index df2c46d3757b..664481c02fc4 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class FormatTest: NSObject, Codable { + + +@objc public class FormatTest: NSObject, Codable { public var integer: Int? public var integerNum: NSNumber? { diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index b9f5b39117d7..974726b3e65d 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class HasOnlyReadOnly: NSObject, Codable { + + +@objc public class HasOnlyReadOnly: NSObject, Codable { public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/List.swift index 826dc9e27f2b..4942b7502244 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class List: NSObject, Codable { + + +@objc public class List: NSObject, Codable { public var _123list: String? @@ -15,7 +17,7 @@ import Foundation self._123list = _123list } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _123list = "123-list" } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 2b97660b80e8..2acd08f46a45 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -7,25 +7,27 @@ import Foundation -@objc public class MapTest: NSObject, Codable { + + +@objc public class MapTest: NSObject, Codable { public enum MapOfEnumString: String, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" } - public var mapMapOfString: [String: [String: String]]? - public var mapOfEnumString: [String: String]? - public var directMap: [String: Bool]? + public var mapMapOfString: [String:[String:String]]? + public var mapOfEnumString: [String:String]? + public var directMap: [String:Bool]? public var indirectMap: StringBooleanMap? - public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { + public init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?, directMap: [String:Bool]?, indirectMap: StringBooleanMap?) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap self.indirectMap = indirectMap } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" case directMap = "direct_map" diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index e10adad0a7e1..3ecb79bf9f43 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,13 +7,15 @@ import Foundation -@objc public class MixedPropertiesAndAdditionalPropertiesClass: NSObject, Codable { + + +@objc public class MixedPropertiesAndAdditionalPropertiesClass: NSObject, Codable { public var uuid: UUID? public var dateTime: Date? - public var map: [String: Animal]? + public var map: [String:Animal]? - public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { + public init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { self.uuid = uuid self.dateTime = dateTime self.map = map diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 1c5410f61dde..031badf4be9e 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -9,7 +9,7 @@ import Foundation /** Model for testing model name starting with number */ -@objc public class Model200Response: NSObject, Codable { +@objc public class Model200Response: NSObject, Codable { public var name: Int? public var nameNum: NSNumber? { @@ -24,7 +24,7 @@ import Foundation self._class = _class } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case _class = "class" } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 06f8a2f81a3a..c863b854d468 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -9,7 +9,7 @@ import Foundation /** Model for testing model name same as property name */ -@objc public class Name: NSObject, Codable { +@objc public class Name: NSObject, Codable { public var name: Int public var snakeCase: Int? @@ -33,7 +33,7 @@ import Foundation self._123number = _123number } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case snakeCase = "snake_case" case property diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 3bd9859378d8..1db3ace43047 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class NumberOnly: NSObject, Codable { + + +@objc public class NumberOnly: NSObject, Codable { public var justNumber: Double? @@ -15,7 +17,7 @@ import Foundation self.justNumber = justNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justNumber = "JustNumber" } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 586a4c2d55a8..5fdd493dbedb 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class Order: NSObject, Codable { + + +@objc public class Order: NSObject, Codable { public enum Status: String, Codable, CaseIterable { case placed = "placed" @@ -51,7 +53,7 @@ import Foundation self.complete = complete } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _id = "id" case petId case quantity diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 434111678de7..0d1791d3fa8d 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class OuterComposite: NSObject, Codable { + + +@objc public class OuterComposite: NSObject, Codable { public var myNumber: Double? public var myString: String? @@ -24,7 +26,7 @@ import Foundation self.myBoolean = myBoolean } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case myNumber = "my_number" case myString = "my_string" case myBoolean = "my_boolean" diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index c3b778cbbed4..9e6b8d74e874 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -7,6 +7,7 @@ import Foundation + public enum OuterEnum: String, Codable, CaseIterable { case placed = "placed" case approved = "approved" diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index d84079a2b48d..29d4e3d9e37a 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class Pet: NSObject, Codable { + + +@objc public class Pet: NSObject, Codable { public enum Status: String, Codable, CaseIterable { case available = "available" @@ -36,7 +38,7 @@ import Foundation self.status = status } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _id = "id" case category case name diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index d1252433b2d8..2c806ac6d756 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class ReadOnlyFirst: NSObject, Codable { + + +@objc public class ReadOnlyFirst: NSObject, Codable { public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index 4b10ac18cf0d..948f6f4d3846 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -9,7 +9,7 @@ import Foundation /** Model for testing reserved words */ -@objc public class Return: NSObject, Codable { +@objc public class Return: NSObject, Codable { public var _return: Int? public var _returnNum: NSNumber? { @@ -22,7 +22,7 @@ import Foundation self._return = _return } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _return = "return" } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index 85e33352531d..c01c4065998b 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class SpecialModelName: NSObject, Codable { + + +@objc public class SpecialModelName: NSObject, Codable { public var specialPropertyName: Int64? public var specialPropertyNameNum: NSNumber? { @@ -20,7 +22,7 @@ import Foundation self.specialPropertyName = specialPropertyName } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case specialPropertyName = "$special[property.name]" } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index ffe9730a6fe4..3116d99bff0c 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -7,9 +7,12 @@ import Foundation -@objc public class StringBooleanMap: NSObject, Codable { - public var additionalProperties: [String: Bool] = [:] + +@objc public class StringBooleanMap: NSObject, Codable { + + + public var additionalProperties: [String:Bool] = [:] public subscript(key: String) -> Bool? { get { @@ -42,4 +45,5 @@ import Foundation additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } + } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 88583be7f5dd..1bd7489826dd 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class Tag: NSObject, Codable { + + +@objc public class Tag: NSObject, Codable { public var _id: Int64? public var _idNum: NSNumber? { @@ -22,7 +24,7 @@ import Foundation self.name = name } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _id = "id" case name } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index 6d51f44540c0..273b7b31aefd 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class TypeHolderDefault: NSObject, Codable { + + +@objc public class TypeHolderDefault: NSObject, Codable { public var stringItem: String = "what" public var numberItem: Double @@ -23,7 +25,7 @@ import Foundation self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index 40e3a41c34d9..3cb1929d4394 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class TypeHolderExample: NSObject, Codable { + + +@objc public class TypeHolderExample: NSObject, Codable { public var stringItem: String public var numberItem: Double @@ -23,7 +25,7 @@ import Foundation self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 7dc3cc5954d6..eb8ec0552741 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class User: NSObject, Codable { + + +@objc public class User: NSObject, Codable { public var _id: Int64? public var _idNum: NSNumber? { @@ -40,7 +42,7 @@ import Foundation self.userStatus = userStatus } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _id = "id" case username case firstName diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index 55d0eb421919..22261e2ce948 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -14,7 +14,7 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { return URLSessionRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return URLSessionDecodableRequestBuilder.self } } @@ -23,16 +23,16 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { private var urlSessionStore = SynchronizedDictionary() open class URLSessionRequestBuilder: RequestBuilder { - + private var observation: NSKeyValueObservation? - + deinit { observation?.invalidate() } - + // swiftlint:disable:next weak_delegate fileprivate let sessionDelegate = SessionDelegate() - + /** May be assigned if you want to control the authentication challenges. */ @@ -45,11 +45,11 @@ open class URLSessionRequestBuilder: RequestBuilder { - retry the request. */ public var taskCompletionShouldRetry: ((Data?, URLResponse?, Error?, @escaping (Bool) -> Void) -> Void)? - - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + + required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } - + /** May be overridden by a subclass if you want to control the URLSession configuration. @@ -77,40 +77,40 @@ open class URLSessionRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the URLRequest configuration (e.g. to override the cache policy). */ - open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) throws -> URLRequest { - + open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) throws -> URLRequest { + guard let url = URL(string: URLString) else { throw DownloadException.requestMissingURL } - + var originalRequest = URLRequest(url: url) - + originalRequest.httpMethod = method.rawValue - + buildHeaders().forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + headers.forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + let modifiedRequest = try encoding.encode(originalRequest, with: parameters) - + return modifiedRequest } override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, Error>) -> Void) { - let urlSessionId: String = UUID().uuidString + let urlSessionId:String = UUID().uuidString // Create a new manager for each request to customize its request header let urlSession = createURLSession() urlSessionStore[urlSessionId] = urlSession - + let parameters: [String: Any] = self.parameters ?? [:] - + let fileKeys = parameters.filter { $1 is URL } .map { $0.0 } - + let encoding: ParameterEncoding if fileKeys.count > 0 { encoding = FileUploadEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) @@ -119,29 +119,29 @@ open class URLSessionRequestBuilder: RequestBuilder { } else { encoding = URLEncoding() } - + guard let xMethod = HTTPMethod(rawValue: method) else { fatalError("Unsuported Http method - \(method)") } - + let cleanupRequest = { urlSessionStore[urlSessionId] = nil self.observation?.invalidate() } - + do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) - + let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in - + guard let self = self else { return } - + if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - + taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in - + guard let self = self else { return } - + if shouldRetry { cleanupRequest() self.execute(apiResponseQueue, completion) @@ -157,13 +157,13 @@ open class URLSessionRequestBuilder: RequestBuilder { } } } - + if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { onProgressReady?(dataTask.progress) } - + dataTask.resume() - + } catch { apiResponseQueue.async { cleanupRequest() @@ -172,7 +172,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - + fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, Error>) -> Void) { if let error = error { @@ -192,52 +192,52 @@ open class URLSessionRequestBuilder: RequestBuilder { switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is URL.Type: do { - + guard error == nil else { throw DownloadException.responseFailed } - + guard let data = data else { throw DownloadException.responseDataMissing } - + let fileManager = FileManager.default let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] let requestURL = try self.getURL(from: urlRequest) - + var requestPath = try self.getPath(from: requestURL) - + if let headerFileName = self.getFileName(fromContentDisposition: httpResponse.allHeaderFields["Content-Disposition"] as? String) { requestPath = requestPath.appending("/\(headerFileName)") } - + let filePath = documentsDirectory.appendingPathComponent(requestPath) let directoryPath = filePath.deletingLastPathComponent().path - + try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) try data.write(to: filePath, options: .atomic) - + completion(.success(Response(response: httpResponse, body: filePath as? T))) - + } catch let requestParserError as DownloadException { completion(.failure(ErrorResponse.error(400, data, requestParserError))) } catch let error { completion(.failure(ErrorResponse.error(400, data, error))) } - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + default: - + completion(.success(Response(response: httpResponse, body: data as? T))) } @@ -251,7 +251,7 @@ open class URLSessionRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -270,7 +270,7 @@ open class URLSessionRequestBuilder: RequestBuilder { filename = contentItem return filename? - .replacingCharacters(in: range, with: "") + .replacingCharacters(in: range, with:"") .replacingOccurrences(of: "\"", with: "") .trimmingCharacters(in: .whitespacesAndNewlines) } @@ -279,7 +279,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url: URL) throws -> String { + fileprivate func getPath(from url : URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -293,7 +293,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -304,7 +304,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } -open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { +open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, Error>) -> Void) { if let error = error { @@ -324,28 +324,28 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + case is Data.Type: - + completion(.success(Response(response: httpResponse, body: data as? T))) - + default: - + guard let data = data, !data.isEmpty else { completion(.failure(ErrorResponse.error(httpResponse.statusCode, nil, DecodableRequestBuilderError.emptyDataResponse))) return } - + let decodeResult = CodableHelper.decode(T.self, from: data) - + switch decodeResult { case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) @@ -356,10 +356,10 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui } } -private class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { - +fileprivate class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { + var credential: URLCredential? - + var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { @@ -402,13 +402,13 @@ public protocol ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest } -private class URLEncoding: ParameterEncoding { - func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { - +fileprivate class URLEncoding: ParameterEncoding { + func encode(_ urlRequest: URLRequest, with parameters: [String : Any]?) throws -> URLRequest { + var urlRequest = urlRequest - + guard let parameters = parameters else { return urlRequest } - + guard let url = urlRequest.url else { throw DownloadException.requestMissingURL } @@ -417,12 +417,12 @@ private class URLEncoding: ParameterEncoding { urlComponents.queryItems = APIHelper.mapValuesToQueryItems(parameters) urlRequest.url = urlComponents.url } - + return urlRequest } } -private class FileUploadEncoding: ParameterEncoding { +fileprivate class FileUploadEncoding: ParameterEncoding { let contentTypeForFormPart: (_ fileURL: URL) -> String? @@ -433,13 +433,13 @@ private class FileUploadEncoding: ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { var urlRequest = urlRequest - + guard let parameters = parameters, !parameters.isEmpty else { return urlRequest } - + let boundary = "Boundary-\(UUID().uuidString)" - + urlRequest.setValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type") for (key, value) in parameters { @@ -479,7 +479,7 @@ private class FileUploadEncoding: ParameterEncoding { fatalError("Unprocessable value \(value) with key \(key)") } } - + var body = urlRequest.httpBody.orEmpty body.append("\r\n--\(boundary)--\r\n") @@ -494,7 +494,7 @@ private class FileUploadEncoding: ParameterEncoding { var urlRequest = urlRequest var body = urlRequest.httpBody.orEmpty - + let fileData = try Data(contentsOf: fileURL) let mimetype = self.contentTypeForFormPart(fileURL) ?? mimeType(for: fileURL) @@ -502,7 +502,7 @@ private class FileUploadEncoding: ParameterEncoding { let fileName = fileURL.lastPathComponent // If we already added something then we need an additional newline. - if body.count > 0 { + if (body.count > 0) { body.append("\r\n") } @@ -518,20 +518,20 @@ private class FileUploadEncoding: ParameterEncoding { // The value data. body.append(fileData) - + urlRequest.httpBody = body return urlRequest } - + private func configureDataUploadRequest(urlRequest: URLRequest, boundary: String, name: String, data: Data) -> URLRequest { var urlRequest = urlRequest - + var body = urlRequest.httpBody.orEmpty // If we already added something then we need an additional newline. - if body.count > 0 { + if (body.count > 0) { body.append("\r\n") } diff --git a/samples/client/petstore/swift5/promisekitLibrary/Package.swift b/samples/client/petstore/swift5/promisekitLibrary/Package.swift index 4445c9794907..10dac4053846 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/Package.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/Package.swift @@ -14,19 +14,19 @@ let package = Package( // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "PetstoreClient", - targets: ["PetstoreClient"]) + targets: ["PetstoreClient"]), ], dependencies: [ // Dependencies declare other packages that this package depends on. - .package(url: "https://github.com/mxcl/PromiseKit.git", from: "6.12.0") + .package(url: "https://github.com/mxcl/PromiseKit.git", from: "6.12.0"), ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. // Targets can depend on other targets in this package, and on products in packages which this package depends on. .target( name: "PetstoreClient", - dependencies: ["PromiseKit" ], + dependencies: ["PromiseKit", ], path: "PetstoreClient/Classes" - ) + ), ] ) diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 5b09f9557113..2404bc8ffc6d 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { + public static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { let destination = source.reduce(into: [String: Any]()) { (result, item) in if let value = item.value { result[item.key] = value @@ -20,17 +20,17 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { + public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? [Any?] { - result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") + if let collection = item.value as? Array { + result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { + public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { guard let source = source else { return nil } @@ -46,15 +46,15 @@ public struct APIHelper { } public static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? [Any?] { + if let collection = source as? Array { return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") } return source } - public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { + public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? [Any?] { + if let collection = item.value as? Array { collection.filter({ $0 != nil }).map({"\($0!)"}).forEach { value in result.append(URLQueryItem(name: item.key, value: value)) } @@ -69,3 +69,4 @@ public struct APIHelper { return destination } } + diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift index a5c2d605dff6..c5d1b9b42df3 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,15 +9,15 @@ import Foundation open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var credential: URLCredential? - public static var customHeaders: [String: String] = [:] + public static var customHeaders: [String:String] = [:] public static var requestBuilderFactory: RequestBuilderFactory = URLSessionRequestBuilderFactory() public static var apiResponseQueue: DispatchQueue = .main } open class RequestBuilder { var credential: URLCredential? - var headers: [String: String] - public let parameters: [String: Any]? + var headers: [String:String] + public let parameters: [String:Any]? public let isBody: Bool public let method: String public let URLString: String @@ -25,9 +25,9 @@ open class RequestBuilder { /// Optional block to obtain a reference to the request's progress instance when available. /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. /// If you need to get the request's progress in older OS versions, please use Alamofire http client. - public var onProgressReady: ((Progress) -> Void)? + public var onProgressReady: ((Progress) -> ())? - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -37,7 +37,7 @@ open class RequestBuilder { addHeaders(PetstoreClientAPI.customHeaders) } - open func addHeaders(_ aHeaders: [String: String]) { + open func addHeaders(_ aHeaders:[String:String]) { for (header, value) in aHeaders { headers[header] = value } @@ -60,5 +60,5 @@ open class RequestBuilder { public protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index c3a97ff074c1..ffce4d7c4e81 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -8,6 +8,8 @@ import Foundation import PromiseKit + + open class AnotherFakeAPI { /** To test special tags diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 80153ba634d3..47b6ec5f196f 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -8,6 +8,8 @@ import Foundation import PromiseKit + + open class FakeAPI { /** @@ -201,7 +203,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Promise */ - open class func testBodyWithQueryParams( query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { + open class func testBodyWithQueryParams( query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { let deferred = Promise.pending() testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result -> Void in switch result { @@ -294,7 +296,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Promise */ - open class func testEndpointParameters( number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { + open class func testEndpointParameters( number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { let deferred = Promise.pending() testEndpointParametersWithRequestBuilder(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback).execute(apiResponseQueue) { result -> Void in switch result { @@ -333,7 +335,7 @@ open class FakeAPI { open class func testEndpointParametersWithRequestBuilder(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "integer": integer?.encodeToJSON(), "int32": int32?.encodeToJSON(), "int64": int64?.encodeToJSON(), @@ -352,7 +354,7 @@ open class FakeAPI { let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -441,7 +443,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Promise */ - open class func testEnumParameters( enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { + open class func testEnumParameters( enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { let deferred = Promise.pending() testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result -> Void in switch result { @@ -471,19 +473,19 @@ open class FakeAPI { open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "enum_form_string_array": enumFormStringArray?.encodeToJSON(), "enum_form_string": enumFormString?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), - "enum_query_string": enumQueryString?.encodeToJSON(), - "enum_query_integer": enumQueryInteger?.encodeToJSON(), + "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), + "enum_query_string": enumQueryString?.encodeToJSON(), + "enum_query_integer": enumQueryInteger?.encodeToJSON(), "enum_query_double": enumQueryDouble?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -509,7 +511,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Promise */ - open class func testGroupParameters( requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { + open class func testGroupParameters( requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { let deferred = Promise.pending() testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result -> Void in switch result { @@ -537,13 +539,13 @@ open class FakeAPI { open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), "int64_group": int64Group?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -564,7 +566,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Promise */ - open class func testInlineAdditionalProperties( param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { + open class func testInlineAdditionalProperties( param: [String:String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { let deferred = Promise.pending() testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result -> Void in switch result { @@ -583,7 +585,7 @@ open class FakeAPI { - parameter param: (body) request body - returns: RequestBuilder */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { let path = "/fake/inline-additionalProperties" let URLString = PetstoreClientAPI.basePath + path let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) @@ -603,7 +605,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Promise */ - open class func testJsonFormData( param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { + open class func testJsonFormData( param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { let deferred = Promise.pending() testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result -> Void in switch result { @@ -626,14 +628,14 @@ open class FakeAPI { open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { let path = "/fake/jsonFormData" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "param": param.encodeToJSON(), "param2": param2.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 3a05f8eaf60e..e749c654de5c 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -8,6 +8,8 @@ import Foundation import PromiseKit + + open class FakeClassnameTags123API { /** To test class name in snake case diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 18d3fd1d094f..88269c38385b 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -8,6 +8,8 @@ import Foundation import PromiseKit + + open class PetAPI { /** Add a new pet to the store @@ -58,7 +60,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Promise */ - open class func deletePet( petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { + open class func deletePet( petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { let deferred = Promise.pending() deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result -> Void in switch result { @@ -87,8 +89,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let nillableHeaders: [String: Any?] = [ "api_key": apiKey?.encodeToJSON() @@ -142,8 +144,8 @@ open class PetAPI { open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "status": status.encodeToJSON() @@ -189,8 +191,8 @@ open class PetAPI { open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "tags": tags.encodeToJSON() @@ -237,8 +239,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -296,7 +298,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Promise */ - open class func updatePetWithForm( petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { + open class func updatePetWithForm( petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { let deferred = Promise.pending() updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result -> Void in switch result { @@ -326,14 +328,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "name": name?.encodeToJSON(), "status": status?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -350,7 +352,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Promise */ - open class func uploadFile( petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { + open class func uploadFile( petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { let deferred = Promise.pending() uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result -> Void in switch result { @@ -380,14 +382,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "file": file?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -404,7 +406,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Promise */ - open class func uploadFileWithRequiredFile( petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { + open class func uploadFileWithRequiredFile( petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { let deferred = Promise.pending() uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result -> Void in switch result { @@ -434,14 +436,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "requiredFile": requiredFile.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 20fc8a1468c7..9bb66f3699f7 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -8,6 +8,8 @@ import Foundation import PromiseKit + + open class StoreAPI { /** Delete purchase order by ID @@ -42,8 +44,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -57,8 +59,8 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Promise<[String:Int]> */ - open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise<[String: Int]> { - let deferred = Promise<[String: Int]>.pending() + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise<[String:Int]> { + let deferred = Promise<[String:Int]>.pending() getInventoryWithRequestBuilder().execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -79,14 +81,14 @@ open class StoreAPI { - name: api_key - returns: RequestBuilder<[String:Int]> */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { + open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } @@ -124,8 +126,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 89c48c3b28f8..237961c96a08 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -8,6 +8,8 @@ import Foundation import PromiseKit + + open class UserAPI { /** Create user @@ -157,8 +159,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -198,8 +200,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -215,7 +217,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Promise */ - open class func loginUser( username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { + open class func loginUser( username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { let deferred = Promise.pending() loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result -> Void in switch result { @@ -239,11 +241,11 @@ open class UserAPI { open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username.encodeToJSON(), + "username": username.encodeToJSON(), "password": password.encodeToJSON() ]) @@ -279,8 +281,8 @@ open class UserAPI { open class func logoutUserWithRequestBuilder() -> RequestBuilder { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -296,7 +298,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Promise */ - open class func updateUser( username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { + open class func updateUser( username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { let deferred = Promise.pending() updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result -> Void in switch result { diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index ef971ebadc60..01b28a4bd42d 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -45,4 +45,4 @@ open class CodableHelper { open class func encode(_ value: T) -> Swift.Result where T: Encodable { return Swift.Result { try self.jsonEncoder.encode(value) } } -} +} \ No newline at end of file diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift index 627d9adb757e..f171525e4394 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -7,10 +7,10 @@ import Foundation open class Configuration { - + // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} + +} \ No newline at end of file diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 736702ea5dd9..5b98ba296730 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -109,24 +109,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { if let values = values { try encodeArray(values, forKey: key) } } - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -136,7 +136,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -148,8 +148,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { - var tmpArray: [T]? + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { + var tmpArray: [T]? = nil if contains(key) { tmpArray = try decodeArray(T.self, forKey: key) @@ -158,8 +158,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { + var map: [Self.Key : T] = [:] for key in allKeys { if !excludedKeys.contains(key) { @@ -180,7 +180,7 @@ extension HTTPURLResponse { } extension RequestBuilder { - public func execute() -> Promise> { + public func execute() -> Promise> { let deferred = Promise>.pending() self.execute { result in switch result { diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift index b79e9f5e64d5..08f1ef334dff 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift @@ -41,7 +41,7 @@ public struct JSONDataEncoding { } public static func encodingParameters(jsonData: Data?) -> [String: Any]? { - var returnedParams: [String: Any]? + var returnedParams: [String: Any]? = nil if let jsonData = jsonData, !jsonData.isEmpty { var params: [String: Any] = [:] params[jsonDataKey] = jsonData diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 02f78ffb4705..314f1eff1f9b 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -9,8 +9,8 @@ import Foundation open class JSONEncodingHelper { - open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { - var params: [String: Any]? + open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { + var params: [String: Any]? = nil // Encode the Encodable object if let encodableObj = encodableObj { @@ -27,7 +27,7 @@ open class JSONEncodingHelper { } open class func encodingParameters(forEncodableObject encodableObj: Any?) -> [String: Any]? { - var params: [String: Any]? + var params: [String: Any]? = nil if let encodableObj = encodableObj { do { @@ -41,5 +41,5 @@ open class JSONEncodingHelper { return params } - + } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift index c0542c14c081..11e81ffcc472 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,11 +10,11 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -public enum ErrorResponse: Error { +public enum ErrorResponse : Error { case error(Int, Data?, Error) } -public enum DownloadException: Error { +public enum DownloadException : Error { case responseDataMissing case responseFailed case requestMissing @@ -30,6 +30,7 @@ public enum DecodableRequestBuilderError: Error { case generalError(Error) } + open class Response { public let statusCode: Int public let header: [String: String] @@ -43,7 +44,7 @@ open class Response { public convenience init(response: HTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String: String]() + var header = [String:String]() for (key, value) in rawHeader { if let key = key.base as? String, let value = value as? String { header[key] = value diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 1af031535967..28ca8377b889 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -7,17 +7,19 @@ import Foundation -public struct AdditionalPropertiesClass: Codable { - public var mapString: [String: String]? - public var mapMapString: [String: [String: String]]? +public struct AdditionalPropertiesClass: Codable { - public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { + + public var mapString: [String:String]? + public var mapMapString: [String:[String:String]]? + + public init(mapString: [String:String]?, mapMapString: [String:[String:String]]?) { self.mapString = mapString self.mapMapString = mapMapString } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapString = "map_string" case mapMapString = "map_map_string" } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 5ed9f31e2a36..1050d79dbe9d 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -7,7 +7,9 @@ import Foundation -public struct Animal: Codable { + +public struct Animal: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift index e09b0e9efdc8..e7bea63f8ed2 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -7,4 +7,5 @@ import Foundation + public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index ec270da89074..4d0393b9ba45 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -7,7 +7,9 @@ import Foundation -public struct ApiResponse: Codable { + +public struct ApiResponse: Codable { + public var code: Int? public var type: String? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 6c252ed475b2..1363c96394ba 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayOfArrayOfNumberOnly: Codable { + +public struct ArrayOfArrayOfNumberOnly: Codable { + public var arrayArrayNumber: [[Double]]? @@ -15,7 +17,7 @@ public struct ArrayOfArrayOfNumberOnly: Codable { self.arrayArrayNumber = arrayArrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayArrayNumber = "ArrayArrayNumber" } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index e84eb5d65025..6b8873730c43 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayOfNumberOnly: Codable { + +public struct ArrayOfNumberOnly: Codable { + public var arrayNumber: [Double]? @@ -15,7 +17,7 @@ public struct ArrayOfNumberOnly: Codable { self.arrayNumber = arrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayNumber = "ArrayNumber" } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index d2140933d181..64f7c6d9db99 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayTest: Codable { + +public struct ArrayTest: Codable { + public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? @@ -19,7 +21,7 @@ public struct ArrayTest: Codable { self.arrayArrayOfModel = arrayArrayOfModel } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" case arrayArrayOfModel = "array_array_of_model" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index d1b3b27616ed..ddb669a59045 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -7,7 +7,9 @@ import Foundation -public struct Capitalization: Codable { + +public struct Capitalization: Codable { + public var smallCamel: String? public var capitalCamel: String? @@ -26,7 +28,7 @@ public struct Capitalization: Codable { self.ATT_NAME = ATT_NAME } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case smallCamel case capitalCamel = "CapitalCamel" case smallSnake = "small_Snake" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 7ab887f3113f..c4f6e0d488ca 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -7,7 +7,9 @@ import Foundation -public struct Cat: Codable { + +public struct Cat: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index a51ad0dffab1..7b1d7e32be80 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -7,7 +7,9 @@ import Foundation -public struct CatAllOf: Codable { + +public struct CatAllOf: Codable { + public var declawed: Bool? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index eb8f7e5e1974..3ec00f5ab10d 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,7 +7,9 @@ import Foundation -public struct Category: Codable { + +public struct Category: Codable { + public var id: Int64? public var name: String = "default-name" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index e2a7d4427a06..af030c3dd626 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model with \"_class\" property */ -public struct ClassModel: Codable { +public struct ClassModel: Codable { + public var _class: String? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 00245ca37280..0aae748c76b4 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -7,7 +7,9 @@ import Foundation -public struct Client: Codable { + +public struct Client: Codable { + public var client: String? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 492c1228008e..198e28b94dd6 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -7,7 +7,9 @@ import Foundation -public struct Dog: Codable { + +public struct Dog: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 7786f8acc5ae..8ff49b2af23f 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -7,7 +7,9 @@ import Foundation -public struct DogAllOf: Codable { + +public struct DogAllOf: Codable { + public var breed: String? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 9844e7c40e35..e2d3fa04f94b 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -7,7 +7,9 @@ import Foundation -public struct EnumArrays: Codable { + +public struct EnumArrays: Codable { + public enum JustSymbol: String, Codable, CaseIterable { case greaterThanOrEqualTo = ">=" @@ -25,7 +27,7 @@ public struct EnumArrays: Codable { self.arrayEnum = arrayEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justSymbol = "just_symbol" case arrayEnum = "array_enum" } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index d4029d73f8af..c2c639ba3246 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -7,6 +7,7 @@ import Foundation + public enum EnumClass: String, Codable, CaseIterable { case abc = "_abc" case efg = "-efg" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 789f583e1d77..a56e1f36389b 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct EnumTest: Codable { + +public struct EnumTest: Codable { + public enum EnumString: String, Codable, CaseIterable { case upper = "UPPER" @@ -41,7 +43,7 @@ public struct EnumTest: Codable { self.outerEnum = outerEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case enumString = "enum_string" case enumStringRequired = "enum_string_required" case enumInteger = "enum_integer" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift index abf3ccffc485..773b53b2cb76 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -8,7 +8,8 @@ import Foundation /** Must be named `File` for test. */ -public struct File: Codable { +public struct File: Codable { + /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 532f1457939a..83dc1148cfa3 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -7,7 +7,9 @@ import Foundation -public struct FileSchemaTestClass: Codable { + +public struct FileSchemaTestClass: Codable { + public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index 20bd6d103b3d..bccd3f9fb178 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct FormatTest: Codable { + +public struct FormatTest: Codable { + public var integer: Int? public var int32: Int? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 906ddb06fb17..566d71a35ef0 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct HasOnlyReadOnly: Codable { + +public struct HasOnlyReadOnly: Codable { + public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift index fe13d302ccbf..80cecab242f2 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -7,7 +7,9 @@ import Foundation -public struct List: Codable { + +public struct List: Codable { + public var _123list: String? @@ -15,7 +17,7 @@ public struct List: Codable { self._123list = _123list } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _123list = "123-list" } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 4b6037f378ee..f0c02de95f7a 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -7,25 +7,27 @@ import Foundation -public struct MapTest: Codable { + +public struct MapTest: Codable { + public enum MapOfEnumString: String, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" } - public var mapMapOfString: [String: [String: String]]? - public var mapOfEnumString: [String: String]? - public var directMap: [String: Bool]? + public var mapMapOfString: [String:[String:String]]? + public var mapOfEnumString: [String:String]? + public var directMap: [String:Bool]? public var indirectMap: StringBooleanMap? - public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { + public init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?, directMap: [String:Bool]?, indirectMap: StringBooleanMap?) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap self.indirectMap = indirectMap } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" case directMap = "direct_map" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c3deb2f28932..710e62a9b587 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,13 +7,15 @@ import Foundation -public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { + +public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { + public var uuid: UUID? public var dateTime: Date? - public var map: [String: Animal]? + public var map: [String:Animal]? - public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { + public init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { self.uuid = uuid self.dateTime = dateTime self.map = map diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index b61db7d6e716..450a53b918ca 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model name starting with number */ -public struct Model200Response: Codable { +public struct Model200Response: Codable { + public var name: Int? public var _class: String? @@ -18,7 +19,7 @@ public struct Model200Response: Codable { self._class = _class } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case _class = "class" } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 8ab4db44b73a..6deb69fcd731 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model name same as property name */ -public struct Name: Codable { +public struct Name: Codable { + public var name: Int public var snakeCase: Int? @@ -22,7 +23,7 @@ public struct Name: Codable { self._123number = _123number } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case snakeCase = "snake_case" case property diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 4d1dafcc2c1f..0c9ee2b7b9f4 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct NumberOnly: Codable { + +public struct NumberOnly: Codable { + public var justNumber: Double? @@ -15,7 +17,7 @@ public struct NumberOnly: Codable { self.justNumber = justNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justNumber = "JustNumber" } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 40c30cc8609c..ab0eac0b304e 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,7 +7,9 @@ import Foundation -public struct Order: Codable { + +public struct Order: Codable { + public enum Status: String, Codable, CaseIterable { case placed = "placed" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 18c3a024f122..4a7d22710441 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -7,7 +7,9 @@ import Foundation -public struct OuterComposite: Codable { + +public struct OuterComposite: Codable { + public var myNumber: Double? public var myString: String? @@ -19,7 +21,7 @@ public struct OuterComposite: Codable { self.myBoolean = myBoolean } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case myNumber = "my_number" case myString = "my_string" case myBoolean = "my_boolean" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index c3b778cbbed4..9e6b8d74e874 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -7,6 +7,7 @@ import Foundation + public enum OuterEnum: String, Codable, CaseIterable { case placed = "placed" case approved = "approved" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index b9ce0e933256..a973071d6c96 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,7 +7,9 @@ import Foundation -public struct Pet: Codable { + +public struct Pet: Codable { + public enum Status: String, Codable, CaseIterable { case available = "available" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 0acd21fd1000..b2a6b7e2b8a6 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -7,7 +7,9 @@ import Foundation -public struct ReadOnlyFirst: Codable { + +public struct ReadOnlyFirst: Codable { + public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index c223f993a69e..7e089dcee2b4 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing reserved words */ -public struct Return: Codable { +public struct Return: Codable { + public var _return: Int? @@ -16,7 +17,7 @@ public struct Return: Codable { self._return = _return } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _return = "return" } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index 6e8650f76d8e..e890ef952520 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -7,7 +7,9 @@ import Foundation -public struct SpecialModelName: Codable { + +public struct SpecialModelName: Codable { + public var specialPropertyName: Int64? @@ -15,7 +17,7 @@ public struct SpecialModelName: Codable { self.specialPropertyName = specialPropertyName } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case specialPropertyName = "$special[property.name]" } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index 3f1237fee477..f65ae0623d6e 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -7,9 +7,12 @@ import Foundation -public struct StringBooleanMap: Codable { - public var additionalProperties: [String: Bool] = [:] +public struct StringBooleanMap: Codable { + + + + public var additionalProperties: [String:Bool] = [:] public subscript(key: String) -> Bool? { get { @@ -42,4 +45,5 @@ public struct StringBooleanMap: Codable { additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } + } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 4dd8a9a9f5a0..a91b6061bcf7 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,7 +7,9 @@ import Foundation -public struct Tag: Codable { + +public struct Tag: Codable { + public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index a9e088808ed3..2d377c3edb02 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -7,7 +7,9 @@ import Foundation -public struct TypeHolderDefault: Codable { + +public struct TypeHolderDefault: Codable { + public var stringItem: String = "what" public var numberItem: Double @@ -23,7 +25,7 @@ public struct TypeHolderDefault: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index dff4083ae432..e5eb92da696e 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -7,7 +7,9 @@ import Foundation -public struct TypeHolderExample: Codable { + +public struct TypeHolderExample: Codable { + public var stringItem: String public var numberItem: Double @@ -23,7 +25,7 @@ public struct TypeHolderExample: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 79f271ed7356..f70328ca9e59 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,7 +7,9 @@ import Foundation -public struct User: Codable { + +public struct User: Codable { + public var id: Int64? public var username: String? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index 55d0eb421919..22261e2ce948 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -14,7 +14,7 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { return URLSessionRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return URLSessionDecodableRequestBuilder.self } } @@ -23,16 +23,16 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { private var urlSessionStore = SynchronizedDictionary() open class URLSessionRequestBuilder: RequestBuilder { - + private var observation: NSKeyValueObservation? - + deinit { observation?.invalidate() } - + // swiftlint:disable:next weak_delegate fileprivate let sessionDelegate = SessionDelegate() - + /** May be assigned if you want to control the authentication challenges. */ @@ -45,11 +45,11 @@ open class URLSessionRequestBuilder: RequestBuilder { - retry the request. */ public var taskCompletionShouldRetry: ((Data?, URLResponse?, Error?, @escaping (Bool) -> Void) -> Void)? - - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + + required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } - + /** May be overridden by a subclass if you want to control the URLSession configuration. @@ -77,40 +77,40 @@ open class URLSessionRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the URLRequest configuration (e.g. to override the cache policy). */ - open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) throws -> URLRequest { - + open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) throws -> URLRequest { + guard let url = URL(string: URLString) else { throw DownloadException.requestMissingURL } - + var originalRequest = URLRequest(url: url) - + originalRequest.httpMethod = method.rawValue - + buildHeaders().forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + headers.forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + let modifiedRequest = try encoding.encode(originalRequest, with: parameters) - + return modifiedRequest } override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, Error>) -> Void) { - let urlSessionId: String = UUID().uuidString + let urlSessionId:String = UUID().uuidString // Create a new manager for each request to customize its request header let urlSession = createURLSession() urlSessionStore[urlSessionId] = urlSession - + let parameters: [String: Any] = self.parameters ?? [:] - + let fileKeys = parameters.filter { $1 is URL } .map { $0.0 } - + let encoding: ParameterEncoding if fileKeys.count > 0 { encoding = FileUploadEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) @@ -119,29 +119,29 @@ open class URLSessionRequestBuilder: RequestBuilder { } else { encoding = URLEncoding() } - + guard let xMethod = HTTPMethod(rawValue: method) else { fatalError("Unsuported Http method - \(method)") } - + let cleanupRequest = { urlSessionStore[urlSessionId] = nil self.observation?.invalidate() } - + do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) - + let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in - + guard let self = self else { return } - + if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - + taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in - + guard let self = self else { return } - + if shouldRetry { cleanupRequest() self.execute(apiResponseQueue, completion) @@ -157,13 +157,13 @@ open class URLSessionRequestBuilder: RequestBuilder { } } } - + if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { onProgressReady?(dataTask.progress) } - + dataTask.resume() - + } catch { apiResponseQueue.async { cleanupRequest() @@ -172,7 +172,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - + fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, Error>) -> Void) { if let error = error { @@ -192,52 +192,52 @@ open class URLSessionRequestBuilder: RequestBuilder { switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is URL.Type: do { - + guard error == nil else { throw DownloadException.responseFailed } - + guard let data = data else { throw DownloadException.responseDataMissing } - + let fileManager = FileManager.default let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] let requestURL = try self.getURL(from: urlRequest) - + var requestPath = try self.getPath(from: requestURL) - + if let headerFileName = self.getFileName(fromContentDisposition: httpResponse.allHeaderFields["Content-Disposition"] as? String) { requestPath = requestPath.appending("/\(headerFileName)") } - + let filePath = documentsDirectory.appendingPathComponent(requestPath) let directoryPath = filePath.deletingLastPathComponent().path - + try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) try data.write(to: filePath, options: .atomic) - + completion(.success(Response(response: httpResponse, body: filePath as? T))) - + } catch let requestParserError as DownloadException { completion(.failure(ErrorResponse.error(400, data, requestParserError))) } catch let error { completion(.failure(ErrorResponse.error(400, data, error))) } - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + default: - + completion(.success(Response(response: httpResponse, body: data as? T))) } @@ -251,7 +251,7 @@ open class URLSessionRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -270,7 +270,7 @@ open class URLSessionRequestBuilder: RequestBuilder { filename = contentItem return filename? - .replacingCharacters(in: range, with: "") + .replacingCharacters(in: range, with:"") .replacingOccurrences(of: "\"", with: "") .trimmingCharacters(in: .whitespacesAndNewlines) } @@ -279,7 +279,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url: URL) throws -> String { + fileprivate func getPath(from url : URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -293,7 +293,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -304,7 +304,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } -open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { +open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, Error>) -> Void) { if let error = error { @@ -324,28 +324,28 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + case is Data.Type: - + completion(.success(Response(response: httpResponse, body: data as? T))) - + default: - + guard let data = data, !data.isEmpty else { completion(.failure(ErrorResponse.error(httpResponse.statusCode, nil, DecodableRequestBuilderError.emptyDataResponse))) return } - + let decodeResult = CodableHelper.decode(T.self, from: data) - + switch decodeResult { case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) @@ -356,10 +356,10 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui } } -private class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { - +fileprivate class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { + var credential: URLCredential? - + var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { @@ -402,13 +402,13 @@ public protocol ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest } -private class URLEncoding: ParameterEncoding { - func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { - +fileprivate class URLEncoding: ParameterEncoding { + func encode(_ urlRequest: URLRequest, with parameters: [String : Any]?) throws -> URLRequest { + var urlRequest = urlRequest - + guard let parameters = parameters else { return urlRequest } - + guard let url = urlRequest.url else { throw DownloadException.requestMissingURL } @@ -417,12 +417,12 @@ private class URLEncoding: ParameterEncoding { urlComponents.queryItems = APIHelper.mapValuesToQueryItems(parameters) urlRequest.url = urlComponents.url } - + return urlRequest } } -private class FileUploadEncoding: ParameterEncoding { +fileprivate class FileUploadEncoding: ParameterEncoding { let contentTypeForFormPart: (_ fileURL: URL) -> String? @@ -433,13 +433,13 @@ private class FileUploadEncoding: ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { var urlRequest = urlRequest - + guard let parameters = parameters, !parameters.isEmpty else { return urlRequest } - + let boundary = "Boundary-\(UUID().uuidString)" - + urlRequest.setValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type") for (key, value) in parameters { @@ -479,7 +479,7 @@ private class FileUploadEncoding: ParameterEncoding { fatalError("Unprocessable value \(value) with key \(key)") } } - + var body = urlRequest.httpBody.orEmpty body.append("\r\n--\(boundary)--\r\n") @@ -494,7 +494,7 @@ private class FileUploadEncoding: ParameterEncoding { var urlRequest = urlRequest var body = urlRequest.httpBody.orEmpty - + let fileData = try Data(contentsOf: fileURL) let mimetype = self.contentTypeForFormPart(fileURL) ?? mimeType(for: fileURL) @@ -502,7 +502,7 @@ private class FileUploadEncoding: ParameterEncoding { let fileName = fileURL.lastPathComponent // If we already added something then we need an additional newline. - if body.count > 0 { + if (body.count > 0) { body.append("\r\n") } @@ -518,20 +518,20 @@ private class FileUploadEncoding: ParameterEncoding { // The value data. body.append(fileData) - + urlRequest.httpBody = body return urlRequest } - + private func configureDataUploadRequest(urlRequest: URLRequest, boundary: String, name: String, data: Data) -> URLRequest { var urlRequest = urlRequest - + var body = urlRequest.httpBody.orEmpty // If we already added something then we need an additional newline. - if body.count > 0 { + if (body.count > 0) { body.append("\r\n") } diff --git a/samples/client/petstore/swift5/readonlyProperties/Package.swift b/samples/client/petstore/swift5/readonlyProperties/Package.swift index 96dfff54edf4..79f6f8188738 100644 --- a/samples/client/petstore/swift5/readonlyProperties/Package.swift +++ b/samples/client/petstore/swift5/readonlyProperties/Package.swift @@ -14,7 +14,7 @@ let package = Package( // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "PetstoreClient", - targets: ["PetstoreClient"]) + targets: ["PetstoreClient"]), ], dependencies: [ // Dependencies declare other packages that this package depends on. @@ -26,6 +26,6 @@ let package = Package( name: "PetstoreClient", dependencies: [], path: "PetstoreClient/Classes" - ) + ), ] ) diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 5b09f9557113..2404bc8ffc6d 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { + public static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { let destination = source.reduce(into: [String: Any]()) { (result, item) in if let value = item.value { result[item.key] = value @@ -20,17 +20,17 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { + public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? [Any?] { - result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") + if let collection = item.value as? Array { + result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { + public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { guard let source = source else { return nil } @@ -46,15 +46,15 @@ public struct APIHelper { } public static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? [Any?] { + if let collection = source as? Array { return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") } return source } - public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { + public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? [Any?] { + if let collection = item.value as? Array { collection.filter({ $0 != nil }).map({"\($0!)"}).forEach { value in result.append(URLQueryItem(name: item.key, value: value)) } @@ -69,3 +69,4 @@ public struct APIHelper { return destination } } + diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs.swift index a5c2d605dff6..c5d1b9b42df3 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,15 +9,15 @@ import Foundation open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var credential: URLCredential? - public static var customHeaders: [String: String] = [:] + public static var customHeaders: [String:String] = [:] public static var requestBuilderFactory: RequestBuilderFactory = URLSessionRequestBuilderFactory() public static var apiResponseQueue: DispatchQueue = .main } open class RequestBuilder { var credential: URLCredential? - var headers: [String: String] - public let parameters: [String: Any]? + var headers: [String:String] + public let parameters: [String:Any]? public let isBody: Bool public let method: String public let URLString: String @@ -25,9 +25,9 @@ open class RequestBuilder { /// Optional block to obtain a reference to the request's progress instance when available. /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. /// If you need to get the request's progress in older OS versions, please use Alamofire http client. - public var onProgressReady: ((Progress) -> Void)? + public var onProgressReady: ((Progress) -> ())? - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -37,7 +37,7 @@ open class RequestBuilder { addHeaders(PetstoreClientAPI.customHeaders) } - open func addHeaders(_ aHeaders: [String: String]) { + open func addHeaders(_ aHeaders:[String:String]) { for (header, value) in aHeaders { headers[header] = value } @@ -60,5 +60,5 @@ open class RequestBuilder { public protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 5bbf323f820c..bb3ae7178254 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class AnotherFakeAPI { /** To test special tags @@ -15,7 +17,7 @@ open class AnotherFakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 134d6aea416a..d1d81faa335c 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class FakeAPI { /** @@ -14,7 +16,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) { + open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?,_ error: Error?) -> Void)) { fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -49,7 +51,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) { + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?,_ error: Error?) -> Void)) { fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -84,7 +86,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) { + open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?,_ error: Error?) -> Void)) { fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -119,7 +121,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { + open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -154,7 +156,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -190,7 +192,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -229,7 +231,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -279,7 +281,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testEndpointParametersWithRequestBuilder(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -316,7 +318,7 @@ open class FakeAPI { open class func testEndpointParametersWithRequestBuilder(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "integer": integer?.encodeToJSON(), "int32": int32?.encodeToJSON(), "int64": int64?.encodeToJSON(), @@ -335,7 +337,7 @@ open class FakeAPI { let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -424,7 +426,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -452,19 +454,19 @@ open class FakeAPI { open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "enum_form_string_array": enumFormStringArray?.encodeToJSON(), "enum_form_string": enumFormString?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), - "enum_query_string": enumQueryString?.encodeToJSON(), - "enum_query_integer": enumQueryInteger?.encodeToJSON(), + "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), + "enum_query_string": enumQueryString?.encodeToJSON(), + "enum_query_integer": enumQueryInteger?.encodeToJSON(), "enum_query_double": enumQueryDouble?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -490,7 +492,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -516,13 +518,13 @@ open class FakeAPI { open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), "int64_group": int64Group?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -543,7 +545,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testInlineAdditionalProperties(param: [String:String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -560,7 +562,7 @@ open class FakeAPI { - parameter param: (body) request body - returns: RequestBuilder */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { let path = "/fake/inline-additionalProperties" let URLString = PetstoreClientAPI.basePath + path let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) @@ -580,7 +582,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -601,14 +603,14 @@ open class FakeAPI { open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { let path = "/fake/jsonFormData" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "param": param.encodeToJSON(), "param2": param2.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 48cfe7187b9a..d21c4a49d43d 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -7,6 +7,8 @@ import Foundation + + open class FakeClassnameTags123API { /** To test class name in snake case @@ -15,7 +17,7 @@ open class FakeClassnameTags123API { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index c938db720047..f5366f5832ba 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class PetAPI { /** Add a new pet to the store @@ -15,7 +17,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -55,7 +57,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -82,8 +84,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let nillableHeaders: [String: Any?] = [ "api_key": apiKey?.encodeToJSON() @@ -111,7 +113,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { + open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -135,8 +137,8 @@ open class PetAPI { open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "status": status.encodeToJSON() @@ -155,7 +157,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @available(*, deprecated, message: "This operation is deprecated.") - open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { + open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -180,8 +182,8 @@ open class PetAPI { open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "tags": tags.encodeToJSON() @@ -199,7 +201,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) { + open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?,_ error: Error?) -> Void)) { getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -226,8 +228,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -242,7 +244,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -283,7 +285,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -311,14 +313,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "name": name?.encodeToJSON(), "status": status?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -335,7 +337,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -363,14 +365,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "file": file?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -387,7 +389,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -415,14 +417,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "requiredFile": requiredFile.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index a8a83eda39a4..3848eda85ad6 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class StoreAPI { /** Delete purchase order by ID @@ -15,7 +17,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -39,8 +41,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -54,7 +56,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) { + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String:Int]?,_ error: Error?) -> Void)) { getInventoryWithRequestBuilder().execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -74,14 +76,14 @@ open class StoreAPI { - name: api_key - returns: RequestBuilder<[String:Int]> */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { + open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } @@ -93,7 +95,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { + open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -117,8 +119,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -133,7 +135,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { + open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 505ed1b0c5c9..546166841d9e 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class UserAPI { /** Create user @@ -15,7 +17,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -52,7 +54,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -88,7 +90,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -124,7 +126,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -148,8 +150,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -164,7 +166,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) { + open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?,_ error: Error?) -> Void)) { getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -187,8 +189,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -204,7 +206,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { + open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -226,11 +228,11 @@ open class UserAPI { open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username.encodeToJSON(), + "username": username.encodeToJSON(), "password": password.encodeToJSON() ]) @@ -245,7 +247,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { logoutUserWithRequestBuilder().execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -264,8 +266,8 @@ open class UserAPI { open class func logoutUserWithRequestBuilder() -> RequestBuilder { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -281,7 +283,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index ef971ebadc60..01b28a4bd42d 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -45,4 +45,4 @@ open class CodableHelper { open class func encode(_ value: T) -> Swift.Result where T: Encodable { return Swift.Result { try self.jsonEncoder.encode(value) } } -} +} \ No newline at end of file diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Configuration.swift index 627d9adb757e..f171525e4394 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -7,10 +7,10 @@ import Foundation open class Configuration { - + // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} + +} \ No newline at end of file diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 93ed6b90b376..6e279679c67a 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -108,24 +108,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { if let values = values { try encodeArray(values, forKey: key) } } - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -135,7 +135,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -147,8 +147,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { - var tmpArray: [T]? + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { + var tmpArray: [T]? = nil if contains(key) { tmpArray = try decodeArray(T.self, forKey: key) @@ -157,8 +157,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { + var map: [Self.Key : T] = [:] for key in allKeys { if !excludedKeys.contains(key) { @@ -177,3 +177,5 @@ extension HTTPURLResponse { return Array(200 ..< 300).contains(statusCode) } } + + diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift index b79e9f5e64d5..08f1ef334dff 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift @@ -41,7 +41,7 @@ public struct JSONDataEncoding { } public static func encodingParameters(jsonData: Data?) -> [String: Any]? { - var returnedParams: [String: Any]? + var returnedParams: [String: Any]? = nil if let jsonData = jsonData, !jsonData.isEmpty { var params: [String: Any] = [:] params[jsonDataKey] = jsonData diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 02f78ffb4705..314f1eff1f9b 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -9,8 +9,8 @@ import Foundation open class JSONEncodingHelper { - open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { - var params: [String: Any]? + open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { + var params: [String: Any]? = nil // Encode the Encodable object if let encodableObj = encodableObj { @@ -27,7 +27,7 @@ open class JSONEncodingHelper { } open class func encodingParameters(forEncodableObject encodableObj: Any?) -> [String: Any]? { - var params: [String: Any]? + var params: [String: Any]? = nil if let encodableObj = encodableObj { do { @@ -41,5 +41,5 @@ open class JSONEncodingHelper { return params } - + } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models.swift index c0542c14c081..11e81ffcc472 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,11 +10,11 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -public enum ErrorResponse: Error { +public enum ErrorResponse : Error { case error(Int, Data?, Error) } -public enum DownloadException: Error { +public enum DownloadException : Error { case responseDataMissing case responseFailed case requestMissing @@ -30,6 +30,7 @@ public enum DecodableRequestBuilderError: Error { case generalError(Error) } + open class Response { public let statusCode: Int public let header: [String: String] @@ -43,7 +44,7 @@ open class Response { public convenience init(response: HTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String: String]() + var header = [String:String]() for (key, value) in rawHeader { if let key = key.base as? String, let value = value as? String { header[key] = value diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 3fda7052a7d3..341b729479e8 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -7,17 +7,19 @@ import Foundation -public struct AdditionalPropertiesClass: Codable { - public private(set) var mapString: [String: String]? - public private(set) var mapMapString: [String: [String: String]]? +public struct AdditionalPropertiesClass: Codable { - public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { + + public private(set) var mapString: [String:String]? + public private(set) var mapMapString: [String:[String:String]]? + + public init(mapString: [String:String]?, mapMapString: [String:[String:String]]?) { self.mapString = mapString self.mapMapString = mapMapString } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapString = "map_string" case mapMapString = "map_map_string" } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index af59c2a9ef62..fc8bdfae7d5c 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -7,7 +7,9 @@ import Foundation -public struct Animal: Codable { + +public struct Animal: Codable { + public private(set) var className: String public private(set) var color: String? = "red" diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift index e09b0e9efdc8..e7bea63f8ed2 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -7,4 +7,5 @@ import Foundation + public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index a89768595cc5..48e052b3802d 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -7,7 +7,9 @@ import Foundation -public struct ApiResponse: Codable { + +public struct ApiResponse: Codable { + public private(set) var code: Int? public private(set) var type: String? diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index a2593b7c1a39..08f1b7e89b7c 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayOfArrayOfNumberOnly: Codable { + +public struct ArrayOfArrayOfNumberOnly: Codable { + public private(set) var arrayArrayNumber: [[Double]]? @@ -15,7 +17,7 @@ public struct ArrayOfArrayOfNumberOnly: Codable { self.arrayArrayNumber = arrayArrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayArrayNumber = "ArrayArrayNumber" } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index c5edf1100537..579f65acb928 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayOfNumberOnly: Codable { + +public struct ArrayOfNumberOnly: Codable { + public private(set) var arrayNumber: [Double]? @@ -15,7 +17,7 @@ public struct ArrayOfNumberOnly: Codable { self.arrayNumber = arrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayNumber = "ArrayNumber" } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index 8ad39b8c09fc..8fdf0a286909 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayTest: Codable { + +public struct ArrayTest: Codable { + public private(set) var arrayOfString: [String]? public private(set) var arrayArrayOfInteger: [[Int64]]? @@ -19,7 +21,7 @@ public struct ArrayTest: Codable { self.arrayArrayOfModel = arrayArrayOfModel } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" case arrayArrayOfModel = "array_array_of_model" diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index eb3d6777e52b..f4c7a90c3a85 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -7,7 +7,9 @@ import Foundation -public struct Capitalization: Codable { + +public struct Capitalization: Codable { + public private(set) var smallCamel: String? public private(set) var capitalCamel: String? @@ -26,7 +28,7 @@ public struct Capitalization: Codable { self.ATT_NAME = ATT_NAME } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case smallCamel case capitalCamel = "CapitalCamel" case smallSnake = "small_Snake" diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 2978b016f98e..3e509835b0b6 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -7,7 +7,9 @@ import Foundation -public struct Cat: Codable { + +public struct Cat: Codable { + public private(set) var className: String public private(set) var color: String? = "red" diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index 4ab80fbcd99e..f1627ee097a4 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -7,7 +7,9 @@ import Foundation -public struct CatAllOf: Codable { + +public struct CatAllOf: Codable { + public private(set) var declawed: Bool? diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index 3482703a6b41..bce83565cabc 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,7 +7,9 @@ import Foundation -public struct Category: Codable { + +public struct Category: Codable { + public private(set) var id: Int64? public private(set) var name: String = "default-name" diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index 319d88a70f7a..1d6271aef8a5 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model with \"_class\" property */ -public struct ClassModel: Codable { +public struct ClassModel: Codable { + public private(set) var _class: String? diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 5dd8cc3062dd..1e06ac73271d 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -7,7 +7,9 @@ import Foundation -public struct Client: Codable { + +public struct Client: Codable { + public private(set) var client: String? diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 16ab196b8724..fde6641dd77c 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -7,7 +7,9 @@ import Foundation -public struct Dog: Codable { + +public struct Dog: Codable { + public private(set) var className: String public private(set) var color: String? = "red" diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index d8a838725cbf..26d6da9def44 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -7,7 +7,9 @@ import Foundation -public struct DogAllOf: Codable { + +public struct DogAllOf: Codable { + public private(set) var breed: String? diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index d9ce69e9fc86..faa0ba8afb1f 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -7,7 +7,9 @@ import Foundation -public struct EnumArrays: Codable { + +public struct EnumArrays: Codable { + public enum JustSymbol: String, Codable, CaseIterable { case greaterThanOrEqualTo = ">=" @@ -25,7 +27,7 @@ public struct EnumArrays: Codable { self.arrayEnum = arrayEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justSymbol = "just_symbol" case arrayEnum = "array_enum" } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index d4029d73f8af..c2c639ba3246 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -7,6 +7,7 @@ import Foundation + public enum EnumClass: String, Codable, CaseIterable { case abc = "_abc" case efg = "-efg" diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 2b114d422d1b..576278be14d9 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct EnumTest: Codable { + +public struct EnumTest: Codable { + public enum EnumString: String, Codable, CaseIterable { case upper = "UPPER" @@ -41,7 +43,7 @@ public struct EnumTest: Codable { self.outerEnum = outerEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case enumString = "enum_string" case enumStringRequired = "enum_string_required" case enumInteger = "enum_integer" diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/File.swift index eeab58194415..81dac248edae 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -8,7 +8,8 @@ import Foundation /** Must be named `File` for test. */ -public struct File: Codable { +public struct File: Codable { + /** Test capitalization */ public private(set) var sourceURI: String? diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 94574ca9955b..4be9d64d2f26 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -7,7 +7,9 @@ import Foundation -public struct FileSchemaTestClass: Codable { + +public struct FileSchemaTestClass: Codable { + public private(set) var file: File? public private(set) var files: [File]? diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index 57bbd464b510..152b1b6277f4 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct FormatTest: Codable { + +public struct FormatTest: Codable { + public private(set) var integer: Int? public private(set) var int32: Int? diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 4de261f092d2..78b14697863f 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct HasOnlyReadOnly: Codable { + +public struct HasOnlyReadOnly: Codable { + public private(set) var bar: String? public private(set) var foo: String? diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/List.swift index 135160ff8de2..50e66b8c199a 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -7,7 +7,9 @@ import Foundation -public struct List: Codable { + +public struct List: Codable { + public private(set) var _123list: String? @@ -15,7 +17,7 @@ public struct List: Codable { self._123list = _123list } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _123list = "123-list" } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index ebd9dd5b5bc7..2df0bccb3039 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -7,25 +7,27 @@ import Foundation -public struct MapTest: Codable { + +public struct MapTest: Codable { + public enum MapOfEnumString: String, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" } - public private(set) var mapMapOfString: [String: [String: String]]? - public private(set) var mapOfEnumString: [String: String]? - public private(set) var directMap: [String: Bool]? + public private(set) var mapMapOfString: [String:[String:String]]? + public private(set) var mapOfEnumString: [String:String]? + public private(set) var directMap: [String:Bool]? public private(set) var indirectMap: StringBooleanMap? - public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { + public init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?, directMap: [String:Bool]?, indirectMap: StringBooleanMap?) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap self.indirectMap = indirectMap } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" case directMap = "direct_map" diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index dc1ee0461be7..c8cac41d37b1 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,13 +7,15 @@ import Foundation -public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { + +public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { + public private(set) var uuid: UUID? public private(set) var dateTime: Date? - public private(set) var map: [String: Animal]? + public private(set) var map: [String:Animal]? - public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { + public init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { self.uuid = uuid self.dateTime = dateTime self.map = map diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index a0f7127ef65c..ded3fb6912c6 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model name starting with number */ -public struct Model200Response: Codable { +public struct Model200Response: Codable { + public private(set) var name: Int? public private(set) var _class: String? @@ -18,7 +19,7 @@ public struct Model200Response: Codable { self._class = _class } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case _class = "class" } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index ee70b1f6ee9b..98f02ee6e9d7 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model name same as property name */ -public struct Name: Codable { +public struct Name: Codable { + public private(set) var name: Int public private(set) var snakeCase: Int? @@ -22,7 +23,7 @@ public struct Name: Codable { self._123number = _123number } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case snakeCase = "snake_case" case property diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 007dfab800ce..8555908ced43 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct NumberOnly: Codable { + +public struct NumberOnly: Codable { + public private(set) var justNumber: Double? @@ -15,7 +17,7 @@ public struct NumberOnly: Codable { self.justNumber = justNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justNumber = "JustNumber" } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 41a1d7d664e7..6e2f5e57710c 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,7 +7,9 @@ import Foundation -public struct Order: Codable { + +public struct Order: Codable { + public enum Status: String, Codable, CaseIterable { case placed = "placed" diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index df6d2512d6e4..ae7f8e53f7f1 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -7,7 +7,9 @@ import Foundation -public struct OuterComposite: Codable { + +public struct OuterComposite: Codable { + public private(set) var myNumber: Double? public private(set) var myString: String? @@ -19,7 +21,7 @@ public struct OuterComposite: Codable { self.myBoolean = myBoolean } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case myNumber = "my_number" case myString = "my_string" case myBoolean = "my_boolean" diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index c3b778cbbed4..9e6b8d74e874 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -7,6 +7,7 @@ import Foundation + public enum OuterEnum: String, Codable, CaseIterable { case placed = "placed" case approved = "approved" diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index 7b99ef33751a..95e4aea41c26 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,7 +7,9 @@ import Foundation -public struct Pet: Codable { + +public struct Pet: Codable { + public enum Status: String, Codable, CaseIterable { case available = "available" diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 30cd4837cc78..17f4a4c49646 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -7,7 +7,9 @@ import Foundation -public struct ReadOnlyFirst: Codable { + +public struct ReadOnlyFirst: Codable { + public private(set) var bar: String? public private(set) var baz: String? diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index b28b6e99d777..cf81158bec9b 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing reserved words */ -public struct Return: Codable { +public struct Return: Codable { + public private(set) var _return: Int? @@ -16,7 +17,7 @@ public struct Return: Codable { self._return = _return } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _return = "return" } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index 266833a0dbc6..f3b2e7cf40b5 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -7,7 +7,9 @@ import Foundation -public struct SpecialModelName: Codable { + +public struct SpecialModelName: Codable { + public private(set) var specialPropertyName: Int64? @@ -15,7 +17,7 @@ public struct SpecialModelName: Codable { self.specialPropertyName = specialPropertyName } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case specialPropertyName = "$special[property.name]" } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index dbd5afe27091..9642286b2630 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -7,9 +7,12 @@ import Foundation -public struct StringBooleanMap: Codable { - public private(set) var additionalProperties: [String: Bool] = [:] +public struct StringBooleanMap: Codable { + + + + public private(set) var additionalProperties: [String:Bool] = [:] public subscript(key: String) -> Bool? { get { @@ -42,4 +45,5 @@ public struct StringBooleanMap: Codable { additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } + } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index f827ccf107ad..4f97c69f6832 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,7 +7,9 @@ import Foundation -public struct Tag: Codable { + +public struct Tag: Codable { + public private(set) var id: Int64? public private(set) var name: String? diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index ed3641fdb2fc..528a2bdd07c1 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -7,7 +7,9 @@ import Foundation -public struct TypeHolderDefault: Codable { + +public struct TypeHolderDefault: Codable { + public private(set) var stringItem: String = "what" public private(set) var numberItem: Double @@ -23,7 +25,7 @@ public struct TypeHolderDefault: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index 4985005bdaf1..5d68a286685c 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -7,7 +7,9 @@ import Foundation -public struct TypeHolderExample: Codable { + +public struct TypeHolderExample: Codable { + public private(set) var stringItem: String public private(set) var numberItem: Double @@ -23,7 +25,7 @@ public struct TypeHolderExample: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 9fba7de81820..be82224b2628 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,7 +7,9 @@ import Foundation -public struct User: Codable { + +public struct User: Codable { + public private(set) var id: Int64? public private(set) var username: String? diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index 55d0eb421919..22261e2ce948 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -14,7 +14,7 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { return URLSessionRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return URLSessionDecodableRequestBuilder.self } } @@ -23,16 +23,16 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { private var urlSessionStore = SynchronizedDictionary() open class URLSessionRequestBuilder: RequestBuilder { - + private var observation: NSKeyValueObservation? - + deinit { observation?.invalidate() } - + // swiftlint:disable:next weak_delegate fileprivate let sessionDelegate = SessionDelegate() - + /** May be assigned if you want to control the authentication challenges. */ @@ -45,11 +45,11 @@ open class URLSessionRequestBuilder: RequestBuilder { - retry the request. */ public var taskCompletionShouldRetry: ((Data?, URLResponse?, Error?, @escaping (Bool) -> Void) -> Void)? - - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + + required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } - + /** May be overridden by a subclass if you want to control the URLSession configuration. @@ -77,40 +77,40 @@ open class URLSessionRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the URLRequest configuration (e.g. to override the cache policy). */ - open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) throws -> URLRequest { - + open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) throws -> URLRequest { + guard let url = URL(string: URLString) else { throw DownloadException.requestMissingURL } - + var originalRequest = URLRequest(url: url) - + originalRequest.httpMethod = method.rawValue - + buildHeaders().forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + headers.forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + let modifiedRequest = try encoding.encode(originalRequest, with: parameters) - + return modifiedRequest } override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, Error>) -> Void) { - let urlSessionId: String = UUID().uuidString + let urlSessionId:String = UUID().uuidString // Create a new manager for each request to customize its request header let urlSession = createURLSession() urlSessionStore[urlSessionId] = urlSession - + let parameters: [String: Any] = self.parameters ?? [:] - + let fileKeys = parameters.filter { $1 is URL } .map { $0.0 } - + let encoding: ParameterEncoding if fileKeys.count > 0 { encoding = FileUploadEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) @@ -119,29 +119,29 @@ open class URLSessionRequestBuilder: RequestBuilder { } else { encoding = URLEncoding() } - + guard let xMethod = HTTPMethod(rawValue: method) else { fatalError("Unsuported Http method - \(method)") } - + let cleanupRequest = { urlSessionStore[urlSessionId] = nil self.observation?.invalidate() } - + do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) - + let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in - + guard let self = self else { return } - + if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - + taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in - + guard let self = self else { return } - + if shouldRetry { cleanupRequest() self.execute(apiResponseQueue, completion) @@ -157,13 +157,13 @@ open class URLSessionRequestBuilder: RequestBuilder { } } } - + if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { onProgressReady?(dataTask.progress) } - + dataTask.resume() - + } catch { apiResponseQueue.async { cleanupRequest() @@ -172,7 +172,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - + fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, Error>) -> Void) { if let error = error { @@ -192,52 +192,52 @@ open class URLSessionRequestBuilder: RequestBuilder { switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is URL.Type: do { - + guard error == nil else { throw DownloadException.responseFailed } - + guard let data = data else { throw DownloadException.responseDataMissing } - + let fileManager = FileManager.default let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] let requestURL = try self.getURL(from: urlRequest) - + var requestPath = try self.getPath(from: requestURL) - + if let headerFileName = self.getFileName(fromContentDisposition: httpResponse.allHeaderFields["Content-Disposition"] as? String) { requestPath = requestPath.appending("/\(headerFileName)") } - + let filePath = documentsDirectory.appendingPathComponent(requestPath) let directoryPath = filePath.deletingLastPathComponent().path - + try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) try data.write(to: filePath, options: .atomic) - + completion(.success(Response(response: httpResponse, body: filePath as? T))) - + } catch let requestParserError as DownloadException { completion(.failure(ErrorResponse.error(400, data, requestParserError))) } catch let error { completion(.failure(ErrorResponse.error(400, data, error))) } - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + default: - + completion(.success(Response(response: httpResponse, body: data as? T))) } @@ -251,7 +251,7 @@ open class URLSessionRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -270,7 +270,7 @@ open class URLSessionRequestBuilder: RequestBuilder { filename = contentItem return filename? - .replacingCharacters(in: range, with: "") + .replacingCharacters(in: range, with:"") .replacingOccurrences(of: "\"", with: "") .trimmingCharacters(in: .whitespacesAndNewlines) } @@ -279,7 +279,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url: URL) throws -> String { + fileprivate func getPath(from url : URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -293,7 +293,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -304,7 +304,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } -open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { +open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, Error>) -> Void) { if let error = error { @@ -324,28 +324,28 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + case is Data.Type: - + completion(.success(Response(response: httpResponse, body: data as? T))) - + default: - + guard let data = data, !data.isEmpty else { completion(.failure(ErrorResponse.error(httpResponse.statusCode, nil, DecodableRequestBuilderError.emptyDataResponse))) return } - + let decodeResult = CodableHelper.decode(T.self, from: data) - + switch decodeResult { case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) @@ -356,10 +356,10 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui } } -private class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { - +fileprivate class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { + var credential: URLCredential? - + var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { @@ -402,13 +402,13 @@ public protocol ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest } -private class URLEncoding: ParameterEncoding { - func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { - +fileprivate class URLEncoding: ParameterEncoding { + func encode(_ urlRequest: URLRequest, with parameters: [String : Any]?) throws -> URLRequest { + var urlRequest = urlRequest - + guard let parameters = parameters else { return urlRequest } - + guard let url = urlRequest.url else { throw DownloadException.requestMissingURL } @@ -417,12 +417,12 @@ private class URLEncoding: ParameterEncoding { urlComponents.queryItems = APIHelper.mapValuesToQueryItems(parameters) urlRequest.url = urlComponents.url } - + return urlRequest } } -private class FileUploadEncoding: ParameterEncoding { +fileprivate class FileUploadEncoding: ParameterEncoding { let contentTypeForFormPart: (_ fileURL: URL) -> String? @@ -433,13 +433,13 @@ private class FileUploadEncoding: ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { var urlRequest = urlRequest - + guard let parameters = parameters, !parameters.isEmpty else { return urlRequest } - + let boundary = "Boundary-\(UUID().uuidString)" - + urlRequest.setValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type") for (key, value) in parameters { @@ -479,7 +479,7 @@ private class FileUploadEncoding: ParameterEncoding { fatalError("Unprocessable value \(value) with key \(key)") } } - + var body = urlRequest.httpBody.orEmpty body.append("\r\n--\(boundary)--\r\n") @@ -494,7 +494,7 @@ private class FileUploadEncoding: ParameterEncoding { var urlRequest = urlRequest var body = urlRequest.httpBody.orEmpty - + let fileData = try Data(contentsOf: fileURL) let mimetype = self.contentTypeForFormPart(fileURL) ?? mimeType(for: fileURL) @@ -502,7 +502,7 @@ private class FileUploadEncoding: ParameterEncoding { let fileName = fileURL.lastPathComponent // If we already added something then we need an additional newline. - if body.count > 0 { + if (body.count > 0) { body.append("\r\n") } @@ -518,20 +518,20 @@ private class FileUploadEncoding: ParameterEncoding { // The value data. body.append(fileData) - + urlRequest.httpBody = body return urlRequest } - + private func configureDataUploadRequest(urlRequest: URLRequest, boundary: String, name: String, data: Data) -> URLRequest { var urlRequest = urlRequest - + var body = urlRequest.httpBody.orEmpty // If we already added something then we need an additional newline. - if body.count > 0 { + if (body.count > 0) { body.append("\r\n") } diff --git a/samples/client/petstore/swift5/resultLibrary/Package.swift b/samples/client/petstore/swift5/resultLibrary/Package.swift index 96dfff54edf4..79f6f8188738 100644 --- a/samples/client/petstore/swift5/resultLibrary/Package.swift +++ b/samples/client/petstore/swift5/resultLibrary/Package.swift @@ -14,7 +14,7 @@ let package = Package( // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "PetstoreClient", - targets: ["PetstoreClient"]) + targets: ["PetstoreClient"]), ], dependencies: [ // Dependencies declare other packages that this package depends on. @@ -26,6 +26,6 @@ let package = Package( name: "PetstoreClient", dependencies: [], path: "PetstoreClient/Classes" - ) + ), ] ) diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 5b09f9557113..2404bc8ffc6d 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { + public static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { let destination = source.reduce(into: [String: Any]()) { (result, item) in if let value = item.value { result[item.key] = value @@ -20,17 +20,17 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { + public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? [Any?] { - result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") + if let collection = item.value as? Array { + result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { + public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { guard let source = source else { return nil } @@ -46,15 +46,15 @@ public struct APIHelper { } public static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? [Any?] { + if let collection = source as? Array { return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") } return source } - public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { + public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? [Any?] { + if let collection = item.value as? Array { collection.filter({ $0 != nil }).map({"\($0!)"}).forEach { value in result.append(URLQueryItem(name: item.key, value: value)) } @@ -69,3 +69,4 @@ public struct APIHelper { return destination } } + diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift index a5c2d605dff6..c5d1b9b42df3 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,15 +9,15 @@ import Foundation open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var credential: URLCredential? - public static var customHeaders: [String: String] = [:] + public static var customHeaders: [String:String] = [:] public static var requestBuilderFactory: RequestBuilderFactory = URLSessionRequestBuilderFactory() public static var apiResponseQueue: DispatchQueue = .main } open class RequestBuilder { var credential: URLCredential? - var headers: [String: String] - public let parameters: [String: Any]? + var headers: [String:String] + public let parameters: [String:Any]? public let isBody: Bool public let method: String public let URLString: String @@ -25,9 +25,9 @@ open class RequestBuilder { /// Optional block to obtain a reference to the request's progress instance when available. /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. /// If you need to get the request's progress in older OS versions, please use Alamofire http client. - public var onProgressReady: ((Progress) -> Void)? + public var onProgressReady: ((Progress) -> ())? - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -37,7 +37,7 @@ open class RequestBuilder { addHeaders(PetstoreClientAPI.customHeaders) } - open func addHeaders(_ aHeaders: [String: String]) { + open func addHeaders(_ aHeaders:[String:String]) { for (header, value) in aHeaders { headers[header] = value } @@ -60,5 +60,5 @@ open class RequestBuilder { public protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 001f71608114..a2e5a2ab250c 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class AnotherFakeAPI { /** To test special tags diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 1289d6e2a94a..e891da3f12e8 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class FakeAPI { /** @@ -316,7 +318,7 @@ open class FakeAPI { open class func testEndpointParametersWithRequestBuilder(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "integer": integer?.encodeToJSON(), "int32": int32?.encodeToJSON(), "int64": int64?.encodeToJSON(), @@ -335,7 +337,7 @@ open class FakeAPI { let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -452,19 +454,19 @@ open class FakeAPI { open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "enum_form_string_array": enumFormStringArray?.encodeToJSON(), "enum_form_string": enumFormString?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), - "enum_query_string": enumQueryString?.encodeToJSON(), - "enum_query_integer": enumQueryInteger?.encodeToJSON(), + "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), + "enum_query_string": enumQueryString?.encodeToJSON(), + "enum_query_integer": enumQueryInteger?.encodeToJSON(), "enum_query_double": enumQueryDouble?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -516,13 +518,13 @@ open class FakeAPI { open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), "int64_group": int64Group?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -543,7 +545,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the result */ - open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) { + open class func testInlineAdditionalProperties(param: [String:String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) { testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -560,7 +562,7 @@ open class FakeAPI { - parameter param: (body) request body - returns: RequestBuilder */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { let path = "/fake/inline-additionalProperties" let URLString = PetstoreClientAPI.basePath + path let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) @@ -601,14 +603,14 @@ open class FakeAPI { open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { let path = "/fake/jsonFormData" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "param": param.encodeToJSON(), "param2": param2.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index f54d6e7fcf02..84cf6f9a09e6 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -7,6 +7,8 @@ import Foundation + + open class FakeClassnameTags123API { /** To test class name in snake case diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 92893a31295c..f35144f8e57b 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class PetAPI { /** Add a new pet to the store @@ -82,8 +84,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let nillableHeaders: [String: Any?] = [ "api_key": apiKey?.encodeToJSON() @@ -135,8 +137,8 @@ open class PetAPI { open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "status": status.encodeToJSON() @@ -180,8 +182,8 @@ open class PetAPI { open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "tags": tags.encodeToJSON() @@ -226,8 +228,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -311,14 +313,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "name": name?.encodeToJSON(), "status": status?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -363,14 +365,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "file": file?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -415,14 +417,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "requiredFile": requiredFile.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 5024c9dc8f63..3990c38d237f 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class StoreAPI { /** Delete purchase order by ID @@ -39,8 +41,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -54,7 +56,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the result */ - open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result<[String: Int], Error>) -> Void)) { + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result<[String:Int], Error>) -> Void)) { getInventoryWithRequestBuilder().execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -74,14 +76,14 @@ open class StoreAPI { - name: api_key - returns: RequestBuilder<[String:Int]> */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { + open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } @@ -117,8 +119,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index c96c572b50c0..ee4c7a5f35f2 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class UserAPI { /** Create user @@ -148,8 +150,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -187,8 +189,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -226,11 +228,11 @@ open class UserAPI { open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username.encodeToJSON(), + "username": username.encodeToJSON(), "password": password.encodeToJSON() ]) @@ -264,8 +266,8 @@ open class UserAPI { open class func logoutUserWithRequestBuilder() -> RequestBuilder { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index ef971ebadc60..01b28a4bd42d 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -45,4 +45,4 @@ open class CodableHelper { open class func encode(_ value: T) -> Swift.Result where T: Encodable { return Swift.Result { try self.jsonEncoder.encode(value) } } -} +} \ No newline at end of file diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift index 627d9adb757e..f171525e4394 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -7,10 +7,10 @@ import Foundation open class Configuration { - + // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} + +} \ No newline at end of file diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 93ed6b90b376..6e279679c67a 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -108,24 +108,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { if let values = values { try encodeArray(values, forKey: key) } } - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -135,7 +135,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -147,8 +147,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { - var tmpArray: [T]? + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { + var tmpArray: [T]? = nil if contains(key) { tmpArray = try decodeArray(T.self, forKey: key) @@ -157,8 +157,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { + var map: [Self.Key : T] = [:] for key in allKeys { if !excludedKeys.contains(key) { @@ -177,3 +177,5 @@ extension HTTPURLResponse { return Array(200 ..< 300).contains(statusCode) } } + + diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift index b79e9f5e64d5..08f1ef334dff 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift @@ -41,7 +41,7 @@ public struct JSONDataEncoding { } public static func encodingParameters(jsonData: Data?) -> [String: Any]? { - var returnedParams: [String: Any]? + var returnedParams: [String: Any]? = nil if let jsonData = jsonData, !jsonData.isEmpty { var params: [String: Any] = [:] params[jsonDataKey] = jsonData diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 02f78ffb4705..314f1eff1f9b 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -9,8 +9,8 @@ import Foundation open class JSONEncodingHelper { - open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { - var params: [String: Any]? + open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { + var params: [String: Any]? = nil // Encode the Encodable object if let encodableObj = encodableObj { @@ -27,7 +27,7 @@ open class JSONEncodingHelper { } open class func encodingParameters(forEncodableObject encodableObj: Any?) -> [String: Any]? { - var params: [String: Any]? + var params: [String: Any]? = nil if let encodableObj = encodableObj { do { @@ -41,5 +41,5 @@ open class JSONEncodingHelper { return params } - + } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift index c0542c14c081..11e81ffcc472 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,11 +10,11 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -public enum ErrorResponse: Error { +public enum ErrorResponse : Error { case error(Int, Data?, Error) } -public enum DownloadException: Error { +public enum DownloadException : Error { case responseDataMissing case responseFailed case requestMissing @@ -30,6 +30,7 @@ public enum DecodableRequestBuilderError: Error { case generalError(Error) } + open class Response { public let statusCode: Int public let header: [String: String] @@ -43,7 +44,7 @@ open class Response { public convenience init(response: HTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String: String]() + var header = [String:String]() for (key, value) in rawHeader { if let key = key.base as? String, let value = value as? String { header[key] = value diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 1af031535967..28ca8377b889 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -7,17 +7,19 @@ import Foundation -public struct AdditionalPropertiesClass: Codable { - public var mapString: [String: String]? - public var mapMapString: [String: [String: String]]? +public struct AdditionalPropertiesClass: Codable { - public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { + + public var mapString: [String:String]? + public var mapMapString: [String:[String:String]]? + + public init(mapString: [String:String]?, mapMapString: [String:[String:String]]?) { self.mapString = mapString self.mapMapString = mapMapString } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapString = "map_string" case mapMapString = "map_map_string" } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 5ed9f31e2a36..1050d79dbe9d 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -7,7 +7,9 @@ import Foundation -public struct Animal: Codable { + +public struct Animal: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift index e09b0e9efdc8..e7bea63f8ed2 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -7,4 +7,5 @@ import Foundation + public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index ec270da89074..4d0393b9ba45 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -7,7 +7,9 @@ import Foundation -public struct ApiResponse: Codable { + +public struct ApiResponse: Codable { + public var code: Int? public var type: String? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 6c252ed475b2..1363c96394ba 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayOfArrayOfNumberOnly: Codable { + +public struct ArrayOfArrayOfNumberOnly: Codable { + public var arrayArrayNumber: [[Double]]? @@ -15,7 +17,7 @@ public struct ArrayOfArrayOfNumberOnly: Codable { self.arrayArrayNumber = arrayArrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayArrayNumber = "ArrayArrayNumber" } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index e84eb5d65025..6b8873730c43 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayOfNumberOnly: Codable { + +public struct ArrayOfNumberOnly: Codable { + public var arrayNumber: [Double]? @@ -15,7 +17,7 @@ public struct ArrayOfNumberOnly: Codable { self.arrayNumber = arrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayNumber = "ArrayNumber" } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index d2140933d181..64f7c6d9db99 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayTest: Codable { + +public struct ArrayTest: Codable { + public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? @@ -19,7 +21,7 @@ public struct ArrayTest: Codable { self.arrayArrayOfModel = arrayArrayOfModel } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" case arrayArrayOfModel = "array_array_of_model" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index d1b3b27616ed..ddb669a59045 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -7,7 +7,9 @@ import Foundation -public struct Capitalization: Codable { + +public struct Capitalization: Codable { + public var smallCamel: String? public var capitalCamel: String? @@ -26,7 +28,7 @@ public struct Capitalization: Codable { self.ATT_NAME = ATT_NAME } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case smallCamel case capitalCamel = "CapitalCamel" case smallSnake = "small_Snake" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 7ab887f3113f..c4f6e0d488ca 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -7,7 +7,9 @@ import Foundation -public struct Cat: Codable { + +public struct Cat: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index a51ad0dffab1..7b1d7e32be80 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -7,7 +7,9 @@ import Foundation -public struct CatAllOf: Codable { + +public struct CatAllOf: Codable { + public var declawed: Bool? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index eb8f7e5e1974..3ec00f5ab10d 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,7 +7,9 @@ import Foundation -public struct Category: Codable { + +public struct Category: Codable { + public var id: Int64? public var name: String = "default-name" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index e2a7d4427a06..af030c3dd626 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model with \"_class\" property */ -public struct ClassModel: Codable { +public struct ClassModel: Codable { + public var _class: String? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 00245ca37280..0aae748c76b4 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -7,7 +7,9 @@ import Foundation -public struct Client: Codable { + +public struct Client: Codable { + public var client: String? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 492c1228008e..198e28b94dd6 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -7,7 +7,9 @@ import Foundation -public struct Dog: Codable { + +public struct Dog: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 7786f8acc5ae..8ff49b2af23f 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -7,7 +7,9 @@ import Foundation -public struct DogAllOf: Codable { + +public struct DogAllOf: Codable { + public var breed: String? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 9844e7c40e35..e2d3fa04f94b 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -7,7 +7,9 @@ import Foundation -public struct EnumArrays: Codable { + +public struct EnumArrays: Codable { + public enum JustSymbol: String, Codable, CaseIterable { case greaterThanOrEqualTo = ">=" @@ -25,7 +27,7 @@ public struct EnumArrays: Codable { self.arrayEnum = arrayEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justSymbol = "just_symbol" case arrayEnum = "array_enum" } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index d4029d73f8af..c2c639ba3246 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -7,6 +7,7 @@ import Foundation + public enum EnumClass: String, Codable, CaseIterable { case abc = "_abc" case efg = "-efg" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 789f583e1d77..a56e1f36389b 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct EnumTest: Codable { + +public struct EnumTest: Codable { + public enum EnumString: String, Codable, CaseIterable { case upper = "UPPER" @@ -41,7 +43,7 @@ public struct EnumTest: Codable { self.outerEnum = outerEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case enumString = "enum_string" case enumStringRequired = "enum_string_required" case enumInteger = "enum_integer" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift index abf3ccffc485..773b53b2cb76 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -8,7 +8,8 @@ import Foundation /** Must be named `File` for test. */ -public struct File: Codable { +public struct File: Codable { + /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 532f1457939a..83dc1148cfa3 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -7,7 +7,9 @@ import Foundation -public struct FileSchemaTestClass: Codable { + +public struct FileSchemaTestClass: Codable { + public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index 20bd6d103b3d..bccd3f9fb178 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct FormatTest: Codable { + +public struct FormatTest: Codable { + public var integer: Int? public var int32: Int? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 906ddb06fb17..566d71a35ef0 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct HasOnlyReadOnly: Codable { + +public struct HasOnlyReadOnly: Codable { + public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift index fe13d302ccbf..80cecab242f2 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -7,7 +7,9 @@ import Foundation -public struct List: Codable { + +public struct List: Codable { + public var _123list: String? @@ -15,7 +17,7 @@ public struct List: Codable { self._123list = _123list } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _123list = "123-list" } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 4b6037f378ee..f0c02de95f7a 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -7,25 +7,27 @@ import Foundation -public struct MapTest: Codable { + +public struct MapTest: Codable { + public enum MapOfEnumString: String, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" } - public var mapMapOfString: [String: [String: String]]? - public var mapOfEnumString: [String: String]? - public var directMap: [String: Bool]? + public var mapMapOfString: [String:[String:String]]? + public var mapOfEnumString: [String:String]? + public var directMap: [String:Bool]? public var indirectMap: StringBooleanMap? - public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { + public init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?, directMap: [String:Bool]?, indirectMap: StringBooleanMap?) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap self.indirectMap = indirectMap } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" case directMap = "direct_map" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c3deb2f28932..710e62a9b587 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,13 +7,15 @@ import Foundation -public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { + +public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { + public var uuid: UUID? public var dateTime: Date? - public var map: [String: Animal]? + public var map: [String:Animal]? - public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { + public init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { self.uuid = uuid self.dateTime = dateTime self.map = map diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index b61db7d6e716..450a53b918ca 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model name starting with number */ -public struct Model200Response: Codable { +public struct Model200Response: Codable { + public var name: Int? public var _class: String? @@ -18,7 +19,7 @@ public struct Model200Response: Codable { self._class = _class } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case _class = "class" } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 8ab4db44b73a..6deb69fcd731 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model name same as property name */ -public struct Name: Codable { +public struct Name: Codable { + public var name: Int public var snakeCase: Int? @@ -22,7 +23,7 @@ public struct Name: Codable { self._123number = _123number } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case snakeCase = "snake_case" case property diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 4d1dafcc2c1f..0c9ee2b7b9f4 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct NumberOnly: Codable { + +public struct NumberOnly: Codable { + public var justNumber: Double? @@ -15,7 +17,7 @@ public struct NumberOnly: Codable { self.justNumber = justNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justNumber = "JustNumber" } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 40c30cc8609c..ab0eac0b304e 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,7 +7,9 @@ import Foundation -public struct Order: Codable { + +public struct Order: Codable { + public enum Status: String, Codable, CaseIterable { case placed = "placed" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 18c3a024f122..4a7d22710441 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -7,7 +7,9 @@ import Foundation -public struct OuterComposite: Codable { + +public struct OuterComposite: Codable { + public var myNumber: Double? public var myString: String? @@ -19,7 +21,7 @@ public struct OuterComposite: Codable { self.myBoolean = myBoolean } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case myNumber = "my_number" case myString = "my_string" case myBoolean = "my_boolean" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index c3b778cbbed4..9e6b8d74e874 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -7,6 +7,7 @@ import Foundation + public enum OuterEnum: String, Codable, CaseIterable { case placed = "placed" case approved = "approved" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index b9ce0e933256..a973071d6c96 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,7 +7,9 @@ import Foundation -public struct Pet: Codable { + +public struct Pet: Codable { + public enum Status: String, Codable, CaseIterable { case available = "available" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 0acd21fd1000..b2a6b7e2b8a6 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -7,7 +7,9 @@ import Foundation -public struct ReadOnlyFirst: Codable { + +public struct ReadOnlyFirst: Codable { + public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index c223f993a69e..7e089dcee2b4 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing reserved words */ -public struct Return: Codable { +public struct Return: Codable { + public var _return: Int? @@ -16,7 +17,7 @@ public struct Return: Codable { self._return = _return } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _return = "return" } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index 6e8650f76d8e..e890ef952520 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -7,7 +7,9 @@ import Foundation -public struct SpecialModelName: Codable { + +public struct SpecialModelName: Codable { + public var specialPropertyName: Int64? @@ -15,7 +17,7 @@ public struct SpecialModelName: Codable { self.specialPropertyName = specialPropertyName } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case specialPropertyName = "$special[property.name]" } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index 3f1237fee477..f65ae0623d6e 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -7,9 +7,12 @@ import Foundation -public struct StringBooleanMap: Codable { - public var additionalProperties: [String: Bool] = [:] +public struct StringBooleanMap: Codable { + + + + public var additionalProperties: [String:Bool] = [:] public subscript(key: String) -> Bool? { get { @@ -42,4 +45,5 @@ public struct StringBooleanMap: Codable { additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } + } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 4dd8a9a9f5a0..a91b6061bcf7 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,7 +7,9 @@ import Foundation -public struct Tag: Codable { + +public struct Tag: Codable { + public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index a9e088808ed3..2d377c3edb02 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -7,7 +7,9 @@ import Foundation -public struct TypeHolderDefault: Codable { + +public struct TypeHolderDefault: Codable { + public var stringItem: String = "what" public var numberItem: Double @@ -23,7 +25,7 @@ public struct TypeHolderDefault: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index dff4083ae432..e5eb92da696e 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -7,7 +7,9 @@ import Foundation -public struct TypeHolderExample: Codable { + +public struct TypeHolderExample: Codable { + public var stringItem: String public var numberItem: Double @@ -23,7 +25,7 @@ public struct TypeHolderExample: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 79f271ed7356..f70328ca9e59 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,7 +7,9 @@ import Foundation -public struct User: Codable { + +public struct User: Codable { + public var id: Int64? public var username: String? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index 55d0eb421919..22261e2ce948 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -14,7 +14,7 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { return URLSessionRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return URLSessionDecodableRequestBuilder.self } } @@ -23,16 +23,16 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { private var urlSessionStore = SynchronizedDictionary() open class URLSessionRequestBuilder: RequestBuilder { - + private var observation: NSKeyValueObservation? - + deinit { observation?.invalidate() } - + // swiftlint:disable:next weak_delegate fileprivate let sessionDelegate = SessionDelegate() - + /** May be assigned if you want to control the authentication challenges. */ @@ -45,11 +45,11 @@ open class URLSessionRequestBuilder: RequestBuilder { - retry the request. */ public var taskCompletionShouldRetry: ((Data?, URLResponse?, Error?, @escaping (Bool) -> Void) -> Void)? - - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + + required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } - + /** May be overridden by a subclass if you want to control the URLSession configuration. @@ -77,40 +77,40 @@ open class URLSessionRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the URLRequest configuration (e.g. to override the cache policy). */ - open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) throws -> URLRequest { - + open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) throws -> URLRequest { + guard let url = URL(string: URLString) else { throw DownloadException.requestMissingURL } - + var originalRequest = URLRequest(url: url) - + originalRequest.httpMethod = method.rawValue - + buildHeaders().forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + headers.forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + let modifiedRequest = try encoding.encode(originalRequest, with: parameters) - + return modifiedRequest } override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, Error>) -> Void) { - let urlSessionId: String = UUID().uuidString + let urlSessionId:String = UUID().uuidString // Create a new manager for each request to customize its request header let urlSession = createURLSession() urlSessionStore[urlSessionId] = urlSession - + let parameters: [String: Any] = self.parameters ?? [:] - + let fileKeys = parameters.filter { $1 is URL } .map { $0.0 } - + let encoding: ParameterEncoding if fileKeys.count > 0 { encoding = FileUploadEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) @@ -119,29 +119,29 @@ open class URLSessionRequestBuilder: RequestBuilder { } else { encoding = URLEncoding() } - + guard let xMethod = HTTPMethod(rawValue: method) else { fatalError("Unsuported Http method - \(method)") } - + let cleanupRequest = { urlSessionStore[urlSessionId] = nil self.observation?.invalidate() } - + do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) - + let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in - + guard let self = self else { return } - + if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - + taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in - + guard let self = self else { return } - + if shouldRetry { cleanupRequest() self.execute(apiResponseQueue, completion) @@ -157,13 +157,13 @@ open class URLSessionRequestBuilder: RequestBuilder { } } } - + if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { onProgressReady?(dataTask.progress) } - + dataTask.resume() - + } catch { apiResponseQueue.async { cleanupRequest() @@ -172,7 +172,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - + fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, Error>) -> Void) { if let error = error { @@ -192,52 +192,52 @@ open class URLSessionRequestBuilder: RequestBuilder { switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is URL.Type: do { - + guard error == nil else { throw DownloadException.responseFailed } - + guard let data = data else { throw DownloadException.responseDataMissing } - + let fileManager = FileManager.default let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] let requestURL = try self.getURL(from: urlRequest) - + var requestPath = try self.getPath(from: requestURL) - + if let headerFileName = self.getFileName(fromContentDisposition: httpResponse.allHeaderFields["Content-Disposition"] as? String) { requestPath = requestPath.appending("/\(headerFileName)") } - + let filePath = documentsDirectory.appendingPathComponent(requestPath) let directoryPath = filePath.deletingLastPathComponent().path - + try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) try data.write(to: filePath, options: .atomic) - + completion(.success(Response(response: httpResponse, body: filePath as? T))) - + } catch let requestParserError as DownloadException { completion(.failure(ErrorResponse.error(400, data, requestParserError))) } catch let error { completion(.failure(ErrorResponse.error(400, data, error))) } - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + default: - + completion(.success(Response(response: httpResponse, body: data as? T))) } @@ -251,7 +251,7 @@ open class URLSessionRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -270,7 +270,7 @@ open class URLSessionRequestBuilder: RequestBuilder { filename = contentItem return filename? - .replacingCharacters(in: range, with: "") + .replacingCharacters(in: range, with:"") .replacingOccurrences(of: "\"", with: "") .trimmingCharacters(in: .whitespacesAndNewlines) } @@ -279,7 +279,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url: URL) throws -> String { + fileprivate func getPath(from url : URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -293,7 +293,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -304,7 +304,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } -open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { +open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, Error>) -> Void) { if let error = error { @@ -324,28 +324,28 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + case is Data.Type: - + completion(.success(Response(response: httpResponse, body: data as? T))) - + default: - + guard let data = data, !data.isEmpty else { completion(.failure(ErrorResponse.error(httpResponse.statusCode, nil, DecodableRequestBuilderError.emptyDataResponse))) return } - + let decodeResult = CodableHelper.decode(T.self, from: data) - + switch decodeResult { case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) @@ -356,10 +356,10 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui } } -private class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { - +fileprivate class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { + var credential: URLCredential? - + var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { @@ -402,13 +402,13 @@ public protocol ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest } -private class URLEncoding: ParameterEncoding { - func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { - +fileprivate class URLEncoding: ParameterEncoding { + func encode(_ urlRequest: URLRequest, with parameters: [String : Any]?) throws -> URLRequest { + var urlRequest = urlRequest - + guard let parameters = parameters else { return urlRequest } - + guard let url = urlRequest.url else { throw DownloadException.requestMissingURL } @@ -417,12 +417,12 @@ private class URLEncoding: ParameterEncoding { urlComponents.queryItems = APIHelper.mapValuesToQueryItems(parameters) urlRequest.url = urlComponents.url } - + return urlRequest } } -private class FileUploadEncoding: ParameterEncoding { +fileprivate class FileUploadEncoding: ParameterEncoding { let contentTypeForFormPart: (_ fileURL: URL) -> String? @@ -433,13 +433,13 @@ private class FileUploadEncoding: ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { var urlRequest = urlRequest - + guard let parameters = parameters, !parameters.isEmpty else { return urlRequest } - + let boundary = "Boundary-\(UUID().uuidString)" - + urlRequest.setValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type") for (key, value) in parameters { @@ -479,7 +479,7 @@ private class FileUploadEncoding: ParameterEncoding { fatalError("Unprocessable value \(value) with key \(key)") } } - + var body = urlRequest.httpBody.orEmpty body.append("\r\n--\(boundary)--\r\n") @@ -494,7 +494,7 @@ private class FileUploadEncoding: ParameterEncoding { var urlRequest = urlRequest var body = urlRequest.httpBody.orEmpty - + let fileData = try Data(contentsOf: fileURL) let mimetype = self.contentTypeForFormPart(fileURL) ?? mimeType(for: fileURL) @@ -502,7 +502,7 @@ private class FileUploadEncoding: ParameterEncoding { let fileName = fileURL.lastPathComponent // If we already added something then we need an additional newline. - if body.count > 0 { + if (body.count > 0) { body.append("\r\n") } @@ -518,20 +518,20 @@ private class FileUploadEncoding: ParameterEncoding { // The value data. body.append(fileData) - + urlRequest.httpBody = body return urlRequest } - + private func configureDataUploadRequest(urlRequest: URLRequest, boundary: String, name: String, data: Data) -> URLRequest { var urlRequest = urlRequest - + var body = urlRequest.httpBody.orEmpty // If we already added something then we need an additional newline. - if body.count > 0 { + if (body.count > 0) { body.append("\r\n") } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/Package.swift b/samples/client/petstore/swift5/rxswiftLibrary/Package.swift index 24f9a6c99ae5..4b20458197f3 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/Package.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/Package.swift @@ -14,11 +14,11 @@ let package = Package( // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "PetstoreClient", - targets: ["PetstoreClient"]) + targets: ["PetstoreClient"]), ], dependencies: [ // Dependencies declare other packages that this package depends on. - .package(url: "https://github.com/ReactiveX/RxSwift.git", from: "5.0.0") + .package(url: "https://github.com/ReactiveX/RxSwift.git", from: "5.0.0"), ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. @@ -27,6 +27,6 @@ let package = Package( name: "PetstoreClient", dependencies: ["RxSwift"], path: "PetstoreClient/Classes" - ) + ), ] ) diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 5b09f9557113..2404bc8ffc6d 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { + public static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { let destination = source.reduce(into: [String: Any]()) { (result, item) in if let value = item.value { result[item.key] = value @@ -20,17 +20,17 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { + public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? [Any?] { - result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") + if let collection = item.value as? Array { + result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { + public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { guard let source = source else { return nil } @@ -46,15 +46,15 @@ public struct APIHelper { } public static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? [Any?] { + if let collection = source as? Array { return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") } return source } - public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { + public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? [Any?] { + if let collection = item.value as? Array { collection.filter({ $0 != nil }).map({"\($0!)"}).forEach { value in result.append(URLQueryItem(name: item.key, value: value)) } @@ -69,3 +69,4 @@ public struct APIHelper { return destination } } + diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift index a5c2d605dff6..c5d1b9b42df3 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,15 +9,15 @@ import Foundation open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var credential: URLCredential? - public static var customHeaders: [String: String] = [:] + public static var customHeaders: [String:String] = [:] public static var requestBuilderFactory: RequestBuilderFactory = URLSessionRequestBuilderFactory() public static var apiResponseQueue: DispatchQueue = .main } open class RequestBuilder { var credential: URLCredential? - var headers: [String: String] - public let parameters: [String: Any]? + var headers: [String:String] + public let parameters: [String:Any]? public let isBody: Bool public let method: String public let URLString: String @@ -25,9 +25,9 @@ open class RequestBuilder { /// Optional block to obtain a reference to the request's progress instance when available. /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. /// If you need to get the request's progress in older OS versions, please use Alamofire http client. - public var onProgressReady: ((Progress) -> Void)? + public var onProgressReady: ((Progress) -> ())? - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -37,7 +37,7 @@ open class RequestBuilder { addHeaders(PetstoreClientAPI.customHeaders) } - open func addHeaders(_ aHeaders: [String: String]) { + open func addHeaders(_ aHeaders:[String:String]) { for (header, value) in aHeaders { headers[header] = value } @@ -60,5 +60,5 @@ open class RequestBuilder { public protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 792371b38421..4090e37b32c9 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -8,6 +8,8 @@ import Foundation import RxSwift + + open class AnotherFakeAPI { /** To test special tags diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 3e9b32438c82..fa3d09834ff0 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -8,6 +8,8 @@ import Foundation import RxSwift + + open class FakeAPI { /** @@ -349,7 +351,7 @@ open class FakeAPI { open class func testEndpointParametersWithRequestBuilder(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "integer": integer?.encodeToJSON(), "int32": int32?.encodeToJSON(), "int64": int64?.encodeToJSON(), @@ -368,7 +370,7 @@ open class FakeAPI { let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -489,19 +491,19 @@ open class FakeAPI { open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "enum_form_string_array": enumFormStringArray?.encodeToJSON(), "enum_form_string": enumFormString?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), - "enum_query_string": enumQueryString?.encodeToJSON(), - "enum_query_integer": enumQueryInteger?.encodeToJSON(), + "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), + "enum_query_string": enumQueryString?.encodeToJSON(), + "enum_query_integer": enumQueryInteger?.encodeToJSON(), "enum_query_double": enumQueryDouble?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -557,13 +559,13 @@ open class FakeAPI { open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), "int64_group": int64Group?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -584,7 +586,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Observable */ - open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { + open class func testInlineAdditionalProperties(param: [String:String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result -> Void in switch result { @@ -605,7 +607,7 @@ open class FakeAPI { - parameter param: (body) request body - returns: RequestBuilder */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { let path = "/fake/inline-additionalProperties" let URLString = PetstoreClientAPI.basePath + path let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) @@ -650,14 +652,14 @@ open class FakeAPI { open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { let path = "/fake/jsonFormData" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "param": param.encodeToJSON(), "param2": param2.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 989a914f3795..1353f91b278f 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -8,6 +8,8 @@ import Foundation import RxSwift + + open class FakeClassnameTags123API { /** To test class name in snake case diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index b3a26902360e..41cb591c8955 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -8,6 +8,8 @@ import Foundation import RxSwift + + open class PetAPI { /** Add a new pet to the store @@ -91,8 +93,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let nillableHeaders: [String: Any?] = [ "api_key": apiKey?.encodeToJSON() @@ -148,8 +150,8 @@ open class PetAPI { open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "status": status.encodeToJSON() @@ -197,8 +199,8 @@ open class PetAPI { open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "tags": tags.encodeToJSON() @@ -247,8 +249,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -340,14 +342,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "name": name?.encodeToJSON(), "status": status?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -396,14 +398,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "file": file?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -452,14 +454,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "requiredFile": requiredFile.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index dea3933433cf..f5c974ba3824 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -8,6 +8,8 @@ import Foundation import RxSwift + + open class StoreAPI { /** Delete purchase order by ID @@ -44,8 +46,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -59,7 +61,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Observable<[String:Int]> */ - open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable<[String: Int]> { + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable<[String:Int]> { return Observable.create { observer -> Disposable in getInventoryWithRequestBuilder().execute(apiResponseQueue) { result -> Void in switch result { @@ -83,14 +85,14 @@ open class StoreAPI { - name: api_key - returns: RequestBuilder<[String:Int]> */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { + open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } @@ -130,8 +132,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 3447ea28c0ed..2228363cfccd 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -8,6 +8,8 @@ import Foundation import RxSwift + + open class UserAPI { /** Create user @@ -165,8 +167,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -208,8 +210,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -251,11 +253,11 @@ open class UserAPI { open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username.encodeToJSON(), + "username": username.encodeToJSON(), "password": password.encodeToJSON() ]) @@ -293,8 +295,8 @@ open class UserAPI { open class func logoutUserWithRequestBuilder() -> RequestBuilder { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index ef971ebadc60..01b28a4bd42d 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -45,4 +45,4 @@ open class CodableHelper { open class func encode(_ value: T) -> Swift.Result where T: Encodable { return Swift.Result { try self.jsonEncoder.encode(value) } } -} +} \ No newline at end of file diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift index 627d9adb757e..f171525e4394 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -7,10 +7,10 @@ import Foundation open class Configuration { - + // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} + +} \ No newline at end of file diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 93ed6b90b376..6e279679c67a 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -108,24 +108,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { if let values = values { try encodeArray(values, forKey: key) } } - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -135,7 +135,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -147,8 +147,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { - var tmpArray: [T]? + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { + var tmpArray: [T]? = nil if contains(key) { tmpArray = try decodeArray(T.self, forKey: key) @@ -157,8 +157,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { + var map: [Self.Key : T] = [:] for key in allKeys { if !excludedKeys.contains(key) { @@ -177,3 +177,5 @@ extension HTTPURLResponse { return Array(200 ..< 300).contains(statusCode) } } + + diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift index b79e9f5e64d5..08f1ef334dff 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift @@ -41,7 +41,7 @@ public struct JSONDataEncoding { } public static func encodingParameters(jsonData: Data?) -> [String: Any]? { - var returnedParams: [String: Any]? + var returnedParams: [String: Any]? = nil if let jsonData = jsonData, !jsonData.isEmpty { var params: [String: Any] = [:] params[jsonDataKey] = jsonData diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 02f78ffb4705..314f1eff1f9b 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -9,8 +9,8 @@ import Foundation open class JSONEncodingHelper { - open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { - var params: [String: Any]? + open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { + var params: [String: Any]? = nil // Encode the Encodable object if let encodableObj = encodableObj { @@ -27,7 +27,7 @@ open class JSONEncodingHelper { } open class func encodingParameters(forEncodableObject encodableObj: Any?) -> [String: Any]? { - var params: [String: Any]? + var params: [String: Any]? = nil if let encodableObj = encodableObj { do { @@ -41,5 +41,5 @@ open class JSONEncodingHelper { return params } - + } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift index c0542c14c081..11e81ffcc472 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,11 +10,11 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -public enum ErrorResponse: Error { +public enum ErrorResponse : Error { case error(Int, Data?, Error) } -public enum DownloadException: Error { +public enum DownloadException : Error { case responseDataMissing case responseFailed case requestMissing @@ -30,6 +30,7 @@ public enum DecodableRequestBuilderError: Error { case generalError(Error) } + open class Response { public let statusCode: Int public let header: [String: String] @@ -43,7 +44,7 @@ open class Response { public convenience init(response: HTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String: String]() + var header = [String:String]() for (key, value) in rawHeader { if let key = key.base as? String, let value = value as? String { header[key] = value diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 1af031535967..28ca8377b889 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -7,17 +7,19 @@ import Foundation -public struct AdditionalPropertiesClass: Codable { - public var mapString: [String: String]? - public var mapMapString: [String: [String: String]]? +public struct AdditionalPropertiesClass: Codable { - public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { + + public var mapString: [String:String]? + public var mapMapString: [String:[String:String]]? + + public init(mapString: [String:String]?, mapMapString: [String:[String:String]]?) { self.mapString = mapString self.mapMapString = mapMapString } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapString = "map_string" case mapMapString = "map_map_string" } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 5ed9f31e2a36..1050d79dbe9d 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -7,7 +7,9 @@ import Foundation -public struct Animal: Codable { + +public struct Animal: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift index e09b0e9efdc8..e7bea63f8ed2 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -7,4 +7,5 @@ import Foundation + public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index ec270da89074..4d0393b9ba45 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -7,7 +7,9 @@ import Foundation -public struct ApiResponse: Codable { + +public struct ApiResponse: Codable { + public var code: Int? public var type: String? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 6c252ed475b2..1363c96394ba 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayOfArrayOfNumberOnly: Codable { + +public struct ArrayOfArrayOfNumberOnly: Codable { + public var arrayArrayNumber: [[Double]]? @@ -15,7 +17,7 @@ public struct ArrayOfArrayOfNumberOnly: Codable { self.arrayArrayNumber = arrayArrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayArrayNumber = "ArrayArrayNumber" } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index e84eb5d65025..6b8873730c43 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayOfNumberOnly: Codable { + +public struct ArrayOfNumberOnly: Codable { + public var arrayNumber: [Double]? @@ -15,7 +17,7 @@ public struct ArrayOfNumberOnly: Codable { self.arrayNumber = arrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayNumber = "ArrayNumber" } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index d2140933d181..64f7c6d9db99 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayTest: Codable { + +public struct ArrayTest: Codable { + public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? @@ -19,7 +21,7 @@ public struct ArrayTest: Codable { self.arrayArrayOfModel = arrayArrayOfModel } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" case arrayArrayOfModel = "array_array_of_model" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index d1b3b27616ed..ddb669a59045 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -7,7 +7,9 @@ import Foundation -public struct Capitalization: Codable { + +public struct Capitalization: Codable { + public var smallCamel: String? public var capitalCamel: String? @@ -26,7 +28,7 @@ public struct Capitalization: Codable { self.ATT_NAME = ATT_NAME } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case smallCamel case capitalCamel = "CapitalCamel" case smallSnake = "small_Snake" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 7ab887f3113f..c4f6e0d488ca 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -7,7 +7,9 @@ import Foundation -public struct Cat: Codable { + +public struct Cat: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index a51ad0dffab1..7b1d7e32be80 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -7,7 +7,9 @@ import Foundation -public struct CatAllOf: Codable { + +public struct CatAllOf: Codable { + public var declawed: Bool? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index eb8f7e5e1974..3ec00f5ab10d 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,7 +7,9 @@ import Foundation -public struct Category: Codable { + +public struct Category: Codable { + public var id: Int64? public var name: String = "default-name" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index e2a7d4427a06..af030c3dd626 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model with \"_class\" property */ -public struct ClassModel: Codable { +public struct ClassModel: Codable { + public var _class: String? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 00245ca37280..0aae748c76b4 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -7,7 +7,9 @@ import Foundation -public struct Client: Codable { + +public struct Client: Codable { + public var client: String? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 492c1228008e..198e28b94dd6 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -7,7 +7,9 @@ import Foundation -public struct Dog: Codable { + +public struct Dog: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 7786f8acc5ae..8ff49b2af23f 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -7,7 +7,9 @@ import Foundation -public struct DogAllOf: Codable { + +public struct DogAllOf: Codable { + public var breed: String? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 9844e7c40e35..e2d3fa04f94b 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -7,7 +7,9 @@ import Foundation -public struct EnumArrays: Codable { + +public struct EnumArrays: Codable { + public enum JustSymbol: String, Codable, CaseIterable { case greaterThanOrEqualTo = ">=" @@ -25,7 +27,7 @@ public struct EnumArrays: Codable { self.arrayEnum = arrayEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justSymbol = "just_symbol" case arrayEnum = "array_enum" } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index d4029d73f8af..c2c639ba3246 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -7,6 +7,7 @@ import Foundation + public enum EnumClass: String, Codable, CaseIterable { case abc = "_abc" case efg = "-efg" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 789f583e1d77..a56e1f36389b 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct EnumTest: Codable { + +public struct EnumTest: Codable { + public enum EnumString: String, Codable, CaseIterable { case upper = "UPPER" @@ -41,7 +43,7 @@ public struct EnumTest: Codable { self.outerEnum = outerEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case enumString = "enum_string" case enumStringRequired = "enum_string_required" case enumInteger = "enum_integer" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift index abf3ccffc485..773b53b2cb76 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -8,7 +8,8 @@ import Foundation /** Must be named `File` for test. */ -public struct File: Codable { +public struct File: Codable { + /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 532f1457939a..83dc1148cfa3 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -7,7 +7,9 @@ import Foundation -public struct FileSchemaTestClass: Codable { + +public struct FileSchemaTestClass: Codable { + public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index 20bd6d103b3d..bccd3f9fb178 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct FormatTest: Codable { + +public struct FormatTest: Codable { + public var integer: Int? public var int32: Int? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 906ddb06fb17..566d71a35ef0 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct HasOnlyReadOnly: Codable { + +public struct HasOnlyReadOnly: Codable { + public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift index fe13d302ccbf..80cecab242f2 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -7,7 +7,9 @@ import Foundation -public struct List: Codable { + +public struct List: Codable { + public var _123list: String? @@ -15,7 +17,7 @@ public struct List: Codable { self._123list = _123list } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _123list = "123-list" } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 4b6037f378ee..f0c02de95f7a 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -7,25 +7,27 @@ import Foundation -public struct MapTest: Codable { + +public struct MapTest: Codable { + public enum MapOfEnumString: String, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" } - public var mapMapOfString: [String: [String: String]]? - public var mapOfEnumString: [String: String]? - public var directMap: [String: Bool]? + public var mapMapOfString: [String:[String:String]]? + public var mapOfEnumString: [String:String]? + public var directMap: [String:Bool]? public var indirectMap: StringBooleanMap? - public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { + public init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?, directMap: [String:Bool]?, indirectMap: StringBooleanMap?) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap self.indirectMap = indirectMap } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" case directMap = "direct_map" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c3deb2f28932..710e62a9b587 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,13 +7,15 @@ import Foundation -public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { + +public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { + public var uuid: UUID? public var dateTime: Date? - public var map: [String: Animal]? + public var map: [String:Animal]? - public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { + public init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { self.uuid = uuid self.dateTime = dateTime self.map = map diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index b61db7d6e716..450a53b918ca 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model name starting with number */ -public struct Model200Response: Codable { +public struct Model200Response: Codable { + public var name: Int? public var _class: String? @@ -18,7 +19,7 @@ public struct Model200Response: Codable { self._class = _class } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case _class = "class" } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 8ab4db44b73a..6deb69fcd731 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model name same as property name */ -public struct Name: Codable { +public struct Name: Codable { + public var name: Int public var snakeCase: Int? @@ -22,7 +23,7 @@ public struct Name: Codable { self._123number = _123number } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case snakeCase = "snake_case" case property diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 4d1dafcc2c1f..0c9ee2b7b9f4 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct NumberOnly: Codable { + +public struct NumberOnly: Codable { + public var justNumber: Double? @@ -15,7 +17,7 @@ public struct NumberOnly: Codable { self.justNumber = justNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justNumber = "JustNumber" } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 40c30cc8609c..ab0eac0b304e 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,7 +7,9 @@ import Foundation -public struct Order: Codable { + +public struct Order: Codable { + public enum Status: String, Codable, CaseIterable { case placed = "placed" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 18c3a024f122..4a7d22710441 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -7,7 +7,9 @@ import Foundation -public struct OuterComposite: Codable { + +public struct OuterComposite: Codable { + public var myNumber: Double? public var myString: String? @@ -19,7 +21,7 @@ public struct OuterComposite: Codable { self.myBoolean = myBoolean } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case myNumber = "my_number" case myString = "my_string" case myBoolean = "my_boolean" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index c3b778cbbed4..9e6b8d74e874 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -7,6 +7,7 @@ import Foundation + public enum OuterEnum: String, Codable, CaseIterable { case placed = "placed" case approved = "approved" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index b9ce0e933256..a973071d6c96 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,7 +7,9 @@ import Foundation -public struct Pet: Codable { + +public struct Pet: Codable { + public enum Status: String, Codable, CaseIterable { case available = "available" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 0acd21fd1000..b2a6b7e2b8a6 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -7,7 +7,9 @@ import Foundation -public struct ReadOnlyFirst: Codable { + +public struct ReadOnlyFirst: Codable { + public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index c223f993a69e..7e089dcee2b4 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing reserved words */ -public struct Return: Codable { +public struct Return: Codable { + public var _return: Int? @@ -16,7 +17,7 @@ public struct Return: Codable { self._return = _return } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _return = "return" } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index 6e8650f76d8e..e890ef952520 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -7,7 +7,9 @@ import Foundation -public struct SpecialModelName: Codable { + +public struct SpecialModelName: Codable { + public var specialPropertyName: Int64? @@ -15,7 +17,7 @@ public struct SpecialModelName: Codable { self.specialPropertyName = specialPropertyName } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case specialPropertyName = "$special[property.name]" } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index 3f1237fee477..f65ae0623d6e 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -7,9 +7,12 @@ import Foundation -public struct StringBooleanMap: Codable { - public var additionalProperties: [String: Bool] = [:] +public struct StringBooleanMap: Codable { + + + + public var additionalProperties: [String:Bool] = [:] public subscript(key: String) -> Bool? { get { @@ -42,4 +45,5 @@ public struct StringBooleanMap: Codable { additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } + } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 4dd8a9a9f5a0..a91b6061bcf7 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,7 +7,9 @@ import Foundation -public struct Tag: Codable { + +public struct Tag: Codable { + public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index a9e088808ed3..2d377c3edb02 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -7,7 +7,9 @@ import Foundation -public struct TypeHolderDefault: Codable { + +public struct TypeHolderDefault: Codable { + public var stringItem: String = "what" public var numberItem: Double @@ -23,7 +25,7 @@ public struct TypeHolderDefault: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index dff4083ae432..e5eb92da696e 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -7,7 +7,9 @@ import Foundation -public struct TypeHolderExample: Codable { + +public struct TypeHolderExample: Codable { + public var stringItem: String public var numberItem: Double @@ -23,7 +25,7 @@ public struct TypeHolderExample: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 79f271ed7356..f70328ca9e59 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,7 +7,9 @@ import Foundation -public struct User: Codable { + +public struct User: Codable { + public var id: Int64? public var username: String? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index 55d0eb421919..22261e2ce948 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -14,7 +14,7 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { return URLSessionRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return URLSessionDecodableRequestBuilder.self } } @@ -23,16 +23,16 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { private var urlSessionStore = SynchronizedDictionary() open class URLSessionRequestBuilder: RequestBuilder { - + private var observation: NSKeyValueObservation? - + deinit { observation?.invalidate() } - + // swiftlint:disable:next weak_delegate fileprivate let sessionDelegate = SessionDelegate() - + /** May be assigned if you want to control the authentication challenges. */ @@ -45,11 +45,11 @@ open class URLSessionRequestBuilder: RequestBuilder { - retry the request. */ public var taskCompletionShouldRetry: ((Data?, URLResponse?, Error?, @escaping (Bool) -> Void) -> Void)? - - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + + required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } - + /** May be overridden by a subclass if you want to control the URLSession configuration. @@ -77,40 +77,40 @@ open class URLSessionRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the URLRequest configuration (e.g. to override the cache policy). */ - open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) throws -> URLRequest { - + open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) throws -> URLRequest { + guard let url = URL(string: URLString) else { throw DownloadException.requestMissingURL } - + var originalRequest = URLRequest(url: url) - + originalRequest.httpMethod = method.rawValue - + buildHeaders().forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + headers.forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + let modifiedRequest = try encoding.encode(originalRequest, with: parameters) - + return modifiedRequest } override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, Error>) -> Void) { - let urlSessionId: String = UUID().uuidString + let urlSessionId:String = UUID().uuidString // Create a new manager for each request to customize its request header let urlSession = createURLSession() urlSessionStore[urlSessionId] = urlSession - + let parameters: [String: Any] = self.parameters ?? [:] - + let fileKeys = parameters.filter { $1 is URL } .map { $0.0 } - + let encoding: ParameterEncoding if fileKeys.count > 0 { encoding = FileUploadEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) @@ -119,29 +119,29 @@ open class URLSessionRequestBuilder: RequestBuilder { } else { encoding = URLEncoding() } - + guard let xMethod = HTTPMethod(rawValue: method) else { fatalError("Unsuported Http method - \(method)") } - + let cleanupRequest = { urlSessionStore[urlSessionId] = nil self.observation?.invalidate() } - + do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) - + let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in - + guard let self = self else { return } - + if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - + taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in - + guard let self = self else { return } - + if shouldRetry { cleanupRequest() self.execute(apiResponseQueue, completion) @@ -157,13 +157,13 @@ open class URLSessionRequestBuilder: RequestBuilder { } } } - + if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { onProgressReady?(dataTask.progress) } - + dataTask.resume() - + } catch { apiResponseQueue.async { cleanupRequest() @@ -172,7 +172,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - + fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, Error>) -> Void) { if let error = error { @@ -192,52 +192,52 @@ open class URLSessionRequestBuilder: RequestBuilder { switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is URL.Type: do { - + guard error == nil else { throw DownloadException.responseFailed } - + guard let data = data else { throw DownloadException.responseDataMissing } - + let fileManager = FileManager.default let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] let requestURL = try self.getURL(from: urlRequest) - + var requestPath = try self.getPath(from: requestURL) - + if let headerFileName = self.getFileName(fromContentDisposition: httpResponse.allHeaderFields["Content-Disposition"] as? String) { requestPath = requestPath.appending("/\(headerFileName)") } - + let filePath = documentsDirectory.appendingPathComponent(requestPath) let directoryPath = filePath.deletingLastPathComponent().path - + try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) try data.write(to: filePath, options: .atomic) - + completion(.success(Response(response: httpResponse, body: filePath as? T))) - + } catch let requestParserError as DownloadException { completion(.failure(ErrorResponse.error(400, data, requestParserError))) } catch let error { completion(.failure(ErrorResponse.error(400, data, error))) } - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + default: - + completion(.success(Response(response: httpResponse, body: data as? T))) } @@ -251,7 +251,7 @@ open class URLSessionRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -270,7 +270,7 @@ open class URLSessionRequestBuilder: RequestBuilder { filename = contentItem return filename? - .replacingCharacters(in: range, with: "") + .replacingCharacters(in: range, with:"") .replacingOccurrences(of: "\"", with: "") .trimmingCharacters(in: .whitespacesAndNewlines) } @@ -279,7 +279,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url: URL) throws -> String { + fileprivate func getPath(from url : URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -293,7 +293,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -304,7 +304,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } -open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { +open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, Error>) -> Void) { if let error = error { @@ -324,28 +324,28 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + case is Data.Type: - + completion(.success(Response(response: httpResponse, body: data as? T))) - + default: - + guard let data = data, !data.isEmpty else { completion(.failure(ErrorResponse.error(httpResponse.statusCode, nil, DecodableRequestBuilderError.emptyDataResponse))) return } - + let decodeResult = CodableHelper.decode(T.self, from: data) - + switch decodeResult { case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) @@ -356,10 +356,10 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui } } -private class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { - +fileprivate class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { + var credential: URLCredential? - + var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { @@ -402,13 +402,13 @@ public protocol ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest } -private class URLEncoding: ParameterEncoding { - func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { - +fileprivate class URLEncoding: ParameterEncoding { + func encode(_ urlRequest: URLRequest, with parameters: [String : Any]?) throws -> URLRequest { + var urlRequest = urlRequest - + guard let parameters = parameters else { return urlRequest } - + guard let url = urlRequest.url else { throw DownloadException.requestMissingURL } @@ -417,12 +417,12 @@ private class URLEncoding: ParameterEncoding { urlComponents.queryItems = APIHelper.mapValuesToQueryItems(parameters) urlRequest.url = urlComponents.url } - + return urlRequest } } -private class FileUploadEncoding: ParameterEncoding { +fileprivate class FileUploadEncoding: ParameterEncoding { let contentTypeForFormPart: (_ fileURL: URL) -> String? @@ -433,13 +433,13 @@ private class FileUploadEncoding: ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { var urlRequest = urlRequest - + guard let parameters = parameters, !parameters.isEmpty else { return urlRequest } - + let boundary = "Boundary-\(UUID().uuidString)" - + urlRequest.setValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type") for (key, value) in parameters { @@ -479,7 +479,7 @@ private class FileUploadEncoding: ParameterEncoding { fatalError("Unprocessable value \(value) with key \(key)") } } - + var body = urlRequest.httpBody.orEmpty body.append("\r\n--\(boundary)--\r\n") @@ -494,7 +494,7 @@ private class FileUploadEncoding: ParameterEncoding { var urlRequest = urlRequest var body = urlRequest.httpBody.orEmpty - + let fileData = try Data(contentsOf: fileURL) let mimetype = self.contentTypeForFormPart(fileURL) ?? mimeType(for: fileURL) @@ -502,7 +502,7 @@ private class FileUploadEncoding: ParameterEncoding { let fileName = fileURL.lastPathComponent // If we already added something then we need an additional newline. - if body.count > 0 { + if (body.count > 0) { body.append("\r\n") } @@ -518,20 +518,20 @@ private class FileUploadEncoding: ParameterEncoding { // The value data. body.append(fileData) - + urlRequest.httpBody = body return urlRequest } - + private func configureDataUploadRequest(urlRequest: URLRequest, boundary: String, name: String, data: Data) -> URLRequest { var urlRequest = urlRequest - + var body = urlRequest.httpBody.orEmpty // If we already added something then we need an additional newline. - if body.count > 0 { + if (body.count > 0) { body.append("\r\n") } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Package.swift b/samples/client/petstore/swift5/urlsessionLibrary/Package.swift index 96dfff54edf4..79f6f8188738 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Package.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Package.swift @@ -14,7 +14,7 @@ let package = Package( // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "PetstoreClient", - targets: ["PetstoreClient"]) + targets: ["PetstoreClient"]), ], dependencies: [ // Dependencies declare other packages that this package depends on. @@ -26,6 +26,6 @@ let package = Package( name: "PetstoreClient", dependencies: [], path: "PetstoreClient/Classes" - ) + ), ] ) diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 5b09f9557113..2404bc8ffc6d 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { + public static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { let destination = source.reduce(into: [String: Any]()) { (result, item) in if let value = item.value { result[item.key] = value @@ -20,17 +20,17 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { + public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? [Any?] { - result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") + if let collection = item.value as? Array { + result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { + public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { guard let source = source else { return nil } @@ -46,15 +46,15 @@ public struct APIHelper { } public static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? [Any?] { + if let collection = source as? Array { return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") } return source } - public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { + public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? [Any?] { + if let collection = item.value as? Array { collection.filter({ $0 != nil }).map({"\($0!)"}).forEach { value in result.append(URLQueryItem(name: item.key, value: value)) } @@ -69,3 +69,4 @@ public struct APIHelper { return destination } } + diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift index a5c2d605dff6..c5d1b9b42df3 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,15 +9,15 @@ import Foundation open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var credential: URLCredential? - public static var customHeaders: [String: String] = [:] + public static var customHeaders: [String:String] = [:] public static var requestBuilderFactory: RequestBuilderFactory = URLSessionRequestBuilderFactory() public static var apiResponseQueue: DispatchQueue = .main } open class RequestBuilder { var credential: URLCredential? - var headers: [String: String] - public let parameters: [String: Any]? + var headers: [String:String] + public let parameters: [String:Any]? public let isBody: Bool public let method: String public let URLString: String @@ -25,9 +25,9 @@ open class RequestBuilder { /// Optional block to obtain a reference to the request's progress instance when available. /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. /// If you need to get the request's progress in older OS versions, please use Alamofire http client. - public var onProgressReady: ((Progress) -> Void)? + public var onProgressReady: ((Progress) -> ())? - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -37,7 +37,7 @@ open class RequestBuilder { addHeaders(PetstoreClientAPI.customHeaders) } - open func addHeaders(_ aHeaders: [String: String]) { + open func addHeaders(_ aHeaders:[String:String]) { for (header, value) in aHeaders { headers[header] = value } @@ -60,5 +60,5 @@ open class RequestBuilder { public protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 5bbf323f820c..bb3ae7178254 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class AnotherFakeAPI { /** To test special tags @@ -15,7 +17,7 @@ open class AnotherFakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 134d6aea416a..d1d81faa335c 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class FakeAPI { /** @@ -14,7 +16,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) { + open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?,_ error: Error?) -> Void)) { fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -49,7 +51,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) { + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?,_ error: Error?) -> Void)) { fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -84,7 +86,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) { + open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?,_ error: Error?) -> Void)) { fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -119,7 +121,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { + open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -154,7 +156,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -190,7 +192,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -229,7 +231,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -279,7 +281,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testEndpointParametersWithRequestBuilder(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -316,7 +318,7 @@ open class FakeAPI { open class func testEndpointParametersWithRequestBuilder(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "integer": integer?.encodeToJSON(), "int32": int32?.encodeToJSON(), "int64": int64?.encodeToJSON(), @@ -335,7 +337,7 @@ open class FakeAPI { let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -424,7 +426,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -452,19 +454,19 @@ open class FakeAPI { open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "enum_form_string_array": enumFormStringArray?.encodeToJSON(), "enum_form_string": enumFormString?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), - "enum_query_string": enumQueryString?.encodeToJSON(), - "enum_query_integer": enumQueryInteger?.encodeToJSON(), + "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), + "enum_query_string": enumQueryString?.encodeToJSON(), + "enum_query_integer": enumQueryInteger?.encodeToJSON(), "enum_query_double": enumQueryDouble?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -490,7 +492,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -516,13 +518,13 @@ open class FakeAPI { open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), "int64_group": int64Group?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -543,7 +545,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testInlineAdditionalProperties(param: [String:String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -560,7 +562,7 @@ open class FakeAPI { - parameter param: (body) request body - returns: RequestBuilder */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { let path = "/fake/inline-additionalProperties" let URLString = PetstoreClientAPI.basePath + path let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) @@ -580,7 +582,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -601,14 +603,14 @@ open class FakeAPI { open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { let path = "/fake/jsonFormData" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "param": param.encodeToJSON(), "param2": param2.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 48cfe7187b9a..d21c4a49d43d 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -7,6 +7,8 @@ import Foundation + + open class FakeClassnameTags123API { /** To test class name in snake case @@ -15,7 +17,7 @@ open class FakeClassnameTags123API { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index c938db720047..f5366f5832ba 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class PetAPI { /** Add a new pet to the store @@ -15,7 +17,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -55,7 +57,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -82,8 +84,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let nillableHeaders: [String: Any?] = [ "api_key": apiKey?.encodeToJSON() @@ -111,7 +113,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { + open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -135,8 +137,8 @@ open class PetAPI { open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "status": status.encodeToJSON() @@ -155,7 +157,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @available(*, deprecated, message: "This operation is deprecated.") - open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { + open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -180,8 +182,8 @@ open class PetAPI { open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "tags": tags.encodeToJSON() @@ -199,7 +201,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) { + open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?,_ error: Error?) -> Void)) { getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -226,8 +228,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -242,7 +244,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -283,7 +285,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -311,14 +313,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "name": name?.encodeToJSON(), "status": status?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -335,7 +337,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -363,14 +365,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "file": file?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -387,7 +389,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -415,14 +417,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "requiredFile": requiredFile.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index a8a83eda39a4..3848eda85ad6 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class StoreAPI { /** Delete purchase order by ID @@ -15,7 +17,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -39,8 +41,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -54,7 +56,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) { + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String:Int]?,_ error: Error?) -> Void)) { getInventoryWithRequestBuilder().execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -74,14 +76,14 @@ open class StoreAPI { - name: api_key - returns: RequestBuilder<[String:Int]> */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { + open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } @@ -93,7 +95,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { + open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -117,8 +119,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -133,7 +135,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { + open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 505ed1b0c5c9..546166841d9e 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class UserAPI { /** Create user @@ -15,7 +17,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -52,7 +54,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -88,7 +90,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -124,7 +126,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -148,8 +150,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -164,7 +166,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) { + open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?,_ error: Error?) -> Void)) { getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -187,8 +189,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -204,7 +206,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { + open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -226,11 +228,11 @@ open class UserAPI { open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username.encodeToJSON(), + "username": username.encodeToJSON(), "password": password.encodeToJSON() ]) @@ -245,7 +247,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { logoutUserWithRequestBuilder().execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -264,8 +266,8 @@ open class UserAPI { open class func logoutUserWithRequestBuilder() -> RequestBuilder { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -281,7 +283,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index ef971ebadc60..01b28a4bd42d 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -45,4 +45,4 @@ open class CodableHelper { open class func encode(_ value: T) -> Swift.Result where T: Encodable { return Swift.Result { try self.jsonEncoder.encode(value) } } -} +} \ No newline at end of file diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift index 627d9adb757e..f171525e4394 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -7,10 +7,10 @@ import Foundation open class Configuration { - + // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} + +} \ No newline at end of file diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 93ed6b90b376..6e279679c67a 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -108,24 +108,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { if let values = values { try encodeArray(values, forKey: key) } } - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -135,7 +135,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -147,8 +147,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { - var tmpArray: [T]? + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { + var tmpArray: [T]? = nil if contains(key) { tmpArray = try decodeArray(T.self, forKey: key) @@ -157,8 +157,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { + var map: [Self.Key : T] = [:] for key in allKeys { if !excludedKeys.contains(key) { @@ -177,3 +177,5 @@ extension HTTPURLResponse { return Array(200 ..< 300).contains(statusCode) } } + + diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift index b79e9f5e64d5..08f1ef334dff 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift @@ -41,7 +41,7 @@ public struct JSONDataEncoding { } public static func encodingParameters(jsonData: Data?) -> [String: Any]? { - var returnedParams: [String: Any]? + var returnedParams: [String: Any]? = nil if let jsonData = jsonData, !jsonData.isEmpty { var params: [String: Any] = [:] params[jsonDataKey] = jsonData diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 02f78ffb4705..314f1eff1f9b 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -9,8 +9,8 @@ import Foundation open class JSONEncodingHelper { - open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { - var params: [String: Any]? + open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { + var params: [String: Any]? = nil // Encode the Encodable object if let encodableObj = encodableObj { @@ -27,7 +27,7 @@ open class JSONEncodingHelper { } open class func encodingParameters(forEncodableObject encodableObj: Any?) -> [String: Any]? { - var params: [String: Any]? + var params: [String: Any]? = nil if let encodableObj = encodableObj { do { @@ -41,5 +41,5 @@ open class JSONEncodingHelper { return params } - + } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift index c0542c14c081..11e81ffcc472 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,11 +10,11 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -public enum ErrorResponse: Error { +public enum ErrorResponse : Error { case error(Int, Data?, Error) } -public enum DownloadException: Error { +public enum DownloadException : Error { case responseDataMissing case responseFailed case requestMissing @@ -30,6 +30,7 @@ public enum DecodableRequestBuilderError: Error { case generalError(Error) } + open class Response { public let statusCode: Int public let header: [String: String] @@ -43,7 +44,7 @@ open class Response { public convenience init(response: HTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String: String]() + var header = [String:String]() for (key, value) in rawHeader { if let key = key.base as? String, let value = value as? String { header[key] = value diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 1af031535967..28ca8377b889 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -7,17 +7,19 @@ import Foundation -public struct AdditionalPropertiesClass: Codable { - public var mapString: [String: String]? - public var mapMapString: [String: [String: String]]? +public struct AdditionalPropertiesClass: Codable { - public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { + + public var mapString: [String:String]? + public var mapMapString: [String:[String:String]]? + + public init(mapString: [String:String]?, mapMapString: [String:[String:String]]?) { self.mapString = mapString self.mapMapString = mapMapString } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapString = "map_string" case mapMapString = "map_map_string" } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 5ed9f31e2a36..1050d79dbe9d 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -7,7 +7,9 @@ import Foundation -public struct Animal: Codable { + +public struct Animal: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift index e09b0e9efdc8..e7bea63f8ed2 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -7,4 +7,5 @@ import Foundation + public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index ec270da89074..4d0393b9ba45 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -7,7 +7,9 @@ import Foundation -public struct ApiResponse: Codable { + +public struct ApiResponse: Codable { + public var code: Int? public var type: String? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 6c252ed475b2..1363c96394ba 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayOfArrayOfNumberOnly: Codable { + +public struct ArrayOfArrayOfNumberOnly: Codable { + public var arrayArrayNumber: [[Double]]? @@ -15,7 +17,7 @@ public struct ArrayOfArrayOfNumberOnly: Codable { self.arrayArrayNumber = arrayArrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayArrayNumber = "ArrayArrayNumber" } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index e84eb5d65025..6b8873730c43 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayOfNumberOnly: Codable { + +public struct ArrayOfNumberOnly: Codable { + public var arrayNumber: [Double]? @@ -15,7 +17,7 @@ public struct ArrayOfNumberOnly: Codable { self.arrayNumber = arrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayNumber = "ArrayNumber" } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index d2140933d181..64f7c6d9db99 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayTest: Codable { + +public struct ArrayTest: Codable { + public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? @@ -19,7 +21,7 @@ public struct ArrayTest: Codable { self.arrayArrayOfModel = arrayArrayOfModel } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" case arrayArrayOfModel = "array_array_of_model" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index d1b3b27616ed..ddb669a59045 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -7,7 +7,9 @@ import Foundation -public struct Capitalization: Codable { + +public struct Capitalization: Codable { + public var smallCamel: String? public var capitalCamel: String? @@ -26,7 +28,7 @@ public struct Capitalization: Codable { self.ATT_NAME = ATT_NAME } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case smallCamel case capitalCamel = "CapitalCamel" case smallSnake = "small_Snake" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 7ab887f3113f..c4f6e0d488ca 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -7,7 +7,9 @@ import Foundation -public struct Cat: Codable { + +public struct Cat: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index a51ad0dffab1..7b1d7e32be80 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -7,7 +7,9 @@ import Foundation -public struct CatAllOf: Codable { + +public struct CatAllOf: Codable { + public var declawed: Bool? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index eb8f7e5e1974..3ec00f5ab10d 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,7 +7,9 @@ import Foundation -public struct Category: Codable { + +public struct Category: Codable { + public var id: Int64? public var name: String = "default-name" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index e2a7d4427a06..af030c3dd626 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model with \"_class\" property */ -public struct ClassModel: Codable { +public struct ClassModel: Codable { + public var _class: String? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 00245ca37280..0aae748c76b4 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -7,7 +7,9 @@ import Foundation -public struct Client: Codable { + +public struct Client: Codable { + public var client: String? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 492c1228008e..198e28b94dd6 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -7,7 +7,9 @@ import Foundation -public struct Dog: Codable { + +public struct Dog: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 7786f8acc5ae..8ff49b2af23f 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -7,7 +7,9 @@ import Foundation -public struct DogAllOf: Codable { + +public struct DogAllOf: Codable { + public var breed: String? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 9844e7c40e35..e2d3fa04f94b 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -7,7 +7,9 @@ import Foundation -public struct EnumArrays: Codable { + +public struct EnumArrays: Codable { + public enum JustSymbol: String, Codable, CaseIterable { case greaterThanOrEqualTo = ">=" @@ -25,7 +27,7 @@ public struct EnumArrays: Codable { self.arrayEnum = arrayEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justSymbol = "just_symbol" case arrayEnum = "array_enum" } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index d4029d73f8af..c2c639ba3246 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -7,6 +7,7 @@ import Foundation + public enum EnumClass: String, Codable, CaseIterable { case abc = "_abc" case efg = "-efg" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 789f583e1d77..a56e1f36389b 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct EnumTest: Codable { + +public struct EnumTest: Codable { + public enum EnumString: String, Codable, CaseIterable { case upper = "UPPER" @@ -41,7 +43,7 @@ public struct EnumTest: Codable { self.outerEnum = outerEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case enumString = "enum_string" case enumStringRequired = "enum_string_required" case enumInteger = "enum_integer" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift index abf3ccffc485..773b53b2cb76 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -8,7 +8,8 @@ import Foundation /** Must be named `File` for test. */ -public struct File: Codable { +public struct File: Codable { + /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 532f1457939a..83dc1148cfa3 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -7,7 +7,9 @@ import Foundation -public struct FileSchemaTestClass: Codable { + +public struct FileSchemaTestClass: Codable { + public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index 20bd6d103b3d..bccd3f9fb178 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct FormatTest: Codable { + +public struct FormatTest: Codable { + public var integer: Int? public var int32: Int? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 906ddb06fb17..566d71a35ef0 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct HasOnlyReadOnly: Codable { + +public struct HasOnlyReadOnly: Codable { + public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift index fe13d302ccbf..80cecab242f2 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -7,7 +7,9 @@ import Foundation -public struct List: Codable { + +public struct List: Codable { + public var _123list: String? @@ -15,7 +17,7 @@ public struct List: Codable { self._123list = _123list } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _123list = "123-list" } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 4b6037f378ee..f0c02de95f7a 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -7,25 +7,27 @@ import Foundation -public struct MapTest: Codable { + +public struct MapTest: Codable { + public enum MapOfEnumString: String, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" } - public var mapMapOfString: [String: [String: String]]? - public var mapOfEnumString: [String: String]? - public var directMap: [String: Bool]? + public var mapMapOfString: [String:[String:String]]? + public var mapOfEnumString: [String:String]? + public var directMap: [String:Bool]? public var indirectMap: StringBooleanMap? - public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { + public init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?, directMap: [String:Bool]?, indirectMap: StringBooleanMap?) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap self.indirectMap = indirectMap } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" case directMap = "direct_map" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c3deb2f28932..710e62a9b587 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,13 +7,15 @@ import Foundation -public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { + +public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { + public var uuid: UUID? public var dateTime: Date? - public var map: [String: Animal]? + public var map: [String:Animal]? - public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { + public init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { self.uuid = uuid self.dateTime = dateTime self.map = map diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index b61db7d6e716..450a53b918ca 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model name starting with number */ -public struct Model200Response: Codable { +public struct Model200Response: Codable { + public var name: Int? public var _class: String? @@ -18,7 +19,7 @@ public struct Model200Response: Codable { self._class = _class } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case _class = "class" } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 8ab4db44b73a..6deb69fcd731 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model name same as property name */ -public struct Name: Codable { +public struct Name: Codable { + public var name: Int public var snakeCase: Int? @@ -22,7 +23,7 @@ public struct Name: Codable { self._123number = _123number } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case snakeCase = "snake_case" case property diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 4d1dafcc2c1f..0c9ee2b7b9f4 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct NumberOnly: Codable { + +public struct NumberOnly: Codable { + public var justNumber: Double? @@ -15,7 +17,7 @@ public struct NumberOnly: Codable { self.justNumber = justNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justNumber = "JustNumber" } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 40c30cc8609c..ab0eac0b304e 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,7 +7,9 @@ import Foundation -public struct Order: Codable { + +public struct Order: Codable { + public enum Status: String, Codable, CaseIterable { case placed = "placed" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 18c3a024f122..4a7d22710441 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -7,7 +7,9 @@ import Foundation -public struct OuterComposite: Codable { + +public struct OuterComposite: Codable { + public var myNumber: Double? public var myString: String? @@ -19,7 +21,7 @@ public struct OuterComposite: Codable { self.myBoolean = myBoolean } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case myNumber = "my_number" case myString = "my_string" case myBoolean = "my_boolean" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index c3b778cbbed4..9e6b8d74e874 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -7,6 +7,7 @@ import Foundation + public enum OuterEnum: String, Codable, CaseIterable { case placed = "placed" case approved = "approved" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index b9ce0e933256..a973071d6c96 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,7 +7,9 @@ import Foundation -public struct Pet: Codable { + +public struct Pet: Codable { + public enum Status: String, Codable, CaseIterable { case available = "available" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 0acd21fd1000..b2a6b7e2b8a6 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -7,7 +7,9 @@ import Foundation -public struct ReadOnlyFirst: Codable { + +public struct ReadOnlyFirst: Codable { + public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index c223f993a69e..7e089dcee2b4 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing reserved words */ -public struct Return: Codable { +public struct Return: Codable { + public var _return: Int? @@ -16,7 +17,7 @@ public struct Return: Codable { self._return = _return } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _return = "return" } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index 6e8650f76d8e..e890ef952520 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -7,7 +7,9 @@ import Foundation -public struct SpecialModelName: Codable { + +public struct SpecialModelName: Codable { + public var specialPropertyName: Int64? @@ -15,7 +17,7 @@ public struct SpecialModelName: Codable { self.specialPropertyName = specialPropertyName } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case specialPropertyName = "$special[property.name]" } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index 3f1237fee477..f65ae0623d6e 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -7,9 +7,12 @@ import Foundation -public struct StringBooleanMap: Codable { - public var additionalProperties: [String: Bool] = [:] +public struct StringBooleanMap: Codable { + + + + public var additionalProperties: [String:Bool] = [:] public subscript(key: String) -> Bool? { get { @@ -42,4 +45,5 @@ public struct StringBooleanMap: Codable { additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } + } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 4dd8a9a9f5a0..a91b6061bcf7 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,7 +7,9 @@ import Foundation -public struct Tag: Codable { + +public struct Tag: Codable { + public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index a9e088808ed3..2d377c3edb02 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -7,7 +7,9 @@ import Foundation -public struct TypeHolderDefault: Codable { + +public struct TypeHolderDefault: Codable { + public var stringItem: String = "what" public var numberItem: Double @@ -23,7 +25,7 @@ public struct TypeHolderDefault: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index dff4083ae432..e5eb92da696e 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -7,7 +7,9 @@ import Foundation -public struct TypeHolderExample: Codable { + +public struct TypeHolderExample: Codable { + public var stringItem: String public var numberItem: Double @@ -23,7 +25,7 @@ public struct TypeHolderExample: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 79f271ed7356..f70328ca9e59 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,7 +7,9 @@ import Foundation -public struct User: Codable { + +public struct User: Codable { + public var id: Int64? public var username: String? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index 55d0eb421919..22261e2ce948 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -14,7 +14,7 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { return URLSessionRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return URLSessionDecodableRequestBuilder.self } } @@ -23,16 +23,16 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { private var urlSessionStore = SynchronizedDictionary() open class URLSessionRequestBuilder: RequestBuilder { - + private var observation: NSKeyValueObservation? - + deinit { observation?.invalidate() } - + // swiftlint:disable:next weak_delegate fileprivate let sessionDelegate = SessionDelegate() - + /** May be assigned if you want to control the authentication challenges. */ @@ -45,11 +45,11 @@ open class URLSessionRequestBuilder: RequestBuilder { - retry the request. */ public var taskCompletionShouldRetry: ((Data?, URLResponse?, Error?, @escaping (Bool) -> Void) -> Void)? - - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + + required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } - + /** May be overridden by a subclass if you want to control the URLSession configuration. @@ -77,40 +77,40 @@ open class URLSessionRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the URLRequest configuration (e.g. to override the cache policy). */ - open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) throws -> URLRequest { - + open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) throws -> URLRequest { + guard let url = URL(string: URLString) else { throw DownloadException.requestMissingURL } - + var originalRequest = URLRequest(url: url) - + originalRequest.httpMethod = method.rawValue - + buildHeaders().forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + headers.forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + let modifiedRequest = try encoding.encode(originalRequest, with: parameters) - + return modifiedRequest } override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, Error>) -> Void) { - let urlSessionId: String = UUID().uuidString + let urlSessionId:String = UUID().uuidString // Create a new manager for each request to customize its request header let urlSession = createURLSession() urlSessionStore[urlSessionId] = urlSession - + let parameters: [String: Any] = self.parameters ?? [:] - + let fileKeys = parameters.filter { $1 is URL } .map { $0.0 } - + let encoding: ParameterEncoding if fileKeys.count > 0 { encoding = FileUploadEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) @@ -119,29 +119,29 @@ open class URLSessionRequestBuilder: RequestBuilder { } else { encoding = URLEncoding() } - + guard let xMethod = HTTPMethod(rawValue: method) else { fatalError("Unsuported Http method - \(method)") } - + let cleanupRequest = { urlSessionStore[urlSessionId] = nil self.observation?.invalidate() } - + do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) - + let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in - + guard let self = self else { return } - + if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - + taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in - + guard let self = self else { return } - + if shouldRetry { cleanupRequest() self.execute(apiResponseQueue, completion) @@ -157,13 +157,13 @@ open class URLSessionRequestBuilder: RequestBuilder { } } } - + if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { onProgressReady?(dataTask.progress) } - + dataTask.resume() - + } catch { apiResponseQueue.async { cleanupRequest() @@ -172,7 +172,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - + fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, Error>) -> Void) { if let error = error { @@ -192,52 +192,52 @@ open class URLSessionRequestBuilder: RequestBuilder { switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is URL.Type: do { - + guard error == nil else { throw DownloadException.responseFailed } - + guard let data = data else { throw DownloadException.responseDataMissing } - + let fileManager = FileManager.default let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] let requestURL = try self.getURL(from: urlRequest) - + var requestPath = try self.getPath(from: requestURL) - + if let headerFileName = self.getFileName(fromContentDisposition: httpResponse.allHeaderFields["Content-Disposition"] as? String) { requestPath = requestPath.appending("/\(headerFileName)") } - + let filePath = documentsDirectory.appendingPathComponent(requestPath) let directoryPath = filePath.deletingLastPathComponent().path - + try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) try data.write(to: filePath, options: .atomic) - + completion(.success(Response(response: httpResponse, body: filePath as? T))) - + } catch let requestParserError as DownloadException { completion(.failure(ErrorResponse.error(400, data, requestParserError))) } catch let error { completion(.failure(ErrorResponse.error(400, data, error))) } - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + default: - + completion(.success(Response(response: httpResponse, body: data as? T))) } @@ -251,7 +251,7 @@ open class URLSessionRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -270,7 +270,7 @@ open class URLSessionRequestBuilder: RequestBuilder { filename = contentItem return filename? - .replacingCharacters(in: range, with: "") + .replacingCharacters(in: range, with:"") .replacingOccurrences(of: "\"", with: "") .trimmingCharacters(in: .whitespacesAndNewlines) } @@ -279,7 +279,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url: URL) throws -> String { + fileprivate func getPath(from url : URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -293,7 +293,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -304,7 +304,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } -open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { +open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, Error>) -> Void) { if let error = error { @@ -324,28 +324,28 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + case is Data.Type: - + completion(.success(Response(response: httpResponse, body: data as? T))) - + default: - + guard let data = data, !data.isEmpty else { completion(.failure(ErrorResponse.error(httpResponse.statusCode, nil, DecodableRequestBuilderError.emptyDataResponse))) return } - + let decodeResult = CodableHelper.decode(T.self, from: data) - + switch decodeResult { case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) @@ -356,10 +356,10 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui } } -private class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { - +fileprivate class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { + var credential: URLCredential? - + var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { @@ -402,13 +402,13 @@ public protocol ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest } -private class URLEncoding: ParameterEncoding { - func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { - +fileprivate class URLEncoding: ParameterEncoding { + func encode(_ urlRequest: URLRequest, with parameters: [String : Any]?) throws -> URLRequest { + var urlRequest = urlRequest - + guard let parameters = parameters else { return urlRequest } - + guard let url = urlRequest.url else { throw DownloadException.requestMissingURL } @@ -417,12 +417,12 @@ private class URLEncoding: ParameterEncoding { urlComponents.queryItems = APIHelper.mapValuesToQueryItems(parameters) urlRequest.url = urlComponents.url } - + return urlRequest } } -private class FileUploadEncoding: ParameterEncoding { +fileprivate class FileUploadEncoding: ParameterEncoding { let contentTypeForFormPart: (_ fileURL: URL) -> String? @@ -433,13 +433,13 @@ private class FileUploadEncoding: ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { var urlRequest = urlRequest - + guard let parameters = parameters, !parameters.isEmpty else { return urlRequest } - + let boundary = "Boundary-\(UUID().uuidString)" - + urlRequest.setValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type") for (key, value) in parameters { @@ -479,7 +479,7 @@ private class FileUploadEncoding: ParameterEncoding { fatalError("Unprocessable value \(value) with key \(key)") } } - + var body = urlRequest.httpBody.orEmpty body.append("\r\n--\(boundary)--\r\n") @@ -494,7 +494,7 @@ private class FileUploadEncoding: ParameterEncoding { var urlRequest = urlRequest var body = urlRequest.httpBody.orEmpty - + let fileData = try Data(contentsOf: fileURL) let mimetype = self.contentTypeForFormPart(fileURL) ?? mimeType(for: fileURL) @@ -502,7 +502,7 @@ private class FileUploadEncoding: ParameterEncoding { let fileName = fileURL.lastPathComponent // If we already added something then we need an additional newline. - if body.count > 0 { + if (body.count > 0) { body.append("\r\n") } @@ -518,20 +518,20 @@ private class FileUploadEncoding: ParameterEncoding { // The value data. body.append(fileData) - + urlRequest.httpBody = body return urlRequest } - + private func configureDataUploadRequest(urlRequest: URLRequest, boundary: String, name: String, data: Data) -> URLRequest { var urlRequest = urlRequest - + var body = urlRequest.httpBody.orEmpty // If we already added something then we need an additional newline. - if body.count > 0 { + if (body.count > 0) { body.append("\r\n") } diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/README.md b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/README.md index 151fb2f1a505..f854b9ec1167 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/README.md +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/README.md @@ -1,4 +1,4 @@ -## @openapitools/typescript-angular-petstore@1.0.0 +## @openapitools/angular2-typescript-petstore@1.0.0 ### Building @@ -19,7 +19,7 @@ Navigate to the folder of your consuming project and run one of next commands. _published:_ ``` -npm install @openapitools/typescript-angular-petstore@1.0.0 --save +npm install @openapitools/angular2-typescript-petstore@1.0.0 --save ``` _without publishing (not recommended):_ @@ -39,7 +39,7 @@ npm link In your project: ``` -npm link @openapitools/typescript-angular-petstore +npm link @openapitools/angular2-typescript-petstore ``` __Note for Windows users:__ The Angular CLI has troubles to use linked npm packages. @@ -54,7 +54,7 @@ In your Angular project: ``` // without configuring providers -import { ApiModule } from '@openapitools/typescript-angular-petstore'; +import { ApiModule } from '@openapitools/angular2-typescript-petstore'; import { HttpClientModule } from '@angular/common/http'; @NgModule({ @@ -73,7 +73,7 @@ export class AppModule {} ``` // configuring providers -import { ApiModule, Configuration, ConfigurationParameters } from '@openapitools/typescript-angular-petstore'; +import { ApiModule, Configuration, ConfigurationParameters } from '@openapitools/angular2-typescript-petstore'; export function apiConfigFactory (): Configuration => { const params: ConfigurationParameters = { @@ -93,7 +93,7 @@ export class AppModule {} ``` // configuring providers with an authentication service that manages your access tokens -import { ApiModule, Configuration } from '@openapitools/typescript-angular-petstore'; +import { ApiModule, Configuration } from '@openapitools/angular2-typescript-petstore'; @NgModule({ imports: [ ApiModule ], @@ -117,7 +117,7 @@ export class AppModule {} ``` ``` -import { DefaultApi } from '@openapitools/typescript-angular-petstore'; +import { DefaultApi } from '@openapitools/angular2-typescript-petstore'; export class AppComponent { constructor(private apiGateway: DefaultApi) { } @@ -155,7 +155,7 @@ export class AppModule { If different than the generated base path, during app bootstrap, you can provide the base path to your service. ``` -import { BASE_PATH } from '@openapitools/typescript-angular-petstore'; +import { BASE_PATH } from '@openapitools/angular2-typescript-petstore'; bootstrap(AppComponent, [ { provide: BASE_PATH, useValue: 'https://your-web-service.com' }, @@ -164,7 +164,7 @@ bootstrap(AppComponent, [ or ``` -import { BASE_PATH } from '@openapitools/typescript-angular-petstore'; +import { BASE_PATH } from '@openapitools/angular2-typescript-petstore'; @NgModule({ imports: [], @@ -188,7 +188,7 @@ export const environment = { In the src/app/app.module.ts: ``` -import { BASE_PATH } from '@openapitools/typescript-angular-petstore'; +import { BASE_PATH } from '@openapitools/angular2-typescript-petstore'; import { environment } from '../environments/environment'; @NgModule({ diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/package.json b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/package.json index 610e1d2c7246..6ac9cd86a10c 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/package.json +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/package.json @@ -1,7 +1,7 @@ { - "name": "@openapitools/typescript-angular-petstore", + "name": "@openapitools/angular2-typescript-petstore", "version": "1.0.0", - "description": "OpenAPI client for @openapitools/typescript-angular-petstore", + "description": "OpenAPI client for @openapitools/angular2-typescript-petstore", "author": "OpenAPI-Generator Contributors", "keywords": [ "openapi-client", diff --git a/samples/client/petstore/typescript-fetch/builds/default/.openapi-generator-ignore b/samples/client/petstore/typescript-fetch/builds/default/.openapi-generator-ignore index 7484ee590a38..cabbe3494d4c 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/.openapi-generator-ignore +++ b/samples/client/petstore/typescript-fetch/builds/default/.openapi-generator-ignore @@ -1,23 +1,3 @@ # OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator +pom.xml -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/.openapi-generator-ignore b/samples/client/petstore/typescript-fetch/builds/es6-target/.openapi-generator-ignore index 7484ee590a38..cabbe3494d4c 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/.openapi-generator-ignore +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/.openapi-generator-ignore @@ -1,23 +1,3 @@ # OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator +pom.xml -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/.openapi-generator-ignore b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/.openapi-generator-ignore index 7484ee590a38..cabbe3494d4c 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/.openapi-generator-ignore +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/.openapi-generator-ignore @@ -1,23 +1,3 @@ # OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator +pom.xml -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/.openapi-generator-ignore b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/.openapi-generator-ignore index 7484ee590a38..cabbe3494d4c 100644 --- a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/.openapi-generator-ignore +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/.openapi-generator-ignore @@ -1,23 +1,3 @@ # OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator +pom.xml -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/.openapi-generator-ignore b/samples/client/petstore/typescript-fetch/builds/with-npm-version/.openapi-generator-ignore index 7484ee590a38..cabbe3494d4c 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/.openapi-generator-ignore +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/.openapi-generator-ignore @@ -1,23 +1,3 @@ # OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator +pom.xml -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/client/petstore/typescript-fetch/tests/default/.openapi-generator-ignore b/samples/client/petstore/typescript-fetch/tests/default/.openapi-generator-ignore new file mode 100644 index 000000000000..cabbe3494d4c --- /dev/null +++ b/samples/client/petstore/typescript-fetch/tests/default/.openapi-generator-ignore @@ -0,0 +1,3 @@ +# OpenAPI Generator Ignore +pom.xml + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/.openapi-generator/FILES b/samples/openapi3/client/petstore/go-experimental/go-petstore/.openapi-generator/FILES index 3c0d34c4ed17..c90528f4b27a 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/.openapi-generator/FILES @@ -1,5 +1,4 @@ .gitignore -.openapi-generator-ignore .travis.yml README.md api/openapi.yaml diff --git a/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/FILES b/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/FILES index 6e1550482f9c..cc725b6d4dcc 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/FILES @@ -1,5 +1,4 @@ .gitignore -.openapi-generator-ignore .travis.yml README.md api/openapi.yaml diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/.openapi-generator-ignore b/samples/openapi3/client/petstore/java/jersey2-java8/.openapi-generator-ignore index 7484ee590a38..16d6986fc2e5 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/.openapi-generator-ignore +++ b/samples/openapi3/client/petstore/java/jersey2-java8/.openapi-generator-ignore @@ -1,23 +1,4 @@ # OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md +# These are "live" test files which should not be overwritten +src/test/java/org/openapitools/client/JSONTest.java +src/test/java/org/openapitools/client/JSONComposedSchemaTest.java diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/.openapi-generator/FILES b/samples/openapi3/client/petstore/java/jersey2-java8/.openapi-generator/FILES index b82bd6a172de..c05e6308f676 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/java/jersey2-java8/.openapi-generator/FILES @@ -1,5 +1,4 @@ .gitignore -.openapi-generator-ignore .travis.yml README.md api/openapi.yaml diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/FakeApi.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/FakeApi.md index 9c912ded09eb..406019f765a8 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/FakeApi.md @@ -670,7 +670,7 @@ Name | Type | Description | Notes **string** | **String**| None | [optional] **binary** | **File**| None | [optional] **date** | **LocalDate**| None | [optional] - **dateTime** | **OffsetDateTime**| None | [optional] [default to OffsetDateTime.parse("2010-02-01T17:20:10.111110+08:00[Asia/Hong_Kong]", java.time.format.DateTimeFormatter.ISO_ZONED_DATE_TIME.withZone(java.time.ZoneId.systemDefault()))] + **dateTime** | **OffsetDateTime**| None | [optional] [default to OffsetDateTime.parse("2010-02-01T09:20:10.111110Z[UTC]", java.time.format.DateTimeFormatter.ISO_ZONED_DATE_TIME.withZone(java.time.ZoneId.systemDefault()))] **password** | **String**| None | [optional] **paramCallback** | **String**| None | [optional] diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/FakeApi.java index eed4c3185988..95e2aed6acd9 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/FakeApi.java @@ -639,7 +639,7 @@ public ApiResponse testClientModelWithHttpInfo(Client client) throws Api * @param string None (optional) * @param binary None (optional) * @param date None (optional) - * @param dateTime None (optional, default to OffsetDateTime.parse("2010-02-01T17:20:10.111110+08:00[Asia/Hong_Kong]", java.time.format.DateTimeFormatter.ISO_ZONED_DATE_TIME.withZone(java.time.ZoneId.systemDefault()))) + * @param dateTime None (optional, default to OffsetDateTime.parse("2010-02-01T09:20:10.111110Z[UTC]", java.time.format.DateTimeFormatter.ISO_ZONED_DATE_TIME.withZone(java.time.ZoneId.systemDefault()))) * @param password None (optional) * @param paramCallback None (optional) * @throws ApiException if fails to make API call @@ -668,7 +668,7 @@ public void testEndpointParameters(BigDecimal number, Double _double, String pat * @param string None (optional) * @param binary None (optional) * @param date None (optional) - * @param dateTime None (optional, default to OffsetDateTime.parse("2010-02-01T17:20:10.111110+08:00[Asia/Hong_Kong]", java.time.format.DateTimeFormatter.ISO_ZONED_DATE_TIME.withZone(java.time.ZoneId.systemDefault()))) + * @param dateTime None (optional, default to OffsetDateTime.parse("2010-02-01T09:20:10.111110Z[UTC]", java.time.format.DateTimeFormatter.ISO_ZONED_DATE_TIME.withZone(java.time.ZoneId.systemDefault()))) * @param password None (optional) * @param paramCallback None (optional) * @return ApiResponse<Void> @@ -1231,7 +1231,7 @@ public ApiResponse testQueryParameterCollectionFormatWithHttpInfo(List 4.0.0 org.openapitools - jaxrs-cxf-petstore-server-test-data + cxf-test-data war - jaxrs-cxf-petstore-server-test-data + cxf-test-data This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ 1.0.0 @@ -233,7 +233,7 @@ org.openapitools openapi-generator - 4.0.0-SNAPSHOT + 5.0.0-SNAPSHOT @@ -260,7 +260,7 @@ 9.2.9.v20150224 1.1.0.Final 3.3.0 - 2.9.8 + 2.9.9 UTF-8 diff --git a/samples/server/petstore/jaxrs-cxf-test-data/readme.md b/samples/server/petstore/jaxrs-cxf-test-data/readme.md index 60afd53a0df3..fdd92b91bf13 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/readme.md +++ b/samples/server/petstore/jaxrs-cxf-test-data/readme.md @@ -1,4 +1,3 @@ - # JAX-RS CXF 3 server application ## Supported features @@ -8,29 +7,27 @@ * Swagger-UI can be included as Web-Jar automatically * WADL is accessible (CXF WADL-Generator) * Unit-tests include Gzip-Interceptors for demonstration +* Options for generating a functional mock server returning static responses - -## Urls to access the REST API -### Urls for Spring Boot +## URLs to access the REST API +### URLs for Spring Boot * Available services listing -http://localhost:8080/ + http://localhost:8080/ -* Swagger API +* OpenAPI http://localhost:8080/services/openapi.json * CXF WADL http://localhost:8080/services?_wadl -### Urls if deployed to an AS +### URLs if deployed to an Application Server * Available services listing -http://localhost:8080/swagger-cxf-server/rest/services/ + http://localhost:8080/swagger-cxf-server/rest/services/ -* Swagger API +* OpenAPI http://localhost:8080/swagger-cxf-server/rest/services/swagger.json * CXF WADL http://localhost:8080/swagger-cxf-server/rest/services?_wadl - - diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/api/FakeApi.java index 34d3f595cbdd..4d49b7da4475 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/api/FakeApi.java @@ -73,7 +73,7 @@ public interface FakeApi { @POST @Path("/fake/outer/number") - @Consumes({ "application/json" }) + @Consumes({ "text/plain" }) @Produces({ "*/*" }) @ApiOperation(value = "", tags={ "fake", }) @ApiResponses(value = { @@ -121,15 +121,15 @@ public interface FakeApi { public Client testClientModel(@Valid Client body); /** - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * */ @POST @Path("/fake") @Consumes({ "application/x-www-form-urlencoded" }) - @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", tags={ "fake", }) + @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) @@ -182,9 +182,16 @@ public interface FakeApi { @GET @Path("/fake/jsonFormData") @Consumes({ "application/x-www-form-urlencoded" }) - @ApiOperation(value = "test json serialization of form data", tags={ "fake" }) + @ApiOperation(value = "test json serialization of form data", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) public void testJsonFormData(@Multipart(value = "param") String param, @Multipart(value = "param2") String param2); + + @PUT + @Path("/fake/test-query-paramters") + @ApiOperation(value = "", tags={ "fake" }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) + public void testQueryParameterCollectionFormat(@QueryParam("pipe") @NotNull List pipe, @QueryParam("ioutil") @NotNull List ioutil, @QueryParam("http") @NotNull List http, @QueryParam("url") @NotNull List url, @QueryParam("context") @NotNull List context); } diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/api/PetApi.java index 0499feff7e93..8a6246e339f1 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/api/PetApi.java @@ -6,6 +6,7 @@ import java.util.Map; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import java.util.Set; import java.io.InputStream; import java.io.OutputStream; @@ -85,9 +86,9 @@ public interface PetApi { @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Finds Pets by tags", tags={ "pet", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), @ApiResponse(code = 400, message = "Invalid tag value") }) - public List findPetsByTags(@QueryParam("tags") @NotNull List tags); + public Set findPetsByTags(@QueryParam("tags") @NotNull Set tags); /** * Find pet by ID diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 8d1b429f421a..f17083be06cc 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -16,6 +16,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class AdditionalPropertiesAnyType extends HashMap { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java index 067459cbce6a..8c0fbc0652f0 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -17,6 +17,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class AdditionalPropertiesArray extends HashMap { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java index c4a6acccab76..6fff7947b819 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -16,6 +16,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class AdditionalPropertiesBoolean extends HashMap { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index 467dd334dd11..b8326103de49 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class AdditionalPropertiesClass { @ApiModelProperty(value = "") @@ -50,16 +51,13 @@ public class AdditionalPropertiesClass { private Map> mapMapAnytype = null; @ApiModelProperty(value = "") - @Valid - private Object anytype1 = null; + private Object anytype1; @ApiModelProperty(value = "") - @Valid - private Object anytype2 = null; + private Object anytype2; @ApiModelProperty(value = "") - @Valid - private Object anytype3 = null; + private Object anytype3; /** * Get mapString * @return mapString diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java index 9791c19d3e1d..83e8a3130dc6 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -16,6 +16,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class AdditionalPropertiesInteger extends HashMap { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java index c98d535e07ee..3959c6a0d73f 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -17,6 +17,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class AdditionalPropertiesNumber extends HashMap { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java index 949eec2955cf..efbae205e250 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -16,6 +16,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class AdditionalPropertiesObject extends HashMap { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java index cdc65a2c3a49..91537d4689d3 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java @@ -16,6 +16,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class AdditionalPropertiesString extends HashMap { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Animal.java index 1da3838e1940..b0fab9fb5487 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Animal.java @@ -20,7 +20,9 @@ @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) + public class Animal { @ApiModelProperty(required = true, value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index b30ac2cddbaf..0593a095489b 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -17,6 +17,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class ArrayOfArrayOfNumberOnly { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java index 89edc0079e7f..ce65055a7f20 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -17,6 +17,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class ArrayOfNumberOnly { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayTest.java index 88d5c73521d8..b8781d69cb4a 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayTest.java @@ -17,6 +17,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class ArrayTest { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/BigCat.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/BigCat.java new file mode 100644 index 000000000000..66ef35290b33 --- /dev/null +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/BigCat.java @@ -0,0 +1,104 @@ +package org.openapitools.model; + +import org.openapitools.model.BigCatAllOf; +import org.openapitools.model.Cat; +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.JsonFormat; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class BigCat extends Cat { + +@XmlType(name="KindEnum") +@XmlEnum(String.class) +public enum KindEnum { + + @XmlEnumValue("lions") @JsonProperty("lions") LIONS(String.valueOf("lions")), + @XmlEnumValue("tigers") @JsonProperty("tigers") TIGERS(String.valueOf("tigers")), + @XmlEnumValue("leopards") @JsonProperty("leopards") LEOPARDS(String.valueOf("leopards")), + @XmlEnumValue("jaguars") @JsonProperty("jaguars") JAGUARS(String.valueOf("jaguars")); + + private String value; + + KindEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + @ApiModelProperty(value = "") + private KindEnum kind; + /** + * Get kind + * @return kind + */ + @JsonProperty("kind") + public String getKind() { + return kind == null ? null : kind.value(); + } + + /** + * Sets the kind property. + */ + public void setKind(KindEnum kind) { + this.kind = kind; + } + + /** + * Sets the kind property. + */ + public BigCat kind(KindEnum kind) { + this.kind = kind; + return this; + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + 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-test-data/src/gen/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/BigCatAllOf.java new file mode 100644 index 000000000000..41fe3749854e --- /dev/null +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/BigCatAllOf.java @@ -0,0 +1,102 @@ +package org.openapitools.model; + +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.JsonFormat; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class BigCatAllOf { + +@XmlType(name="KindEnum") +@XmlEnum(String.class) +public enum KindEnum { + + @XmlEnumValue("lions") @JsonProperty("lions") LIONS(String.valueOf("lions")), + @XmlEnumValue("tigers") @JsonProperty("tigers") TIGERS(String.valueOf("tigers")), + @XmlEnumValue("leopards") @JsonProperty("leopards") LEOPARDS(String.valueOf("leopards")), + @XmlEnumValue("jaguars") @JsonProperty("jaguars") JAGUARS(String.valueOf("jaguars")); + + private String value; + + KindEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + @ApiModelProperty(value = "") + private KindEnum kind; + /** + * Get kind + * @return kind + */ + @JsonProperty("kind") + public String getKind() { + return kind == null ? null : kind.value(); + } + + /** + * Sets the kind property. + */ + public void setKind(KindEnum kind) { + this.kind = kind; + } + + /** + * Sets the kind property. + */ + public BigCatAllOf kind(KindEnum kind) { + this.kind = kind; + return this; + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + 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-test-data/src/gen/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Capitalization.java index 899f4b5e5d72..74fbb2eb6928 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Capitalization.java @@ -14,6 +14,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class Capitalization { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Cat.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Cat.java index 83b49a63e37b..9a9a80e5c670 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Cat.java @@ -1,6 +1,7 @@ package org.openapitools.model; import org.openapitools.model.Animal; +import org.openapitools.model.CatAllOf; import javax.validation.constraints.*; import javax.validation.Valid; @@ -15,6 +16,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class Cat extends Animal { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/CatAllOf.java new file mode 100644 index 000000000000..1f1b1313decd --- /dev/null +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/CatAllOf.java @@ -0,0 +1,68 @@ +package org.openapitools.model; + +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.JsonFormat; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class CatAllOf { + + @ApiModelProperty(value = "") + private Boolean declawed; + /** + * Get declawed + * @return declawed + */ + @JsonProperty("declawed") + public Boolean getDeclawed() { + return declawed; + } + + /** + * Sets the declawed property. + */ + public void setDeclawed(Boolean declawed) { + this.declawed = declawed; + } + + /** + * Sets the declawed property. + */ + public CatAllOf declawed(Boolean declawed) { + this.declawed = declawed; + return this; + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CatAllOf {\n"); + + sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Category.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Category.java index c7bfb3b253e3..d210c55b9e5e 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Category.java @@ -14,6 +14,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class Category { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ClassModel.java index 105ecc2e7caf..7e8fb51d09fb 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ClassModel.java @@ -20,6 +20,7 @@ * Model for testing model with \"_class\" property */ @ApiModel(description="Model for testing model with \"_class\" property") + public class ClassModel { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Client.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Client.java index dc7323ea4141..ce2f2f0d93b1 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Client.java @@ -14,6 +14,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class Client { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Dog.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Dog.java index e9d8e2ba5416..01b3ec86bb73 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Dog.java @@ -1,6 +1,7 @@ package org.openapitools.model; import org.openapitools.model.Animal; +import org.openapitools.model.DogAllOf; import javax.validation.constraints.*; import javax.validation.Valid; @@ -15,6 +16,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class Dog extends Animal { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/DogAllOf.java new file mode 100644 index 000000000000..46cd4a6004fe --- /dev/null +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/DogAllOf.java @@ -0,0 +1,68 @@ +package org.openapitools.model; + +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.JsonFormat; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class DogAllOf { + + @ApiModelProperty(value = "") + private String breed; + /** + * Get breed + * @return breed + */ + @JsonProperty("breed") + public String getBreed() { + return breed; + } + + /** + * Sets the breed property. + */ + public void setBreed(String breed) { + this.breed = breed; + } + + /** + * Sets the breed property. + */ + public DogAllOf breed(String breed) { + this.breed = breed; + return this; + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DogAllOf {\n"); + + sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/EnumArrays.java index 2104f50c0723..42b40db73f3e 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/EnumArrays.java @@ -16,6 +16,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class EnumArrays { @XmlType(name="JustSymbolEnum") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/EnumTest.java index a8cce324ae65..6b1538b66a6b 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/EnumTest.java @@ -15,6 +15,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class EnumTest { @XmlType(name="EnumStringEnum") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index 8d3da8aa0336..f337973b30f6 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -16,11 +16,12 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class FileSchemaTestClass { @ApiModelProperty(value = "") @Valid - private java.io.File file = null; + private java.io.File file; @ApiModelProperty(value = "") @Valid diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/FormatTest.java index c354e724d590..b75f5241ee78 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/FormatTest.java @@ -19,6 +19,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class FormatTest { @ApiModelProperty(value = "") @@ -62,6 +63,9 @@ public class FormatTest { @ApiModelProperty(required = true, value = "") private String password; + + @ApiModelProperty(value = "") + private BigDecimal bigDecimal; /** * Get integer * minimum: 10 @@ -388,6 +392,30 @@ public FormatTest password(String password) { return this; } + /** + * Get bigDecimal + * @return bigDecimal + */ + @JsonProperty("BigDecimal") + public BigDecimal getBigDecimal() { + return bigDecimal; + } + + /** + * Sets the bigDecimal property. + */ + public void setBigDecimal(BigDecimal bigDecimal) { + this.bigDecimal = bigDecimal; + } + + /** + * Sets the bigDecimal property. + */ + public FormatTest bigDecimal(BigDecimal bigDecimal) { + this.bigDecimal = bigDecimal; + return this; + } + @Override public String toString() { @@ -407,6 +435,7 @@ public String toString() { sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" bigDecimal: ").append(toIndentedString(bigDecimal)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java index e615164235c8..3c7f368696d6 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -14,6 +14,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class HasOnlyReadOnly { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/MapTest.java index 8714ac4adadd..a5fe34ef0158 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/MapTest.java @@ -3,7 +3,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.openapitools.model.StringBooleanMap; import javax.validation.constraints.*; import javax.validation.Valid; @@ -18,6 +17,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class MapTest { @ApiModelProperty(value = "") @@ -63,8 +63,7 @@ public static InnerEnum fromValue(String value) { private Map directMap = null; @ApiModelProperty(value = "") - @Valid - private StringBooleanMap indirectMap = new StringBooleanMap(); + private Map indirectMap = null; /** * Get mapMapOfString * @return mapMapOfString @@ -166,25 +165,33 @@ public MapTest putDirectMapItem(String key, Boolean directMapItem) { * @return indirectMap */ @JsonProperty("indirect_map") - public StringBooleanMap getIndirectMap() { + public Map getIndirectMap() { return indirectMap; } /** * Sets the indirectMap property. */ - public void setIndirectMap(StringBooleanMap indirectMap) { + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } /** * Sets the indirectMap property. */ - public MapTest indirectMap(StringBooleanMap indirectMap) { + public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; return this; } + /** + * Puts a new item into the indirectMap map. + */ + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + this.indirectMap.put(key, indirectMapItem); + return this; + } + @Override public String toString() { diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index f8323b7e7667..892306b389f8 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class MixedPropertiesAndAdditionalPropertiesClass { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Model200Response.java index 8bda567b99b7..d4a36c37f370 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Model200Response.java @@ -20,6 +20,7 @@ * Model for testing model name starting with number */ @ApiModel(description="Model for testing model name starting with number") + public class Model200Response { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ModelApiResponse.java index 3f24ce9a87c2..b3f9be6ca8ef 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -14,6 +14,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class ModelApiResponse { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ModelReturn.java index a339f3b086a2..2a7cb4552345 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ModelReturn.java @@ -20,6 +20,7 @@ * Model for testing reserved words */ @ApiModel(description="Model for testing reserved words") + public class ModelReturn { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Name.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Name.java index e8bf282ad11f..341dd203a69f 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Name.java @@ -20,6 +20,7 @@ * Model for testing model name same as property name */ @ApiModel(description="Model for testing model name same as property name") + public class Name { @ApiModelProperty(required = true, value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/NumberOnly.java index 59b9db7ff8d5..1204458a9b10 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/NumberOnly.java @@ -15,6 +15,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class NumberOnly { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Order.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Order.java index 09d6b24775ad..03954f7ba6ea 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Order.java @@ -15,6 +15,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class Order { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/OuterComposite.java index bdc1aaca2f7e..2274591cee4f 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/OuterComposite.java @@ -15,6 +15,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class OuterComposite { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Pet.java index ea553b6b5592..216beffbf974 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Pet.java @@ -1,7 +1,9 @@ package org.openapitools.model; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.model.Category; import org.openapitools.model.Tag; import javax.validation.constraints.*; @@ -18,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class Pet { @ApiModelProperty(value = "") @@ -25,13 +28,13 @@ public class Pet { @ApiModelProperty(value = "") @Valid - private Category category = null; + private Category category; @ApiModelProperty(example = "doggie", required = true, value = "") private String name; @ApiModelProperty(required = true, value = "") - private List photoUrls = new ArrayList<>(); + private Set photoUrls = new LinkedHashSet<>(); @ApiModelProperty(value = "") @Valid @@ -154,21 +157,21 @@ public Pet name(String name) { */ @JsonProperty("photoUrls") @NotNull - public List getPhotoUrls() { + public Set getPhotoUrls() { return photoUrls; } /** * Sets the photoUrls property. */ - public void setPhotoUrls(List photoUrls) { + public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } /** * Sets the photoUrls property. */ - public Pet photoUrls(List photoUrls) { + public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; return this; } diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ReadOnlyFirst.java index f265ecabd172..3626bcf31a68 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ReadOnlyFirst.java @@ -14,6 +14,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class ReadOnlyFirst { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/SpecialModelName.java index 97b4ab49274e..e072c1d8c314 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/SpecialModelName.java @@ -14,6 +14,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class SpecialModelName { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Tag.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Tag.java index 3c1cc5afe270..e65e4f5cfa62 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Tag.java @@ -14,6 +14,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class Tag { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/TypeHolderDefault.java index 54f512a9a845..62e2db250a88 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/TypeHolderDefault.java @@ -17,6 +17,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class TypeHolderDefault { @ApiModelProperty(required = true, value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/TypeHolderExample.java index a94ba528deb1..1cdfe3a90478 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/TypeHolderExample.java @@ -17,6 +17,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class TypeHolderExample { @ApiModelProperty(example = "what", required = true, value = "") @@ -26,6 +27,9 @@ public class TypeHolderExample { @Valid private BigDecimal numberItem; + @ApiModelProperty(example = "1.234", required = true, value = "") + private Float floatItem; + @ApiModelProperty(example = "-2", required = true, value = "") private Integer integerItem; @@ -84,6 +88,31 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { return this; } + /** + * Get floatItem + * @return floatItem + */ + @JsonProperty("float_item") + @NotNull + public Float getFloatItem() { + return floatItem; + } + + /** + * Sets the floatItem property. + */ + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + + /** + * Sets the floatItem property. + */ + public TypeHolderExample floatItem(Float floatItem) { + this.floatItem = floatItem; + return this; + } + /** * Get integerItem * @return integerItem @@ -175,6 +204,7 @@ public String toString() { sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/User.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/User.java index 232586cec731..5005cb8b4856 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/User.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/User.java @@ -14,6 +14,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class User { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/XmlItem.java index 5f5af932236e..4d5b2c85b602 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/XmlItem.java @@ -17,6 +17,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class XmlItem { @ApiModelProperty(example = "string", value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java index 6ebd879ad571..f9d503c40fa0 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java @@ -35,7 +35,7 @@ public class AnotherFakeApiServiceImpl implements AnotherFakeApi { { try { File cacheFile = new File(System.getProperty("jaxrs.test.server.json", - "/home/tduperron/git/zomzog/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); + "/Users/jim/projects/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); cache = JsonCache.Factory.instance.get("test-data").load(cacheFile).child("/org.openapitools.api/AnotherFakeApi"); } catch (CacheException e) { e.printStackTrace(); diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java index 2d987e5a1cd1..1727da789976 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java @@ -43,7 +43,7 @@ public class FakeApiServiceImpl implements FakeApi { { try { File cacheFile = new File(System.getProperty("jaxrs.test.server.json", - "/home/tduperron/git/zomzog/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); + "/Users/jim/projects/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); cache = JsonCache.Factory.instance.get("test-data").load(cacheFile).child("/org.openapitools.api/FakeApi"); } catch (CacheException e) { e.printStackTrace(); @@ -128,9 +128,9 @@ public Client testClientModel(Client body) { } /** - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * */ @Override @@ -178,4 +178,9 @@ public void testJsonFormData(String param, String param2) { } + @Override + public void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context) { + + } + } diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/FakeClassnameTags123ApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/FakeClassnameTags123ApiServiceImpl.java index 4440d69a1ea3..d59054f6df56 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/FakeClassnameTags123ApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/FakeClassnameTags123ApiServiceImpl.java @@ -35,7 +35,7 @@ public class FakeClassnameTags123ApiServiceImpl implements FakeClassnameTags123A { try { File cacheFile = new File(System.getProperty("jaxrs.test.server.json", - "/home/tduperron/git/zomzog/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); + "/Users/jim/projects/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); cache = JsonCache.Factory.instance.get("test-data").load(cacheFile).child("/org.openapitools.api/FakeClassnameTags123Api"); } catch (CacheException e) { e.printStackTrace(); diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java index 19dbdf663104..eccd2f17f23d 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java @@ -7,6 +7,7 @@ import java.util.Map; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import java.util.Set; import java.io.InputStream; import java.io.OutputStream; @@ -38,7 +39,7 @@ public class PetApiServiceImpl implements PetApi { { try { File cacheFile = new File(System.getProperty("jaxrs.test.server.json", - "/home/tduperron/git/zomzog/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); + "/Users/jim/projects/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); cache = JsonCache.Factory.instance.get("test-data").load(cacheFile).child("/org.openapitools.api/PetApi"); } catch (CacheException e) { e.printStackTrace(); @@ -86,9 +87,9 @@ public List findPetsByStatus(List status) { * */ @Override - public List findPetsByTags(List tags) { + public Set findPetsByTags(Set tags) { try { - List response = cache.getObjects("/findPetsByTags/response", Pet.class); + Set response = cache.getObjects("/findPetsByTags/response", Pet.class); return response; } catch (CacheException e) { throw new RuntimeException(e); diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java index 3de4afe148ea..b03f1b76e9b6 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java @@ -35,7 +35,7 @@ public class StoreApiServiceImpl implements StoreApi { { try { File cacheFile = new File(System.getProperty("jaxrs.test.server.json", - "/home/tduperron/git/zomzog/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); + "/Users/jim/projects/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); cache = JsonCache.Factory.instance.get("test-data").load(cacheFile).child("/org.openapitools.api/StoreApi"); } catch (CacheException e) { e.printStackTrace(); diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java index 0d97bd614bb1..29a22c8a6449 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java @@ -35,7 +35,7 @@ public class UserApiServiceImpl implements UserApi { { try { File cacheFile = new File(System.getProperty("jaxrs.test.server.json", - "/home/tduperron/git/zomzog/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); + "/Users/jim/projects/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); cache = JsonCache.Factory.instance.get("test-data").load(cacheFile).child("/org.openapitools.api/UserApi"); } catch (CacheException e) { e.printStackTrace(); diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json b/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json index e32a76dd3ff1..15bbf124cf18 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json @@ -79,7 +79,7 @@ } }, "testEndpointParameters" : { - "_double" : 91.68589154730602421612164906388358076583244837820529937744140625, + "_double" : 91.68589154730603, "patternWithoutDelimiter" : "^K᫢", "_byte" : "VA==", "integer" : 79, @@ -118,6 +118,13 @@ "testJsonFormData" : { "param" : "Gfe588Q6", "param2" : "QBx28IQ" + }, + "testQueryParameterCollectionFormat" : { + "pipe" : [ "tCOmW" ], + "ioutil" : [ "iy6kr" ], + "http" : [ "yoZlS" ], + "url" : [ "zBeSEe" ], + "context" : [ "SP17wCv8k2" ] } }, "FakeClassnameTags123Api" : { diff --git a/samples/server/petstore/jaxrs-cxf-test-data/test-data-control.json b/samples/server/petstore/jaxrs-cxf-test-data/test-data-control.json index f368ad41cfc0..8f15d268abd5 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/test-data-control.json +++ b/samples/server/petstore/jaxrs-cxf-test-data/test-data-control.json @@ -59,6 +59,23 @@ "param" : { "testItemCount" : 1 } + }, + "testQueryParameterCollectionFormat" : { + "pipe" : { + "testItemCount" : 1 + }, + "ioutil" : { + "testItemCount" : 1 + }, + "http" : { + "testItemCount" : 1 + }, + "url" : { + "testItemCount" : 1 + }, + "context" : { + "testItemCount" : 1 + } } }, "PetApi" : { diff --git a/samples/server/petstore/jaxrs-cxf/.openapi-generator/FILES b/samples/server/petstore/jaxrs-cxf/.openapi-generator/FILES index 4a4efad8b2e6..84f22716a35a 100644 --- a/samples/server/petstore/jaxrs-cxf/.openapi-generator/FILES +++ b/samples/server/petstore/jaxrs-cxf/.openapi-generator/FILES @@ -52,15 +52,3 @@ src/gen/java/org/openapitools/model/TypeHolderDefault.java src/gen/java/org/openapitools/model/TypeHolderExample.java src/gen/java/org/openapitools/model/User.java src/gen/java/org/openapitools/model/XmlItem.java -src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java -src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java -src/main/java/org/openapitools/api/impl/FakeClassnameTags123ApiServiceImpl.java -src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java -src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java -src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java -src/test/java/org/openapitools/api/AnotherFakeApiTest.java -src/test/java/org/openapitools/api/FakeApiTest.java -src/test/java/org/openapitools/api/FakeClassnameTags123ApiTest.java -src/test/java/org/openapitools/api/PetApiTest.java -src/test/java/org/openapitools/api/StoreApiTest.java -src/test/java/org/openapitools/api/UserApiTest.java diff --git a/samples/server/petstore/jaxrs-resteasy/eap-java8/.openapi-generator/FILES b/samples/server/petstore/jaxrs-resteasy/eap-java8/.openapi-generator/FILES index 0fd81a975dc5..1a1af30150d5 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-java8/.openapi-generator/FILES +++ b/samples/server/petstore/jaxrs-resteasy/eap-java8/.openapi-generator/FILES @@ -1,4 +1,3 @@ -.openapi-generator-ignore README.md build.gradle pom.xml diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/.openapi-generator/FILES b/samples/server/petstore/jaxrs-resteasy/eap-joda/.openapi-generator/FILES index 0fd81a975dc5..1a1af30150d5 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-joda/.openapi-generator/FILES +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/.openapi-generator/FILES @@ -1,4 +1,3 @@ -.openapi-generator-ignore README.md build.gradle pom.xml diff --git a/samples/server/petstore/jaxrs-resteasy/eap/.openapi-generator/FILES b/samples/server/petstore/jaxrs-resteasy/eap/.openapi-generator/FILES index 0fd81a975dc5..1a1af30150d5 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap/.openapi-generator/FILES +++ b/samples/server/petstore/jaxrs-resteasy/eap/.openapi-generator/FILES @@ -1,4 +1,3 @@ -.openapi-generator-ignore README.md build.gradle pom.xml diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/.openapi-generator/FILES b/samples/server/petstore/jaxrs/jersey1-useTags/.openapi-generator/FILES index 45a534ea304e..bacc5f1e6115 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/.openapi-generator/FILES +++ b/samples/server/petstore/jaxrs/jersey1-useTags/.openapi-generator/FILES @@ -1,4 +1,3 @@ -.openapi-generator-ignore README.md pom.xml src/gen/java/org/openapitools/api/AnotherFakeApi.java diff --git a/samples/server/petstore/jaxrs/jersey1/.openapi-generator/FILES b/samples/server/petstore/jaxrs/jersey1/.openapi-generator/FILES index c15cd09f8b30..3d66ff3429ea 100644 --- a/samples/server/petstore/jaxrs/jersey1/.openapi-generator/FILES +++ b/samples/server/petstore/jaxrs/jersey1/.openapi-generator/FILES @@ -1,4 +1,3 @@ -.openapi-generator-ignore README.md pom.xml src/gen/java/org/openapitools/api/AnotherFakeApi.java diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/.openapi-generator/FILES b/samples/server/petstore/jaxrs/jersey2-useTags/.openapi-generator/FILES index 45a534ea304e..bacc5f1e6115 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/.openapi-generator/FILES +++ b/samples/server/petstore/jaxrs/jersey2-useTags/.openapi-generator/FILES @@ -1,4 +1,3 @@ -.openapi-generator-ignore README.md pom.xml src/gen/java/org/openapitools/api/AnotherFakeApi.java diff --git a/samples/server/petstore/jaxrs/jersey2/.openapi-generator/FILES b/samples/server/petstore/jaxrs/jersey2/.openapi-generator/FILES index c15cd09f8b30..3d66ff3429ea 100644 --- a/samples/server/petstore/jaxrs/jersey2/.openapi-generator/FILES +++ b/samples/server/petstore/jaxrs/jersey2/.openapi-generator/FILES @@ -1,4 +1,3 @@ -.openapi-generator-ignore README.md pom.xml src/gen/java/org/openapitools/api/AnotherFakeApi.java diff --git a/samples/server/petstore/kotlin-server/ktor/.openapi-generator-ignore b/samples/server/petstore/kotlin-server/ktor/.openapi-generator-ignore index 7484ee590a38..cabbe3494d4c 100644 --- a/samples/server/petstore/kotlin-server/ktor/.openapi-generator-ignore +++ b/samples/server/petstore/kotlin-server/ktor/.openapi-generator-ignore @@ -1,23 +1,3 @@ # OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator +pom.xml -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/server/petstore/kotlin-springboot-reactive/.openapi-generator/FILES b/samples/server/petstore/kotlin-springboot-reactive/.openapi-generator/FILES index ef3bba2490db..e48401e8ff47 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/.openapi-generator/FILES +++ b/samples/server/petstore/kotlin-springboot-reactive/.openapi-generator/FILES @@ -1,4 +1,3 @@ -.openapi-generator-ignore README.md build.gradle.kts pom.xml @@ -21,6 +20,3 @@ src/main/kotlin/org/openapitools/model/Pet.kt src/main/kotlin/org/openapitools/model/Tag.kt src/main/kotlin/org/openapitools/model/User.kt src/main/resources/application.yaml -src/test/kotlin/org/openapitools/api/PetApiTest.kt -src/test/kotlin/org/openapitools/api/StoreApiTest.kt -src/test/kotlin/org/openapitools/api/UserApiTest.kt diff --git a/samples/server/petstore/kotlin-springboot/.openapi-generator/FILES b/samples/server/petstore/kotlin-springboot/.openapi-generator/FILES index 039f0b90538f..612ea14bbdb4 100644 --- a/samples/server/petstore/kotlin-springboot/.openapi-generator/FILES +++ b/samples/server/petstore/kotlin-springboot/.openapi-generator/FILES @@ -1,4 +1,3 @@ -.openapi-generator-ignore README.md build.gradle.kts pom.xml @@ -22,6 +21,3 @@ src/main/kotlin/org/openapitools/model/Pet.kt src/main/kotlin/org/openapitools/model/Tag.kt src/main/kotlin/org/openapitools/model/User.kt src/main/resources/application.yaml -src/test/kotlin/org/openapitools/api/PetApiTest.kt -src/test/kotlin/org/openapitools/api/StoreApiTest.kt -src/test/kotlin/org/openapitools/api/UserApiTest.kt diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator/FILES b/samples/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator/FILES index c99e0a880afb..b00a0510b77f 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator/FILES +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator/FILES @@ -18,21 +18,11 @@ ./Service/SymfonyValidator.php ./Service/TypeMismatchException.php ./Service/ValidatorInterface.php -./Tests/Api/PetApiInterfaceTest.php -./Tests/Api/StoreApiInterfaceTest.php -./Tests/Api/UserApiInterfaceTest.php ./Tests/AppKernel.php ./Tests/Controller/ControllerTest.php -./Tests/Model/ApiResponseTest.php -./Tests/Model/CategoryTest.php -./Tests/Model/OrderTest.php -./Tests/Model/PetTest.php -./Tests/Model/TagTest.php -./Tests/Model/UserTest.php ./Tests/test_config.yml .coveralls.yml .gitignore -.openapi-generator-ignore .php_cs.dist .travis.yml DependencyInjection/Compiler/OpenAPIServerApiPass.php diff --git a/samples/server/petstore/python-aiohttp-srclayout/.openapi-generator/FILES b/samples/server/petstore/python-aiohttp-srclayout/.openapi-generator/FILES index c59fff5c1b7f..ce2928201ef6 100644 --- a/samples/server/petstore/python-aiohttp-srclayout/.openapi-generator/FILES +++ b/samples/server/petstore/python-aiohttp-srclayout/.openapi-generator/FILES @@ -1,5 +1,4 @@ .gitignore -.openapi-generator-ignore README.md requirements.txt setup.py @@ -24,7 +23,4 @@ src/openapi_server/util.py test-requirements.txt tests/__init__.py tests/conftest.py -tests/test_pet_controller.py -tests/test_store_controller.py -tests/test_user_controller.py tox.ini diff --git a/samples/server/petstore/python-aiohttp/.openapi-generator/FILES b/samples/server/petstore/python-aiohttp/.openapi-generator/FILES index 416ab8ac6d75..a4ced008df60 100644 --- a/samples/server/petstore/python-aiohttp/.openapi-generator/FILES +++ b/samples/server/petstore/python-aiohttp/.openapi-generator/FILES @@ -1,5 +1,4 @@ .gitignore -.openapi-generator-ignore README.md openapi_server/__init__.py openapi_server/__main__.py @@ -24,7 +23,4 @@ setup.py test-requirements.txt tests/__init__.py tests/conftest.py -tests/test_pet_controller.py -tests/test_store_controller.py -tests/test_user_controller.py tox.ini diff --git a/samples/server/petstore/python-blueplanet/.openapi-generator/FILES b/samples/server/petstore/python-blueplanet/.openapi-generator/FILES index 2bc24d1ef363..129ea61cb4db 100644 --- a/samples/server/petstore/python-blueplanet/.openapi-generator/FILES +++ b/samples/server/petstore/python-blueplanet/.openapi-generator/FILES @@ -1,4 +1,3 @@ -.openapi-generator-ignore Makefile Makefile README.md diff --git a/samples/server/petstore/python-flask-python2/.openapi-generator/FILES b/samples/server/petstore/python-flask-python2/.openapi-generator/FILES index 57965000fd74..2d71840efc01 100644 --- a/samples/server/petstore/python-flask-python2/.openapi-generator/FILES +++ b/samples/server/petstore/python-flask-python2/.openapi-generator/FILES @@ -1,6 +1,5 @@ .dockerignore .gitignore -.openapi-generator-ignore .travis.yml Dockerfile README.md @@ -23,9 +22,6 @@ openapi_server/models/tag.py openapi_server/models/user.py openapi_server/openapi/openapi.yaml openapi_server/test/__init__.py -openapi_server/test/test_pet_controller.py -openapi_server/test/test_store_controller.py -openapi_server/test/test_user_controller.py openapi_server/typing_utils.py openapi_server/util.py requirements.txt diff --git a/samples/server/petstore/python-flask/.openapi-generator/FILES b/samples/server/petstore/python-flask/.openapi-generator/FILES index 57965000fd74..2d71840efc01 100644 --- a/samples/server/petstore/python-flask/.openapi-generator/FILES +++ b/samples/server/petstore/python-flask/.openapi-generator/FILES @@ -1,6 +1,5 @@ .dockerignore .gitignore -.openapi-generator-ignore .travis.yml Dockerfile README.md @@ -23,9 +22,6 @@ openapi_server/models/tag.py openapi_server/models/user.py openapi_server/openapi/openapi.yaml openapi_server/test/__init__.py -openapi_server/test/test_pet_controller.py -openapi_server/test/test_store_controller.py -openapi_server/test/test_user_controller.py openapi_server/typing_utils.py openapi_server/util.py requirements.txt diff --git a/samples/server/petstore/springboot-beanvalidation/.openapi-generator/FILES b/samples/server/petstore/springboot-beanvalidation/.openapi-generator/FILES index a46bb0e2e380..4bb76c23b2a2 100644 --- a/samples/server/petstore/springboot-beanvalidation/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-beanvalidation/.openapi-generator/FILES @@ -1,4 +1,3 @@ -.openapi-generator-ignore README.md pom.xml src/main/java/org/openapitools/OpenAPI2SpringBoot.java diff --git a/samples/server/petstore/springboot-delegate-j8/.openapi-generator/FILES b/samples/server/petstore/springboot-delegate-j8/.openapi-generator/FILES index f2551a2a0f55..8c36406da484 100644 --- a/samples/server/petstore/springboot-delegate-j8/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-delegate-j8/.openapi-generator/FILES @@ -1,4 +1,3 @@ -.openapi-generator-ignore README.md pom.xml src/main/java/org/openapitools/OpenAPI2SpringBoot.java diff --git a/samples/server/petstore/springboot-delegate/.openapi-generator/FILES b/samples/server/petstore/springboot-delegate/.openapi-generator/FILES index 1a1b7db872aa..751215bab5e1 100644 --- a/samples/server/petstore/springboot-delegate/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-delegate/.openapi-generator/FILES @@ -1,4 +1,3 @@ -.openapi-generator-ignore README.md pom.xml src/main/java/org/openapitools/OpenAPI2SpringBoot.java diff --git a/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES b/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES index 7facf652225f..61420a325e38 100644 --- a/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES @@ -1,4 +1,3 @@ -.openapi-generator-ignore README.md pom.xml src/main/java/org/openapitools/OpenAPI2SpringBoot.java diff --git a/samples/server/petstore/springboot-reactive/.openapi-generator/FILES b/samples/server/petstore/springboot-reactive/.openapi-generator/FILES index 6efa61ee0a66..9df6c44a3213 100644 --- a/samples/server/petstore/springboot-reactive/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-reactive/.openapi-generator/FILES @@ -1,4 +1,3 @@ -.openapi-generator-ignore README.md pom.xml src/main/java/org/openapitools/OpenAPI2SpringBoot.java diff --git a/samples/server/petstore/springboot-useoptional/.openapi-generator/FILES b/samples/server/petstore/springboot-useoptional/.openapi-generator/FILES index 7facf652225f..61420a325e38 100644 --- a/samples/server/petstore/springboot-useoptional/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-useoptional/.openapi-generator/FILES @@ -1,4 +1,3 @@ -.openapi-generator-ignore README.md pom.xml src/main/java/org/openapitools/OpenAPI2SpringBoot.java diff --git a/samples/server/petstore/springboot-virtualan/.openapi-generator/FILES b/samples/server/petstore/springboot-virtualan/.openapi-generator/FILES index ec6eea07cd2b..3a2d6eacf9db 100644 --- a/samples/server/petstore/springboot-virtualan/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-virtualan/.openapi-generator/FILES @@ -1,4 +1,3 @@ -.openapi-generator-ignore README.md pom.xml src/main/java/org/openapitools/OpenAPI2SpringBoot.java diff --git a/samples/server/petstore/springboot/.openapi-generator/FILES b/samples/server/petstore/springboot/.openapi-generator/FILES index 7facf652225f..61420a325e38 100644 --- a/samples/server/petstore/springboot/.openapi-generator/FILES +++ b/samples/server/petstore/springboot/.openapi-generator/FILES @@ -1,4 +1,3 @@ -.openapi-generator-ignore README.md pom.xml src/main/java/org/openapitools/OpenAPI2SpringBoot.java diff --git a/shippable.yml b/shippable.yml index c1bd579106a2..a5288e70b91b 100644 --- a/shippable.yml +++ b/shippable.yml @@ -43,12 +43,3 @@ build: - mix --version # test samples defined in pom.xml - mvn --no-snapshot-updates --quiet verify -P samples.shippable -Dmaven.javadoc.skip=true - # below moved to CircleCI - ## generate all petstore samples (client, servers, doc) - #- ./bin/run-all-petstore - ## generate all petstore samples (openapi3) - #- ./bin/openapi3/run-all-petstore - ## generate test scripts - #- ./bin/tests/run-all-test - ## test all generators with fake petstore spec (2.0, 3.0) - #- ./bin/utils/test-fake-petstore-for-all.sh