diff --git a/.gitignore b/.gitignore index be288357f94..4e650733033 100644 --- a/.gitignore +++ b/.gitignore @@ -89,6 +89,7 @@ samples/client/petstore/swift/SwaggerClientTests/Pods/Pods.xcodeproj/xcshareddat # C# *.csproj.user +samples/client/petstore/csharp/SwaggerClient/IO.Swagger.userprefs samples/client/petstore/csharp/SwaggerClientTest/.vs samples/client/petstore/csharp/SwaggerClientTest/obj samples/client/petstore/csharp/SwaggerClientTest/bin diff --git a/README.md b/README.md index 6e1a52bd483..37c12afe0eb 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ The OpenAPI Specification has undergone 3 revisions since initial creation in 20 Swagger Codegen Version | Release Date | OpenAPI Spec compatibility | Notes -------------------------- | ------------ | -------------------------- | ----- -2.1.7-SNAPSHOT | | 1.0, 1.1, 1.2, 2.0 | [master](https://github.com/swagger-api/swagger-codegen) +2.2.0-SNAPSHOT | | 1.0, 1.1, 1.2, 2.0 | [master](https://github.com/swagger-api/swagger-codegen) 2.1.6 (**current stable**) | 2016-04-06 | 1.0, 1.1, 1.2, 2.0 | [tag v2.1.6](https://github.com/swagger-api/swagger-codegen/tree/v2.1.6) 2.0.17 | 2014-08-22 | 1.1, 1.2 | [tag v2.0.17](https://github.com/swagger-api/swagger-codegen/tree/v2.0.17) 1.0.4 | 2012-04-12 | 1.0, 1.1 | [tag v1.0.4](https://github.com/swagger-api/swagger-codegen/tree/swagger-codegen_2.9.1-1.1) @@ -408,6 +408,44 @@ java -Dapis -DmodelTests=false {opts} When using selective generation, _only_ the templates needed for the specific generation will be used. +### Ignore file format + +Swagger codegen supports a `.swagger-codegen-ignore` file, similar to `.gitignore` or `.dockerignore` you're probably already familiar with. + +The ignore file allows for better control over overwriting existing files than the `--skip-overwrite` flag. With the ignore file, you can specify individual files or directories can be ignored. This can be useful, for example if you only want a subset of the generated code. + +Examples: + +``` +# Swagger Codegen Ignore +# Lines beginning with a # are comments + +# This should match build.sh located anywhere. +build.sh + +# Matches build.sh in the root +/build.sh + +# Exclude all recursively +docs/** + +# Explicitly allow files excluded by other rules +!docs/UserApi.md + +# Recursively exclude directories named Api +# You can't negate files below this directory. +src/**/Api/ + +# When this file is nested under /Api (excluded above), +# this rule is ignored because parent directory is excluded by previous rule. +!src/**/PetApiTests.cs + +# Exclude a single, nested file explicitly +src/IO.Swagger.Test/Model/AnimalFarmTests.cs +``` + +The `.swagger-codegen-ignore` file must exist in the root of the output directory. + ### Customizing the generator There are different aspects of customizing the code generator beyond just creating or modifying templates. Each language has a supporting configuration file to handle different type mappings, etc: @@ -814,6 +852,7 @@ Here are some companies/projects using Swagger Codegen in production. To add you - [Cachet Financial](http://www.cachetfinancial.com/) - [CloudBoost](https://www.CloudBoost.io/) - [Cupix](http://www.cupix.com) +- [DBBest Technologies](https://www.dbbest.com) - [DocuSign](https://www.docusign.com) - [Ergon](http://www.ergon.ch/) - [eureka](http://eure.jp/) @@ -824,6 +863,7 @@ Here are some companies/projects using Swagger Codegen in production. To add you - [Interactive Intelligence](http://developer.mypurecloud.com/) - [LANDR Audio](https://www.landr.com/) - [LiveAgent](https://www.ladesk.com/) +- [Kabuku](http://www.kabuku.co.jp/en) - [Kuary](https://kuary.com/) - [nViso](http://www.nviso.ch/) - [Okiok](https://www.okiok.com) @@ -836,6 +876,7 @@ Here are some companies/projects using Swagger Codegen in production. To add you - [REstore](https://www.restore.eu) - [Revault Sàrl](http://revault.ch) - [Royal Bank of Canada (RBC)](http://www.rbc.com/canada.html) +- [SCOOP Software GmbH](http://www.scoop-software.de) - [SmartRecruiters](https://www.smartrecruiters.com/) - [StyleRecipe](http://stylerecipe.co.jp) - [Svenska Spel AB](https://www.svenskaspel.se/) diff --git a/bin/objc-petstore.sh b/bin/objc-petstore.sh index 513b7535786..df22ea3b595 100755 --- a/bin/objc-petstore.sh +++ b/bin/objc-petstore.sh @@ -26,6 +26,6 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ generate -t modules/swagger-codegen/src/main/resources/objc -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l objc -o samples/client/petstore/objc" +ags="$@ generate -t modules/swagger-codegen/src/main/resources/objc -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l objc -o samples/client/petstore/objc --additional-properties coreData=true" java -DappName=PetstoreClient $JAVA_OPTS -jar $executable $ags diff --git a/bin/swift-petstore-promisekit.sh b/bin/swift-petstore-promisekit.sh index 0fe36cbf4a8..d2787a876a0 100755 --- a/bin/swift-petstore-promisekit.sh +++ b/bin/swift-petstore-promisekit.sh @@ -26,6 +26,6 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ generate -t modules/swagger-codegen/src/main/resources/swift -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l swift -c ./bin/swift-petstore-promisekit.json -o samples/client/petstore/swift-promisekit" +ags="$@ generate -t modules/swagger-codegen/src/main/resources/swift -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l swift -c ./bin/swift-petstore-promisekit.json -o samples/client/petstore/swift/promisekit" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/swift-petstore.sh b/bin/swift-petstore.sh index 96433e5b72d..3747b3adca4 100644 --- a/bin/swift-petstore.sh +++ b/bin/swift-petstore.sh @@ -26,6 +26,6 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ generate -t modules/swagger-codegen/src/main/resources/swift -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l swift -c ./bin/swift-petstore.json -o samples/client/petstore/swift" +ags="$@ generate -t modules/swagger-codegen/src/main/resources/swift -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l swift -c ./bin/swift-petstore.json -o samples/client/petstore/swift/default" java $JAVA_OPTS -jar $executable $ags diff --git a/modules/swagger-codegen-cli/pom.xml b/modules/swagger-codegen-cli/pom.xml index 90a14b16deb..92490778689 100644 --- a/modules/swagger-codegen-cli/pom.xml +++ b/modules/swagger-codegen-cli/pom.xml @@ -3,7 +3,7 @@ io.swagger swagger-codegen-project - 2.1.6 + 2.2.0-SNAPSHOT ../.. 4.0.0 @@ -100,4 +100,4 @@ - \ No newline at end of file + diff --git a/modules/swagger-codegen-maven-plugin/README.md b/modules/swagger-codegen-maven-plugin/README.md index 488148727b2..d9282c97ebf 100644 --- a/modules/swagger-codegen-maven-plugin/README.md +++ b/modules/swagger-codegen-maven-plugin/README.md @@ -48,6 +48,44 @@ mvn clean compile - `configOptions` - a map of language-specific parameters (see below) - `configHelp` - dumps the configuration help for the specified library (generates no sources) +### Custom Generator + +Specifying a custom generator is a bit different. It doesn't support the classpath:/ syntax, but it does support the fully qualified name of the package. You can also specify your custom templates, which also get pulled in. Notice the dependency on a project, in the plugin scope. That would be your generator/template jar. + +```xml + + io.swagger + swagger-codegen-maven-plugin + ${swagger-codegen-maven-plugin-version} + + + + generate + + + src/main/resources/yaml/yamlfilename.yaml + + com.my.package.for.GeneratorLanguage + myTemplateDir + + ${project.build.directory}/generated-sources + ${default.package}.handler + ${default.package}.model + ${default.package}.handler + + + + + + + com.my.generator + customgenerator + 1.0-SNAPSHOT + + + +``` + ### Sample configuration -- Please see [an example configuration](examples) for using the plugin \ No newline at end of file +- Please see [an example configuration](examples) for using the plugin diff --git a/modules/swagger-codegen-maven-plugin/pom.xml b/modules/swagger-codegen-maven-plugin/pom.xml index b45e0d97874..0b6885bf048 100644 --- a/modules/swagger-codegen-maven-plugin/pom.xml +++ b/modules/swagger-codegen-maven-plugin/pom.xml @@ -6,7 +6,7 @@ io.swagger swagger-codegen-project - 2.1.6 + 2.2.0-SNAPSHOT ../.. swagger-codegen-maven-plugin diff --git a/modules/swagger-codegen/pom.xml b/modules/swagger-codegen/pom.xml index b4defc425cb..8f7e98074de 100644 --- a/modules/swagger-codegen/pom.xml +++ b/modules/swagger-codegen/pom.xml @@ -3,7 +3,7 @@ io.swagger swagger-codegen-project - 2.1.6 + 2.2.0-SNAPSHOT ../.. 4.0.0 diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java index 7623899f2a6..fceb69ac8db 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java @@ -792,6 +792,8 @@ public class DefaultCodegen { importMapping.put("LocalDate", "org.joda.time.*"); importMapping.put("LocalTime", "org.joda.time.*"); + supportingFiles.add(new GlobalSupportingFile("LICENSE", "LICENSE")); + cliOptions.add(CliOption.newBoolean(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG_DESC).defaultValue(Boolean.TRUE.toString())); cliOptions.add(CliOption.newBoolean(CodegenConstants.ENSURE_UNIQUE_PARAMS, CodegenConstants diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java index 769a6185336..6a489e45e52 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java @@ -530,9 +530,12 @@ public class DefaultGenerator extends AbstractGenerator implements Generator { LOGGER.info("Skipped overwriting " + outputFilename); continue; } - - String templateFile = getFullTemplateFile(config, support.templateFile); - + String templateFile; + if( support instanceof GlobalSupportingFile) { + templateFile = config.getCommonTemplateDir() + File.separator + support.templateFile; + } else { + templateFile = getFullTemplateFile(config, support.templateFile); + } boolean shouldGenerate = true; if(supportingFilesToGenerate != null && supportingFilesToGenerate.size() > 0) { if(supportingFilesToGenerate.contains(support.destinationFilename)) { @@ -605,6 +608,19 @@ public class DefaultGenerator extends AbstractGenerator implements Generator { } files.add(ignoreFile); } + + // Add default LICENSE (Apache-2.0) for all generators + final String apache2License = "LICENSE"; + String licenseFileNameTarget = config.outputFolder() + File.separator + apache2License; + File licenseFile = new File(licenseFileNameTarget); + String licenseFileNameSource = File.separator + config.getCommonTemplateDir() + File.separator + apache2License; + String licenseFileContents = readResourceContents(licenseFileNameSource); + try { + writeToFile(licenseFileNameTarget, licenseFileContents); + } catch (IOException e) { + throw new RuntimeException("Could not generate LICENSE file '" + apache2License + "'", e); + } + files.add(licenseFile); } config.processSwagger(swagger); return files; diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/GlobalSupportingFile.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/GlobalSupportingFile.java new file mode 100644 index 00000000000..ee7a1dc659b --- /dev/null +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/GlobalSupportingFile.java @@ -0,0 +1,12 @@ +package io.swagger.codegen; + +public class GlobalSupportingFile extends SupportingFile { + + GlobalSupportingFile(String templateFile, String folder, String destinationFilename) { + super(templateFile, folder, destinationFilename); + } + + GlobalSupportingFile(String templateFile, String destinationFilename) { + super(templateFile, destinationFilename); + } +} diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/SupportingFile.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/SupportingFile.java index e5fb6a27da6..74bee83ef24 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/SupportingFile.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/SupportingFile.java @@ -5,6 +5,10 @@ public class SupportingFile { public String folder; public String destinationFilename; + public SupportingFile(String templateFile, String destinationFilename) { + this(templateFile, "", destinationFilename); + } + public SupportingFile(String templateFile, String folder, String destinationFilename) { this.templateFile = templateFile; this.folder = folder; @@ -44,4 +48,6 @@ public class SupportingFile { result = 31 * result + (destinationFilename != null ? destinationFilename.hashCode() : 0); return result; } -} \ No newline at end of file +} + + diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/ignore/rules/DirectoryRule.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/ignore/rules/DirectoryRule.java index 2619f1f1c38..235d34d3f96 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/ignore/rules/DirectoryRule.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/ignore/rules/DirectoryRule.java @@ -1,20 +1,27 @@ package io.swagger.codegen.ignore.rules; -import java.nio.file.FileSystems; -import java.nio.file.PathMatcher; +import java.nio.file.*; import java.util.List; public class DirectoryRule extends FileRule { - private PathMatcher matcher = null; + private PathMatcher directoryMatcher = null; + private PathMatcher contentsMatcher = null; DirectoryRule(List syntax, String definition) { super(syntax, definition); - matcher = FileSystems.getDefault().getPathMatcher("glob:**/"+this.getPattern()); + String pattern = this.getPattern(); + StringBuilder sb = new StringBuilder(); + sb.append("glob:"); + sb.append(pattern); + if(!pattern.endsWith("/")) sb.append("/"); + directoryMatcher = FileSystems.getDefault().getPathMatcher(sb.toString()); + sb.append("**"); + contentsMatcher = FileSystems.getDefault().getPathMatcher(sb.toString()); } @Override public Boolean matches(String relativePath) { - return matcher.matches(FileSystems.getDefault().getPath(relativePath)); + return contentsMatcher.matches(FileSystems.getDefault().getPath(relativePath)) || directoryMatcher.matches(FileSystems.getDefault().getPath(relativePath)); } } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/ignore/rules/IgnoreLineParser.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/ignore/rules/IgnoreLineParser.java index d79bc03ae15..2d3fbdd2994 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/ignore/rules/IgnoreLineParser.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/ignore/rules/IgnoreLineParser.java @@ -78,6 +78,13 @@ public class IgnoreLineParser { i++; continue; } else { + + if (sb.length() > 0) { + // A MATCH_ANY may commonly follow a filename or some other character. Dump that to results before the MATCH_ANY. + parts.add(new Part(Token.TEXT, sb.toString())); + sb.delete(0, sb.length()); + } + parts.add(new Part(Token.MATCH_ANY)); continue; } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractCSharpCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractCSharpCodegen.java index 128686b615b..386e37e3f0d 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractCSharpCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractCSharpCodegen.java @@ -77,6 +77,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co "string", "bool?", "double?", + "decimal?", "int?", "long?", "float?", @@ -112,7 +113,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co typeMapping.put("float", "float?"); typeMapping.put("long", "long?"); typeMapping.put("double", "double?"); - typeMapping.put("number", "double?"); + typeMapping.put("number", "decimal?"); typeMapping.put("datetime", "DateTime?"); typeMapping.put("date", "DateTime?"); typeMapping.put("file", "System.IO.Stream"); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java index 4162ad1aeb4..e926235ba90 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java @@ -247,6 +247,8 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen { supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh")); supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore")); + // apache v2 license + supportingFiles.add(new SupportingFile("LICENSE", "", "LICENSE")); if (optionalAssemblyInfoFlag) { supportingFiles.add(new SupportingFile("AssemblyInfo.mustache", packageFolder + File.separator + "Properties", "AssemblyInfo.cs")); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/GoClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/GoClientCodegen.java index f1c3db7c430..efcde6d8c41 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/GoClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/GoClientCodegen.java @@ -148,6 +148,7 @@ public class GoClientCodegen extends DefaultCodegen implements CodegenConfig { supportingFiles.add(new SupportingFile("api_response.mustache", "", "api_response.go")); supportingFiles.add(new SupportingFile(".travis.yml", "", ".travis.yml")); supportingFiles.add(new SupportingFile("pom.mustache", "", "pom.xml")); + supportingFiles.add(new SupportingFile("LICENSE", "", "LICENSE")); } @Override diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java index 1fba93891a4..9f771f05607 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java @@ -332,6 +332,13 @@ public class JavaClientCodegen extends DefaultCodegen implements CodegenConfig { gradleWrapperPackage.replace( ".", File.separator ), "gradle-wrapper.properties") ); supportingFiles.add( new SupportingFile( "gradle-wrapper.jar", gradleWrapperPackage.replace( ".", File.separator ), "gradle-wrapper.jar") ); + + //generate markdown docs for retrofit2 + if ( usesRetrofit2Library() ){ + modelDocTemplateFiles.put("model_doc.mustache", ".md"); + apiDocTemplateFiles.put("api_doc.mustache", ".md"); + } + } else if("jersey2".equals(getLibrary())) { // generate markdown docs modelDocTemplateFiles.put("model_doc.mustache", ".md"); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ObjcClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ObjcClientCodegen.java index 1a9d0a80c24..67cf272c0ba 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ObjcClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ObjcClientCodegen.java @@ -1,14 +1,7 @@ package io.swagger.codegen.languages; -import io.swagger.codegen.CliOption; -import io.swagger.codegen.CodegenConfig; -import io.swagger.codegen.CodegenConstants; -import io.swagger.codegen.CodegenOperation; -import io.swagger.codegen.CodegenParameter; -import io.swagger.codegen.CodegenProperty; -import io.swagger.codegen.CodegenType; -import io.swagger.codegen.DefaultCodegen; -import io.swagger.codegen.SupportingFile; +import io.swagger.codegen.*; +import io.swagger.models.Model; import io.swagger.models.properties.*; import java.io.File; @@ -26,9 +19,10 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig { public static final String POD_NAME = "podName"; public static final String AUTHOR_NAME = "authorName"; public static final String AUTHOR_EMAIL = "authorEmail"; - public static final String GIT_REPO_URL = "gitRepoURL"; public static final String LICENSE = "license"; - + public static final String GIT_REPO_URL = "gitRepoURL"; + public static final String DEFAULT_LICENSE = "Apache License, Version 2.0"; + public static final String CORE_DATA = "coreData"; public static final String BinaryDataType = "ObjcClientCodegenBinaryData"; protected Set foundationClasses = new HashSet(); @@ -37,7 +31,7 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig { protected String classPrefix = "SWG"; protected String authorName = "Swagger"; protected String authorEmail = "apiteam@swagger.io"; - protected String license = "MIT"; + protected String license = DEFAULT_LICENSE; protected String gitRepoURL = "https://github.com/swagger-api/swagger-codegen"; protected String[] specialWords = {"new", "copy"}; protected String apiDocPath = "docs/"; @@ -45,6 +39,8 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig { protected String modelFilesPath = "Model/"; protected String coreFilesPath = "Core/"; protected String apiFilesPath = "Api/"; + + protected boolean generateCoreData = false; protected Set advancedMapingTypes = new HashSet(); @@ -73,6 +69,7 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig { defaultIncludes.add("NSDictionary"); defaultIncludes.add("NSMutableArray"); defaultIncludes.add("NSMutableDictionary"); + defaultIncludes.add("NSManagedObject"); defaultIncludes.add(BinaryDataType); @@ -154,6 +151,7 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig { instantiationTypes.put("map", "NSMutableDictionary"); cliOptions.clear(); + cliOptions.add(new CliOption(CORE_DATA, "Should generate core data models").defaultValue("false")); cliOptions.add(new CliOption(CLASS_PREFIX, "prefix for generated classes (convention: Abbreviation of pod name e.g. `HN` for `HackerNews`).`") .defaultValue("SWG")); cliOptions.add(new CliOption(POD_NAME, "cocoapods package name (convention: CameCase).") @@ -164,7 +162,6 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig { cliOptions.add(new CliOption(AUTHOR_EMAIL, "Email to use in the podspec file.").defaultValue("apiteam@swagger.io")); cliOptions.add(new CliOption(GIT_REPO_URL, "URL for the git repo where this podspec should point to.") .defaultValue("https://github.com/swagger-api/swagger-codegen")); - cliOptions.add(new CliOption(LICENSE, "License to use in the podspec file.").defaultValue("MIT")); } @Override @@ -194,6 +191,12 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig { setPodVersion((String) additionalProperties.get(CodegenConstants.POD_VERSION)); } + if (additionalProperties.containsKey(CORE_DATA)) { + Object coreData = additionalProperties.get(CORE_DATA); + if(((String)coreData).equalsIgnoreCase("true")) { + generateCoreData = true; + } + } if (additionalProperties.containsKey(CLASS_PREFIX)) { setClassPrefix((String) additionalProperties.get(CLASS_PREFIX)); } @@ -210,8 +213,11 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig { setGitRepoURL((String) additionalProperties.get(GIT_REPO_URL)); } - if (additionalProperties.containsKey(LICENSE)) { - setLicense((String) additionalProperties.get(LICENSE)); + if(generateCoreData) { + modelTemplateFiles.put("NSManagedObject-header.mustache", "ManagedObject.h"); + modelTemplateFiles.put("NSManagedObject-body.mustache", "ManagedObject.m"); + modelTemplateFiles.put("NSManagedObjectBuilder-header.mustache", "ManagedObjectBuilder.h"); + modelTemplateFiles.put("NSManagedObjectBuilder-body.mustache", "ManagedObjectBuilder.m"); } additionalProperties.put(POD_NAME, podName); @@ -225,6 +231,7 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig { // make api and model doc path available in mustache template additionalProperties.put("apiDocPath", apiDocPath); additionalProperties.put("modelDocPath", modelDocPath); + additionalProperties.put("useCoreData", generateCoreData); modelPackage = podName; apiPackage = podName; @@ -245,8 +252,8 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig { supportingFiles.add(new SupportingFile("Sanitizer-header.mustache", coreFileFolder(), classPrefix + "Sanitizer.h")); supportingFiles.add(new SupportingFile("Logger-body.mustache", coreFileFolder(), classPrefix + "Logger.m")); supportingFiles.add(new SupportingFile("Logger-header.mustache", coreFileFolder(), classPrefix + "Logger.h")); - supportingFiles.add(new SupportingFile("JSONValueTransformer+ISO8601.m", coreFileFolder(), "JSONValueTransformer+ISO8601.m")); - supportingFiles.add(new SupportingFile("JSONValueTransformer+ISO8601.h", coreFileFolder(), "JSONValueTransformer+ISO8601.h")); + supportingFiles.add(new SupportingFile("JSONValueTransformer+ISO8601-body.mustache", coreFileFolder(), "JSONValueTransformer+ISO8601.m")); + supportingFiles.add(new SupportingFile("JSONValueTransformer+ISO8601-header.mustache", coreFileFolder(), "JSONValueTransformer+ISO8601.h")); supportingFiles.add(new SupportingFile("Configuration-body.mustache", coreFileFolder(), classPrefix + "Configuration.m")); supportingFiles.add(new SupportingFile("Configuration-header.mustache", coreFileFolder(), classPrefix + "Configuration.h")); supportingFiles.add(new SupportingFile("api-protocol.mustache", coreFileFolder(), classPrefix + "Api.h")); @@ -255,6 +262,10 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig { supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh")); supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore")); + if(generateCoreData) { + supportingFiles.add(new SupportingFile("xccurrentversion.mustache", (modelPackage() + "/" + modelFilesPath + "/").replace("/", File.separator) + classPrefix + "Model.xcdatamodeld", ".xccurrentversion")); + supportingFiles.add(new SupportingFile("Model.xcdatamodel.mustache",(modelPackage() + "/" + modelFilesPath + "/").replace("/", File.separator) + classPrefix + "Model.xcdatamodeld" + File.separator + classPrefix + "Model.xcdatamodel", "contents")); + } } @Override @@ -292,6 +303,15 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig { return toModelNameWithoutReservedWordCheck(type); } + public CodegenProperty coreDatafromProperty(String name, Property p) { + CodegenProperty property = fromProperty(name, p); + if(!generateCoreData) { + return property; + } + property.baseType = getTypeCoreDataDeclaration(p); + return property; + } + @Override public String getTypeDeclaration(Property p) { if (p instanceof ArrayProperty) { @@ -363,6 +383,77 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig { } } + + public String getTypeCoreDataDeclaration(Property p) { + if (p instanceof ArrayProperty) { + ArrayProperty ap = (ArrayProperty) p; + Property inner = ap.getItems(); + String innerType = getSwaggerType(inner); + + String innerTypeDeclaration = getTypeDeclaration(inner); + if (innerTypeDeclaration.endsWith("*")) { + innerTypeDeclaration = innerTypeDeclaration.substring(0, innerTypeDeclaration.length() - 1); + } + + if(innerTypeDeclaration.equalsIgnoreCase(BinaryDataType)) { + return "NSData*"; + } + // In this codition, type of property p is array of primitive, + // return container type with pointer, e.g. `NSArray**' + if (languageSpecificPrimitives.contains(innerTypeDeclaration)) { + return getSwaggerType(p) + "<" + innerTypeDeclaration + "*>*"; + } + // In this codition, type of property p is array of model, + // return container type combine inner type with pointer, e.g. `NSArray*' + else { + for (String sd : advancedMapingTypes) { + if(innerTypeDeclaration.startsWith(sd)) { + return getSwaggerType(p) + "<" + innerTypeDeclaration + "*>*"; + } + } + return getSwaggerType(p) + "<" + innerTypeDeclaration + ">*"; + } + } else if (p instanceof MapProperty) { + MapProperty mp = (MapProperty) p; + Property inner = mp.getAdditionalProperties(); + + String innerTypeDeclaration = getTypeDeclaration(inner); + + if (innerTypeDeclaration.endsWith("*")) { + innerTypeDeclaration = innerTypeDeclaration.substring(0, innerTypeDeclaration.length() - 1); + } + if (languageSpecificPrimitives.contains(innerTypeDeclaration)) { + return getSwaggerType(p) + "*"; + } else { + for (String s : advancedMapingTypes) { + if(innerTypeDeclaration.startsWith(s)) { + return getSwaggerType(p) + "*"; + } + } + return getSwaggerType(p) + "*"; + } + } else { + String swaggerType = getSwaggerType(p); + + // In this codition, type of p is objective-c primitive type, e.g. `NSSNumber', + // return type of p with pointer, e.g. `NSNumber*' + if (languageSpecificPrimitives.contains(swaggerType) && + foundationClasses.contains(swaggerType)) { + return swaggerType + "*"; + } + // In this codition, type of p is c primitive type, e.g. `bool', + // return type of p, e.g. `bool' + else if (languageSpecificPrimitives.contains(swaggerType)) { + return swaggerType; + } + // In this codition, type of p is objective-c object type, e.g. `SWGPet', + // return type of p with pointer, e.g. `SWGPet*' + else { + return swaggerType + "*"; + } + } + } + @Override public String toModelName(String type) { // model name cannot use reserved keyword @@ -583,6 +674,12 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig { return objs; } + @Override + public void postProcessModelProperty(CodegenModel model, CodegenProperty property){ + super.postProcessModelProperty(model,property); + property.vendorExtensions.put("x-uppercaseName", camelize(property.name)); + } + /** * Return the default value of the property * diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PhpClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PhpClientCodegen.java index c89a7b4e5ba..ac76770c1a4 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PhpClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PhpClientCodegen.java @@ -167,6 +167,15 @@ public class PhpClientCodegen extends DefaultCodegen implements CodegenConfig { .replaceAll(regLastPathSeparator+ "$", ""); } + @Override + public String escapeText(String input) { + if (input != null) { + // Trim the string to avoid leading and trailing spaces. + return super.escapeText(input).trim(); + } + return input; + } + @Override public CodegenType getTag() { return CodegenType.CLIENT; @@ -264,7 +273,8 @@ public class PhpClientCodegen extends DefaultCodegen implements CodegenConfig { supportingFiles.add(new SupportingFile("README.mustache", getPackagePath(), "README.md")); supportingFiles.add(new SupportingFile(".travis.yml", getPackagePath(), ".travis.yml")); supportingFiles.add(new SupportingFile("git_push.sh.mustache", getPackagePath(), "git_push.sh")); - + // apache v2 license + supportingFiles.add(new SupportingFile("LICENSE", getPackagePath(), "LICENSE")); } @Override diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PythonClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PythonClientCodegen.java index 8bc117120d6..51bd143ba8f 100755 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PythonClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PythonClientCodegen.java @@ -15,7 +15,6 @@ import java.io.File; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; -import java.util.HashSet; import java.util.List; import java.util.Map; @@ -149,6 +148,8 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig apiPackage = swaggerFolder + File.separatorChar + "apis"; supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); + supportingFiles.add(new SupportingFile("LICENSE", "", "LICENSE")); + supportingFiles.add(new SupportingFile("setup.mustache", "", "setup.py")); supportingFiles.add(new SupportingFile("tox.mustache", "", "tox.ini")); supportingFiles.add(new SupportingFile("test-requirements.mustache", "", "test-requirements.txt")); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/RubyClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/RubyClientCodegen.java index 70b3a32085a..0db5598f7f0 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/RubyClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/RubyClientCodegen.java @@ -225,6 +225,9 @@ public class RubyClientCodegen extends DefaultCodegen implements CodegenConfig { supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh")); supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore")); + supportingFiles.add(new SupportingFile("LICENSE", "", "LICENSE")); + + // test files should not be overwritten writeOptional(outputFolder, new SupportingFile("rspec.mustache", "", ".rspec")); writeOptional(outputFolder, new SupportingFile("spec_helper.mustache", specFolder, "spec_helper.rb")); writeOptional(outputFolder, new SupportingFile("configuration_spec.mustache", specFolder, "configuration_spec.rb")); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/TypeScriptNodeClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/TypeScriptNodeClientCodegen.java index d4207f09cc8..516d34b9810 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/TypeScriptNodeClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/TypeScriptNodeClientCodegen.java @@ -42,7 +42,6 @@ public class TypeScriptNodeClientCodegen extends AbstractTypeScriptClientCodegen supportingFiles.add(new SupportingFile("api.mustache", null, "api.ts")); supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh")); - LOGGER.warn("check additionals: " + additionalProperties.get(NPM_NAME)); if(additionalProperties.containsKey(NPM_NAME)) { addNpmPackageGeneration(); } diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/api.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/api.mustache index fae7a93303d..c9d756d33ec 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/api.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/api.mustache @@ -26,7 +26,7 @@ public interface {{classname}} extends ApiClient.Api { @RequestLine("{{httpMethod}} {{{path}}}{{#hasQueryParams}}?{{/hasQueryParams}}{{#queryParams}}{{baseName}}={{=<% %>=}}{<%paramName%>}<%={{ }}=%>{{#hasMore}}&{{/hasMore}}{{/queryParams}}") @Headers({ "Content-type: {{vendorExtensions.x-contentType}}", - "Accepts: {{vendorExtensions.x-accepts}}",{{#headerParams}} + "Accept: {{vendorExtensions.x-accepts}}",{{#headerParams}} "{{paramName}}: {{=<% %>=}}{<%paramName%>}<%={{ }}=%>"{{#hasMore}}, {{/hasMore}}{{/headerParams}} }) diff --git a/modules/swagger-codegen/src/main/resources/Javascript/package.mustache b/modules/swagger-codegen/src/main/resources/Javascript/package.mustache index ca84decf9d3..915c99e8d40 100644 --- a/modules/swagger-codegen/src/main/resources/Javascript/package.mustache +++ b/modules/swagger-codegen/src/main/resources/Javascript/package.mustache @@ -1,8 +1,8 @@ { "name": "{{{projectName}}}", "version": "{{{projectVersion}}}", - "description": "{{{projectDescription}}}",{{#projectLicenseName}} - "license": "{{{projectLicenseName}}}",{{/projectLicenseName}} + "description": "{{{projectDescription}}}", + "license": "Apache-2.0", "main": "{{sourceFolder}}{{#invokerPackage}}/{{invokerPackage}}{{/invokerPackage}}/index.js", "scripts": { "test": "./node_modules/mocha/bin/mocha --recursive" diff --git a/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/package.json.mustache b/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/package.json.mustache index 62a598d536b..5a195c346ff 100644 --- a/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/package.json.mustache +++ b/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/package.json.mustache @@ -1,6 +1,7 @@ { "name": "{{#npmName}}{{{npmName}}}{{/npmName}}{{^npmName}}typescript-fetch-api{{/npmName}}", "version": "{{#npmVersion}}{{{npmVersion}}}{{/npmVersion}}{{^npmVersion}}0.0.0{{/npmVersion}}", + "license": "Apache-2.0", "main": "./dist/api.js", "browser": "./dist/api.js", "typings": "./dist/api.d.ts", @@ -15,4 +16,4 @@ "typescript": "^1.8.10", "typings": "^0.8.1" } -} \ No newline at end of file +} diff --git a/modules/swagger-codegen/src/main/resources/_common/LICENSE b/modules/swagger-codegen/src/main/resources/_common/LICENSE new file mode 100644 index 00000000000..8dada3edaf5 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/_common/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/modules/swagger-codegen/src/main/resources/csharp/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/csharp/ApiClient.mustache index f9b9f766299..1d34ff21eae 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/ApiClient.mustache @@ -1,3 +1,4 @@ +{{>partial_header}} using System; using System.Collections; using System.Collections.Generic; diff --git a/modules/swagger-codegen/src/main/resources/csharp/ApiException.mustache b/modules/swagger-codegen/src/main/resources/csharp/ApiException.mustache index e6185abc162..ad7c2264d78 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/ApiException.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/ApiException.mustache @@ -1,3 +1,4 @@ +{{>partial_header}} using System; namespace {{packageName}}.Client diff --git a/modules/swagger-codegen/src/main/resources/csharp/ApiResponse.mustache b/modules/swagger-codegen/src/main/resources/csharp/ApiResponse.mustache index 4b9f0a3a43c..d8c1b79e545 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/ApiResponse.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/ApiResponse.mustache @@ -1,3 +1,4 @@ +{{>partial_header}} using System; using System.Collections.Generic; diff --git a/modules/swagger-codegen/src/main/resources/csharp/Configuration.mustache b/modules/swagger-codegen/src/main/resources/csharp/Configuration.mustache index bf7f4d003ad..eddb9d0de1f 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/Configuration.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/Configuration.mustache @@ -1,3 +1,4 @@ +{{>partial_header}} using System; using System.Reflection; using System.Collections.Generic; diff --git a/modules/swagger-codegen/src/main/resources/csharp/IApiAccessor.mustache b/modules/swagger-codegen/src/main/resources/csharp/IApiAccessor.mustache index eecd5284493..22db465efaa 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/IApiAccessor.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/IApiAccessor.mustache @@ -1,3 +1,5 @@ +{{>partial_header}} + using System; using System.Collections.Generic; using System.Collections.ObjectModel; @@ -23,4 +25,4 @@ namespace {{packageName}}.Client /// The base path String GetBasePath(); } -} \ No newline at end of file +} diff --git a/modules/swagger-codegen/src/main/resources/csharp/LICENSE b/modules/swagger-codegen/src/main/resources/csharp/LICENSE new file mode 100644 index 00000000000..8dada3edaf5 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/csharp/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/modules/swagger-codegen/src/main/resources/csharp/Project.mustache b/modules/swagger-codegen/src/main/resources/csharp/Project.mustache index 141d541a5b5..a8e18ea91ac 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/Project.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/Project.mustache @@ -1,4 +1,29 @@ + Debug diff --git a/modules/swagger-codegen/src/main/resources/csharp/TestProject.mustache b/modules/swagger-codegen/src/main/resources/csharp/TestProject.mustache index 0e0bd6c1671..2866dcb0601 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/TestProject.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/TestProject.mustache @@ -1,4 +1,29 @@ + Debug diff --git a/modules/swagger-codegen/src/main/resources/csharp/api.mustache b/modules/swagger-codegen/src/main/resources/csharp/api.mustache index da1cee8caef..1145421d22d 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/api.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/api.mustache @@ -1,3 +1,4 @@ +{{>partial_header}} using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/modules/swagger-codegen/src/main/resources/csharp/api_test.mustache b/modules/swagger-codegen/src/main/resources/csharp/api_test.mustache index 21471de3c27..cc487fb681e 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/api_test.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/api_test.mustache @@ -1,3 +1,4 @@ +{{>partial_header}} using System; using System.IO; using System.Collections.Generic; diff --git a/modules/swagger-codegen/src/main/resources/csharp/model.mustache b/modules/swagger-codegen/src/main/resources/csharp/model.mustache index 6c6ae8fdbb6..863d7ba93ef 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/model.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/model.mustache @@ -1,3 +1,4 @@ +{{>partial_header}} using System; using System.Linq; using System.IO; diff --git a/modules/swagger-codegen/src/main/resources/csharp/model_test.mustache b/modules/swagger-codegen/src/main/resources/csharp/model_test.mustache index 0d20b9f03a3..f9dd3c08efc 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/model_test.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/model_test.mustache @@ -1,3 +1,5 @@ +{{>partial_header}} + using NUnit.Framework; using System; diff --git a/modules/swagger-codegen/src/main/resources/csharp/partial_header.mustache b/modules/swagger-codegen/src/main/resources/csharp/partial_header.mustache new file mode 100644 index 00000000000..bf5862deafd --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/csharp/partial_header.mustache @@ -0,0 +1,25 @@ +/* + {{#appName}} + * {{{appName}}} + * + {{/appName}} + {{#appDescription}} + * {{{appDescription}}} + * + {{/appDescription}} + * {{#version}}OpenAPI spec version: {{{version}}}{{/version}} + * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ diff --git a/modules/swagger-codegen/src/main/resources/go/LICENSE b/modules/swagger-codegen/src/main/resources/go/LICENSE new file mode 100644 index 00000000000..8dada3edaf5 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/go/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/modules/swagger-codegen/src/main/resources/go/api.mustache b/modules/swagger-codegen/src/main/resources/go/api.mustache index 0209e8590c3..b3e2f6db9af 100644 --- a/modules/swagger-codegen/src/main/resources/go/api.mustache +++ b/modules/swagger-codegen/src/main/resources/go/api.mustache @@ -1,3 +1,4 @@ +{{>partial_header}} package {{packageName}} {{#operations}} diff --git a/modules/swagger-codegen/src/main/resources/go/api_client.mustache b/modules/swagger-codegen/src/main/resources/go/api_client.mustache index 2fa6d14ef2b..be0f60673d8 100644 --- a/modules/swagger-codegen/src/main/resources/go/api_client.mustache +++ b/modules/swagger-codegen/src/main/resources/go/api_client.mustache @@ -1,3 +1,4 @@ +{{>partial_header}} package {{packageName}} import ( diff --git a/modules/swagger-codegen/src/main/resources/go/api_response.mustache b/modules/swagger-codegen/src/main/resources/go/api_response.mustache index a15293f4402..9bacc9578e4 100644 --- a/modules/swagger-codegen/src/main/resources/go/api_response.mustache +++ b/modules/swagger-codegen/src/main/resources/go/api_response.mustache @@ -1,3 +1,4 @@ +{{>partial_header}} package {{packageName}} import ( diff --git a/modules/swagger-codegen/src/main/resources/go/configuration.mustache b/modules/swagger-codegen/src/main/resources/go/configuration.mustache index 463f77c54dc..fbc22f603d0 100644 --- a/modules/swagger-codegen/src/main/resources/go/configuration.mustache +++ b/modules/swagger-codegen/src/main/resources/go/configuration.mustache @@ -1,3 +1,4 @@ +{{>partial_header}} package {{packageName}} import ( diff --git a/modules/swagger-codegen/src/main/resources/go/model.mustache b/modules/swagger-codegen/src/main/resources/go/model.mustache index fd799a0e35d..7cc53fabbce 100644 --- a/modules/swagger-codegen/src/main/resources/go/model.mustache +++ b/modules/swagger-codegen/src/main/resources/go/model.mustache @@ -1,3 +1,4 @@ +{{>partial_header}} package {{packageName}} {{#models}}{{#imports}} import ({{/imports}}{{#imports}} diff --git a/modules/swagger-codegen/src/main/resources/go/partial_header.mustache b/modules/swagger-codegen/src/main/resources/go/partial_header.mustache new file mode 100644 index 00000000000..bf5862deafd --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/go/partial_header.mustache @@ -0,0 +1,25 @@ +/* + {{#appName}} + * {{{appName}}} + * + {{/appName}} + {{#appDescription}} + * {{{appDescription}}} + * + {{/appDescription}} + * {{#version}}OpenAPI spec version: {{{version}}}{{/version}} + * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ diff --git a/modules/swagger-codegen/src/main/resources/nodejs/package.mustache b/modules/swagger-codegen/src/main/resources/nodejs/package.mustache index 2d2b917c4b2..5496ee06f80 100644 --- a/modules/swagger-codegen/src/main/resources/nodejs/package.mustache +++ b/modules/swagger-codegen/src/main/resources/nodejs/package.mustache @@ -6,7 +6,7 @@ "keywords": [ "swagger" ], - "license": "MIT", + "license": "Apache-2.0", "private": true, "dependencies": { "connect": "^3.2.0", diff --git a/modules/swagger-codegen/src/main/resources/objc/ApiClient-header.mustache b/modules/swagger-codegen/src/main/resources/objc/ApiClient-header.mustache index db7df9b3407..125d42e3491 100644 --- a/modules/swagger-codegen/src/main/resources/objc/ApiClient-header.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/ApiClient-header.mustache @@ -8,11 +8,8 @@ #import "{{classPrefix}}ResponseDeserializer.h" #import "{{classPrefix}}Sanitizer.h" #import "{{classPrefix}}Logger.h" -/** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen - * Do not edit the class manually. - */ + +{{>licenceInfo}} {{#models}}{{#model}}#import "{{classname}}.h" {{/model}}{{/models}} diff --git a/modules/swagger-codegen/src/main/resources/objc/Configuration-header.mustache b/modules/swagger-codegen/src/main/resources/objc/Configuration-header.mustache index 12807ca5411..e727942a4f2 100644 --- a/modules/swagger-codegen/src/main/resources/objc/Configuration-header.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/Configuration-header.mustache @@ -2,12 +2,7 @@ #import "{{classPrefix}}ApiClient.h" #import "{{classPrefix}}Logger.h" -/** The `{{classPrefix}}Configuration` class manages the configurations for the sdk. - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen - * Do not edit the class manually. - */ +{{>licenceInfo}} @class {{classPrefix}}ApiClient; diff --git a/modules/swagger-codegen/src/main/resources/objc/JSONRequestSerializer-header.mustache b/modules/swagger-codegen/src/main/resources/objc/JSONRequestSerializer-header.mustache index a0732b93706..1259c5d1530 100644 --- a/modules/swagger-codegen/src/main/resources/objc/JSONRequestSerializer-header.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/JSONRequestSerializer-header.mustache @@ -1,5 +1,7 @@ #import #import +{{>licenceInfo}} + @interface {{classPrefix}}JSONRequestSerializer : AFJSONRequestSerializer @end diff --git a/modules/swagger-codegen/src/main/resources/objc/JSONResponseSerializer-body.mustache b/modules/swagger-codegen/src/main/resources/objc/JSONResponseSerializer-body.mustache index 3a19dd1ca4e..7fa5e7b19e0 100644 --- a/modules/swagger-codegen/src/main/resources/objc/JSONResponseSerializer-body.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/JSONResponseSerializer-body.mustache @@ -1,13 +1,5 @@ #import "{{classPrefix}}JSONResponseSerializer.h" -static BOOL JSONParseError(NSError *error) { - if ([error.domain isEqualToString:NSCocoaErrorDomain] && error.code == 3840) { - return YES; - } - - return NO; -} - @implementation {{classPrefix}}JSONResponseSerializer /// @@ -17,7 +9,7 @@ static BOOL JSONParseError(NSError *error) { /// /// @param response The response to be processed. /// @param data The response data to be decoded. -/// @param error The error that occurred while attempting to decode the respnse data. +/// @param error The error that occurred while attempting to decode the response data. /// /// @return The object decoded from the specified response data. /// @@ -27,7 +19,7 @@ static BOOL JSONParseError(NSError *error) { NSDictionary *responseJson = [super responseObjectForResponse:response data:data error:error]; // if response data is not a valid json, return string of data. - if (JSONParseError(*error)) { + if ([self isParseError:*error]) { *error = nil; NSString *responseString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; return responseString; @@ -36,4 +28,12 @@ static BOOL JSONParseError(NSError *error) { return responseJson; } +-(BOOL)isParseError:(NSError *)error { + return [error.domain isEqualToString:NSCocoaErrorDomain] && error.code == 3840; +} + ++ (instancetype)serializer { + return [self serializerWithReadingOptions:NSJSONReadingAllowFragments]; +} + @end diff --git a/modules/swagger-codegen/src/main/resources/objc/JSONResponseSerializer-header.mustache b/modules/swagger-codegen/src/main/resources/objc/JSONResponseSerializer-header.mustache index 7a5f152e271..360e4f9cdc5 100644 --- a/modules/swagger-codegen/src/main/resources/objc/JSONResponseSerializer-header.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/JSONResponseSerializer-header.mustache @@ -1,6 +1,8 @@ #import #import +{{>licenceInfo}} + @interface {{classPrefix}}JSONResponseSerializer : AFJSONResponseSerializer @end diff --git a/modules/swagger-codegen/src/main/resources/objc/JSONValueTransformer+ISO8601.m b/modules/swagger-codegen/src/main/resources/objc/JSONValueTransformer+ISO8601-body.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/objc/JSONValueTransformer+ISO8601.m rename to modules/swagger-codegen/src/main/resources/objc/JSONValueTransformer+ISO8601-body.mustache diff --git a/modules/swagger-codegen/src/main/resources/objc/JSONValueTransformer+ISO8601.h b/modules/swagger-codegen/src/main/resources/objc/JSONValueTransformer+ISO8601-header.mustache similarity index 88% rename from modules/swagger-codegen/src/main/resources/objc/JSONValueTransformer+ISO8601.h rename to modules/swagger-codegen/src/main/resources/objc/JSONValueTransformer+ISO8601-header.mustache index 832f485f4f0..2a8d5b0c9e7 100644 --- a/modules/swagger-codegen/src/main/resources/objc/JSONValueTransformer+ISO8601.h +++ b/modules/swagger-codegen/src/main/resources/objc/JSONValueTransformer+ISO8601-header.mustache @@ -2,5 +2,8 @@ #import #import +{{>licenceInfo}} + @interface JSONValueTransformer (ISO8601) + @end diff --git a/modules/swagger-codegen/src/main/resources/objc/Logger-header.mustache b/modules/swagger-codegen/src/main/resources/objc/Logger-header.mustache index 2070f95ae9f..37afea41a09 100644 --- a/modules/swagger-codegen/src/main/resources/objc/Logger-header.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/Logger-header.mustache @@ -1,10 +1,6 @@ #import -/** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen - * Do not edit the class manually. - */ +{{>licenceInfo}} #ifndef {{classPrefix}}DebugLogResponse #define {{classPrefix}}DebugLogResponse(response, responseObject,request, error) [[{{classPrefix}}Logger sharedLogger] logResponse:response responseObject:responseObject request:request error:error]; diff --git a/modules/swagger-codegen/src/main/resources/objc/Model.xcdatamodel.mustache b/modules/swagger-codegen/src/main/resources/objc/Model.xcdatamodel.mustache new file mode 100644 index 00000000000..bc391cbd0ad --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/objc/Model.xcdatamodel.mustache @@ -0,0 +1,9 @@ + + + + {{#models}}{{#model}} +{{#vars}}{{#complexType}} {{/complexType}}{{^complexType}} {{/complexType}} +{{/vars}} + + {{/model}}{{/models}} + \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/objc/NSManagedObject-body.mustache b/modules/swagger-codegen/src/main/resources/objc/NSManagedObject-body.mustache new file mode 100644 index 00000000000..c8e563e75e8 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/objc/NSManagedObject-body.mustache @@ -0,0 +1,18 @@ +{{#models}} +{{#model}} +#import "{{classname}}ManagedObject.h" + +/** +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen +* Do not edit the class manually. +*/ +@implementation {{classname}}ManagedObject + +{{#vars}} +@dynamic {{name}}; +{{/vars}} + +{{/model}} +@end +{{/models}} diff --git a/modules/swagger-codegen/src/main/resources/objc/NSManagedObject-header.mustache b/modules/swagger-codegen/src/main/resources/objc/NSManagedObject-header.mustache new file mode 100644 index 00000000000..07092d28762 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/objc/NSManagedObject-header.mustache @@ -0,0 +1,39 @@ +#import +#import + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +{{#imports}}#import "{{import}}ManagedObject.h" +{{/imports}} +{{newline}} +{{#models}} +{{#model}} + +NS_ASSUME_NONNULL_BEGIN + +@interface {{classname}}ManagedObject : {{#parent}}{{{parent}}}{{/parent}}{{^parent}}NSManagedObject{{/parent}} + +{{#vars}} +{{#description}}/* {{{description}}} {{^required}}[optional]{{/required}} + */{{/description}} +@property (nullable, nonatomic, retain) {{^complexType}}{{{ datatype }}}{{/complexType}}{{#complexType}}{{#isListContainer}}NSSet<{{{complexType}}}ManagedObject*>*{{/isListContainer}}{{^isListContainer}}{{{complexType}}}ManagedObject*{{/isListContainer}}{{/complexType}} {{name}}; +{{/vars}} + +@end + +@interface {{classname}}ManagedObject (GeneratedAccessors) + +{{#vars}}{{#isListContainer}}{{#complexType}}- (void)add{{vendorExtensions.x-uppercaseName}}Object:({{complexType}}ManagedObject *)value; +- (void)remove{{vendorExtensions.x-uppercaseName}}Object:({{complexType}}ManagedObject *)value; +- (void)add{{vendorExtensions.x-uppercaseName}}:(NSSet<{{{complexType}}}ManagedObject*> *)values; +- (void)remove{{vendorExtensions.x-uppercaseName}}:(NSSet<{{{complexType}}}ManagedObject*> *)values; +{{/complexType}}{{/isListContainer}}{{/vars}} +@end +{{/model}} +{{/models}} + +NS_ASSUME_NONNULL_END diff --git a/modules/swagger-codegen/src/main/resources/objc/NSManagedObjectBuilder-body.mustache b/modules/swagger-codegen/src/main/resources/objc/NSManagedObjectBuilder-body.mustache new file mode 100644 index 00000000000..70f97418eed --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/objc/NSManagedObjectBuilder-body.mustache @@ -0,0 +1,76 @@ + +{{#models}}{{#model}} +#import "{{classname}}ManagedObjectBuilder.h" + +/** +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen +* Do not edit the class manually. +*/ + +@implementation {{classname}}ManagedObjectBuilder + +-(instancetype)init { + self = [super init]; + if (self != nil) { +{{#vars}}{{#complexType}} _{{name}}Builder = [[{{complexType}}ManagedObjectBuilder alloc] init]; +{{/complexType}}{{/vars}} } + return self; +} + +-({{classname}}ManagedObject*)createNew{{classname}}ManagedObjectInContext:(NSManagedObjectContext*)context { + {{classname}}ManagedObject *managedObject = [NSEntityDescription insertNewObjectForEntityForName:NSStringFromClass([{{classname}}ManagedObject class]) inManagedObjectContext:context]; + return managedObject; +} + +-({{classname}}ManagedObject*){{classname}}ManagedObjectFrom{{classname}}:({{classname}}*){{name}} context:(NSManagedObjectContext*)context { + {{classname}}ManagedObject* new{{classname}} = [self createNew{{{classname}}}ManagedObjectInContext:context]; + [self update{{classname}}ManagedObject:new{{classname}} with{{classname}}:{{name}}]; + return new{{classname}}; +} + +-(void)update{{classname}}ManagedObject:({{classname}}ManagedObject*)managedObject with{{classname}}:({{classname}}*)object { + if(!managedObject || !object) { + return; + } +{{#vars}}{{^complexType}} managedObject.{{name}} = [object.{{name}} copy];{{/complexType}}{{#complexType}}{{#isListContainer}} if(object.{{name}}) { + NSMutableSet * convertedObjs = [NSMutableSet set]; + for (id innerObject in object.{{name}}) { + id convertedObj = [self.{{name}}Builder {{complexType}}ManagedObjectFrom{{complexType}}:innerObject context:managedObject.managedObjectContext]; + [convertedObjs addObject:convertedObj]; + } + managedObject.{{name}} = convertedObjs; + }{{/isListContainer}}{{^isListContainer}} + if(!managedObject.{{name}}) { + managedObject.{{name}} = [self.{{name}}Builder {{complexType}}ManagedObjectFrom{{complexType}}:object.{{name}} context:managedObject.managedObjectContext]; + } else { + [self.{{name}}Builder update{{complexType}}ManagedObject:managedObject.{{name}} with{{complexType}}:object.{{name}}]; + }{{/isListContainer}}{{/complexType}} + {{/vars}} +} + +-({{classname}}*){{classname}}From{{classname}}ManagedObject:({{classname}}ManagedObject*)obj { + if(!obj) { + return nil; + } + {{classname}}* new{{classname}} = [[{{classname}} alloc] init]; + [self update{{classname}}:new{{classname}} with{{classname}}ManagedObject:obj]; + return new{{classname}}; +} + +-(void)update{{classname}}:({{classname}}*)new{{classname}} with{{classname}}ManagedObject:({{classname}}ManagedObject*)obj { +{{#vars}}{{^complexType}} new{{classname}}.{{name}} = [obj.{{name}} copy];{{/complexType}}{{#complexType}}{{#isListContainer}} if(obj.{{name}} != nil) { + NSMutableArray* convertedObjs = [NSMutableArray array]; + for (id innerObject in obj.{{name}}) { + id convertedObj = [self.{{name}}Builder {{complexType}}From{{complexType}}ManagedObject:innerObject]; + [convertedObjs addObject:convertedObj]; + } + new{{classname}}.{{name}} = ({{{ datatype }}})convertedObjs; + } + {{/isListContainer}}{{^isListContainer}} new{{classname}}.{{name}} = [self.{{name}}Builder {{complexType}}From{{complexType}}ManagedObject:obj.{{name}}];{{/isListContainer}}{{/complexType}} + {{/vars}} +} + +@end +{{/model}} +{{/models}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/objc/NSManagedObjectBuilder-header.mustache b/modules/swagger-codegen/src/main/resources/objc/NSManagedObjectBuilder-header.mustache new file mode 100644 index 00000000000..6a7033bf19a --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/objc/NSManagedObjectBuilder-header.mustache @@ -0,0 +1,35 @@ +#import +#import + +{{#imports}}#import "{{import}}ManagedObjectBuilder.h" +{{/imports}} +{{#models}} +{{#model}} + +#import "{{classPrefix}}{{name}}ManagedObject.h" +#import "{{classPrefix}}{{name}}.h" + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +@interface {{classname}}ManagedObjectBuilder : NSObject + +{{#vars}}{{#complexType}}@property (nonatomic, strong) {{complexType}}ManagedObjectBuilder * {{name}}Builder; +{{/complexType}}{{/vars}} + +-({{classname}}ManagedObject*)createNew{{classname}}ManagedObjectInContext:(NSManagedObjectContext*)context; + +-({{classname}}ManagedObject*){{classname}}ManagedObjectFrom{{classname}}:({{classname}}*){{name}} context:(NSManagedObjectContext*)context; + +-(void)update{{classname}}ManagedObject:({{classname}}ManagedObject*){{name}} with{{classname}}:({{classname}}*){{name}}2; + +-({{classname}}*){{classname}}From{{classname}}ManagedObject:({{classname}}ManagedObject*)obj; + +-(void)update{{classname}}:({{classname}}*){{name}} with{{classname}}ManagedObject:({{classname}}ManagedObject*){{name}}2; + +@end +{{/model}} +{{/models}} diff --git a/modules/swagger-codegen/src/main/resources/objc/Object-header.mustache b/modules/swagger-codegen/src/main/resources/objc/Object-header.mustache index d96e379908f..89da6a4d8b6 100644 --- a/modules/swagger-codegen/src/main/resources/objc/Object-header.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/Object-header.mustache @@ -1,5 +1,8 @@ #import #import +{{>licenceInfo}} + @interface {{classPrefix}}Object : JSONModel + @end diff --git a/modules/swagger-codegen/src/main/resources/objc/QueryParamCollection-header.mustache b/modules/swagger-codegen/src/main/resources/objc/QueryParamCollection-header.mustache index 0389cce98be..9729c182bd8 100644 --- a/modules/swagger-codegen/src/main/resources/objc/QueryParamCollection-header.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/QueryParamCollection-header.mustache @@ -1,5 +1,7 @@ #import +{{>licenceInfo}} + @interface {{classPrefix}}QueryParamCollection : NSObject @property(nonatomic, readonly) NSArray* values; diff --git a/modules/swagger-codegen/src/main/resources/objc/ResponseDeserializer-header.mustache b/modules/swagger-codegen/src/main/resources/objc/ResponseDeserializer-header.mustache index 2dd038c13f0..90aa174d7c4 100644 --- a/modules/swagger-codegen/src/main/resources/objc/ResponseDeserializer-header.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/ResponseDeserializer-header.mustache @@ -1,10 +1,6 @@ #import -/** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen - * Do not edit the class manually. - */ +{{>licenceInfo}} /** * A key for deserialization ErrorDomain diff --git a/modules/swagger-codegen/src/main/resources/objc/Sanitizer-header.mustache b/modules/swagger-codegen/src/main/resources/objc/Sanitizer-header.mustache index cd946661615..f975018a020 100644 --- a/modules/swagger-codegen/src/main/resources/objc/Sanitizer-header.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/Sanitizer-header.mustache @@ -1,10 +1,6 @@ #import -/** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen - * Do not edit the class manually. - */ +{{>licenceInfo}} extern NSString * {{classPrefix}}PercentEscapedStringFromString(NSString *string); diff --git a/modules/swagger-codegen/src/main/resources/objc/api-body.mustache b/modules/swagger-codegen/src/main/resources/objc/api-body.mustache index 5c09f340b4d..57fdc4ae6a7 100644 --- a/modules/swagger-codegen/src/main/resources/objc/api-body.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/api-body.mustache @@ -113,7 +113,7 @@ NSInteger k{{classname}}MissingParamErrorCode = 234513; {{#queryParams}} if ({{paramName}} != nil) { {{#collectionFormat}} - queryParams[@"{{baseName}}"] = [[{{classPrefix}}QueryParamCollection alloc] initWithValuesAndFormat: {{baseName}} format: @"{{collectionFormat}}"]; + queryParams[@"{{baseName}}"] = [[{{classPrefix}}QueryParamCollection alloc] initWithValuesAndFormat: {{paramName}} format: @"{{collectionFormat}}"]; {{/collectionFormat}} {{^collectionFormat}}queryParams[@"{{baseName}}"] = {{paramName}};{{/collectionFormat}} } diff --git a/modules/swagger-codegen/src/main/resources/objc/api-header.mustache b/modules/swagger-codegen/src/main/resources/objc/api-header.mustache index 67bb9045ec8..abe4cf64eb0 100644 --- a/modules/swagger-codegen/src/main/resources/objc/api-header.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/api-header.mustache @@ -2,14 +2,9 @@ {{#imports}}#import "{{import}}.h" {{/imports}} #import "{{classPrefix}}Api.h" -{{newline}} -/** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen - * Do not edit the class manually. - */ -{{#operations}} +{{>licenceInfo}} + @interface {{classname}}: NSObject <{{classPrefix}}Api> @@ -18,6 +13,7 @@ extern NSInteger k{{classname}}MissingParamErrorCode; +(instancetype) sharedAPI; +{{#operations}} {{#operation}} /// {{{summary}}} /// {{#notes}}{{{notes}}}{{/notes}} @@ -33,6 +29,6 @@ extern NSInteger k{{classname}}MissingParamErrorCode; {{newline}} {{/operation}} - {{/operations}} + @end diff --git a/modules/swagger-codegen/src/main/resources/objc/api-protocol.mustache b/modules/swagger-codegen/src/main/resources/objc/api-protocol.mustache index 142b75dabaa..da87a712fa2 100644 --- a/modules/swagger-codegen/src/main/resources/objc/api-protocol.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/api-protocol.mustache @@ -2,11 +2,7 @@ #import "{{classPrefix}}Object.h" #import "{{classPrefix}}ApiClient.h" -/** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen - * Do not edit the class manually. - */ +{{>licenceInfo}} @protocol {{classPrefix}}Api diff --git a/modules/swagger-codegen/src/main/resources/objc/licenceInfo.mustache b/modules/swagger-codegen/src/main/resources/objc/licenceInfo.mustache new file mode 100644 index 00000000000..2f0f1940e89 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/objc/licenceInfo.mustache @@ -0,0 +1,23 @@ +/** +* {{{appName}}} +* {{{appDescription}}} +* +* {{#version}}OpenAPI spec version: {{{version}}}{{/version}} +* {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/objc/model-body.mustache b/modules/swagger-codegen/src/main/resources/objc/model-body.mustache index 6f15d3b6c5b..ae4e66fba69 100644 --- a/modules/swagger-codegen/src/main/resources/objc/model-body.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/model-body.mustache @@ -16,25 +16,18 @@ {{#discriminator}} /** - Maps "discriminator" value to the sub-class name, so that inheritance is supported. + * Maps "discriminator" value to the sub-class name, so that inheritance is supported. */ - (id)initWithDictionary:(NSDictionary *)dict error:(NSError *__autoreleasing *)err { - NSString * discriminatedClassName = [dict valueForKey:@"{{discriminator}}"]; - if(discriminatedClassName == nil ){ return [super initWithDictionary:dict error:err]; } - Class class = NSClassFromString([@"{{classPrefix}}" stringByAppendingString:discriminatedClassName]); - if([self class ] == class) { return [super initWithDictionary:dict error:err]; } - - return [[class alloc] initWithDictionary:dict error: err]; - } {{/discriminator}} @@ -55,7 +48,6 @@ NSArray *optionalProperties = @[{{#vars}}{{^required}}@"{{name}}"{{#hasMore}}, {{/hasMore}}{{/required}}{{/vars}}]; return [optionalProperties containsObject:propertyName]; - } {{/model}} diff --git a/modules/swagger-codegen/src/main/resources/objc/model-header.mustache b/modules/swagger-codegen/src/main/resources/objc/model-header.mustache index f9a33042491..04570e71a2f 100644 --- a/modules/swagger-codegen/src/main/resources/objc/model-header.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/model-header.mustache @@ -1,11 +1,7 @@ #import #import "{{classPrefix}}Object.h" -/** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen - * Do not edit the class manually. - */ +{{>licenceInfo}} {{#imports}}#import "{{import}}.h" {{/imports}} diff --git a/modules/swagger-codegen/src/main/resources/objc/podspec.mustache b/modules/swagger-codegen/src/main/resources/objc/podspec.mustache index c308a399c0a..bd0bd9f328e 100644 --- a/modules/swagger-codegen/src/main/resources/objc/podspec.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/podspec.mustache @@ -19,15 +19,16 @@ Pod::Spec.new do |s| s.platform = :ios, '7.0' s.requires_arc = true - s.framework = 'SystemConfiguration' - + {{^useCoreData}}s.framework = 'SystemConfiguration'{{/useCoreData}}{{#useCoreData}}s.frameworks = 'SystemConfiguration', 'CoreData'{{/useCoreData}} + s.homepage = "{{gitRepoURL}}" - s.license = "{{license}}" + s.license = "{{#license}}{{license}}{{/license}}{{^license}}Apache License, Version 2.0{{/license}}" s.source = { :git => "{{gitRepoURL}}.git", :tag => "#{s.version}" } s.author = { "{{authorName}}" => "{{authorEmail}}" } - s.source_files = '{{podName}}/**/*' + s.source_files = '{{podName}}/**/*.{m,h}' s.public_header_files = '{{podName}}/**/*.h' +{{#useCoreData}} s.resources = '{{podName}}/**/*.{xcdatamodeld,xcdatamodel}'{{/useCoreData}} s.dependency 'AFNetworking', '~> 3' s.dependency 'JSONModel', '~> 1.2' diff --git a/modules/swagger-codegen/src/main/resources/objc/xccurrentversion.mustache b/modules/swagger-codegen/src/main/resources/objc/xccurrentversion.mustache new file mode 100644 index 00000000000..528b389e3ef --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/objc/xccurrentversion.mustache @@ -0,0 +1,8 @@ + + + + + _XCCurrentVersionName + {{classPrefix}}Model.xcdatamodel + + diff --git a/modules/swagger-codegen/src/main/resources/php/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/php/ApiClient.mustache index bfd811b89f0..98a6ad5df8c 100644 --- a/modules/swagger-codegen/src/main/resources/php/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/php/ApiClient.mustache @@ -10,21 +10,8 @@ * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 * @link https://github.com/swagger-api/swagger-codegen */ -/** - * Copyright 2016 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ + +{{>partial_header}} /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -211,7 +198,7 @@ class ApiClient // debugging for curl if ($this->config->getDebug()) { - error_log("[DEBUG] HTTP Request body ~BEGIN~\n".print_r($postData, true)."\n~END~\n", 3, $this->config->getDebugFile()); + error_log("[DEBUG] HTTP Request body ~BEGIN~".PHP_EOL.print_r($postData, true).PHP_EOL."~END~".PHP_EOL, 3, $this->config->getDebugFile()); curl_setopt($curl, CURLOPT_VERBOSE, 1); curl_setopt($curl, CURLOPT_STDERR, fopen($this->config->getDebugFile(), 'a')); @@ -231,7 +218,7 @@ class ApiClient // debug HTTP response body if ($this->config->getDebug()) { - error_log("[DEBUG] HTTP Response body ~BEGIN~\n".print_r($http_body, true)."\n~END~\n", 3, $this->config->getDebugFile()); + error_log("[DEBUG] HTTP Response body ~BEGIN~".PHP_EOL.print_r($http_body, true).PHP_EOL."~END~".PHP_EOL, 3, $this->config->getDebugFile()); } // Handle the response diff --git a/modules/swagger-codegen/src/main/resources/php/ApiException.mustache b/modules/swagger-codegen/src/main/resources/php/ApiException.mustache index 031e8cd995e..2cffdea5ccf 100644 --- a/modules/swagger-codegen/src/main/resources/php/ApiException.mustache +++ b/modules/swagger-codegen/src/main/resources/php/ApiException.mustache @@ -9,21 +9,8 @@ * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 * @link https://github.com/swagger-api/swagger-codegen */ -/** - * Copyright 2016 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ + +{{>partial_header}} /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen diff --git a/modules/swagger-codegen/src/main/resources/php/LICENSE b/modules/swagger-codegen/src/main/resources/php/LICENSE new file mode 100644 index 00000000000..8dada3edaf5 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/php/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/modules/swagger-codegen/src/main/resources/php/ObjectSerializer.mustache b/modules/swagger-codegen/src/main/resources/php/ObjectSerializer.mustache index 7de8d9d085e..4f99eaac4c3 100644 --- a/modules/swagger-codegen/src/main/resources/php/ObjectSerializer.mustache +++ b/modules/swagger-codegen/src/main/resources/php/ObjectSerializer.mustache @@ -10,21 +10,8 @@ * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 * @link https://github.com/swagger-api/swagger-codegen */ -/** - * Copyright 2016 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ + +{{>partial_header}} /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -271,7 +258,7 @@ class ObjectSerializer $byte_written = $deserialized->fwrite($data); if (Configuration::getDefaultConfiguration()->getDebug()) { - error_log("[DEBUG] Written $byte_written byte to $filename. Please move the file to a proper folder or delete the temp file after processing.\n", 3, Configuration::getDefaultConfiguration()->getDebugFile()); + error_log("[DEBUG] Written $byte_written byte to $filename. Please move the file to a proper folder or delete the temp file after processing.".PHP_EOL, 3, Configuration::getDefaultConfiguration()->getDebugFile()); } return $deserialized; diff --git a/modules/swagger-codegen/src/main/resources/php/README.mustache b/modules/swagger-codegen/src/main/resources/php/README.mustache index 1f96e378f1b..16694d0dad7 100644 --- a/modules/swagger-codegen/src/main/resources/php/README.mustache +++ b/modules/swagger-codegen/src/main/resources/php/README.mustache @@ -82,7 +82,7 @@ try { {{#returnType}}$result = {{/returnType}}$api_instance->{{{operationId}}}({{#allParams}}${{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{#returnType}} print_r($result);{{/returnType}} } catch (Exception $e) { - echo 'Exception when calling {{classname}}->{{operationId}}: ', $e->getMessage(), "\n"; + echo 'Exception when calling {{classname}}->{{operationId}}: ', $e->getMessage(), PHP_EOL; } {{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} ?> diff --git a/modules/swagger-codegen/src/main/resources/php/api.mustache b/modules/swagger-codegen/src/main/resources/php/api.mustache index 26024ea4789..26f79cd6139 100644 --- a/modules/swagger-codegen/src/main/resources/php/api.mustache +++ b/modules/swagger-codegen/src/main/resources/php/api.mustache @@ -9,22 +9,8 @@ * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 * @link https://github.com/swagger-api/swagger-codegen */ -/** - * Copyright 2016 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +{{>partial_header}} /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen diff --git a/modules/swagger-codegen/src/main/resources/php/api_doc.mustache b/modules/swagger-codegen/src/main/resources/php/api_doc.mustache index be2cb895fed..75ec5f8acd8 100644 --- a/modules/swagger-codegen/src/main/resources/php/api_doc.mustache +++ b/modules/swagger-codegen/src/main/resources/php/api_doc.mustache @@ -41,7 +41,7 @@ try { {{#returnType}}$result = {{/returnType}}$api_instance->{{{operationId}}}({{#allParams}}${{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{#returnType}} print_r($result);{{/returnType}} } catch (Exception $e) { - echo 'Exception when calling {{classname}}->{{operationId}}: ', $e->getMessage(), "\n"; + echo 'Exception when calling {{classname}}->{{operationId}}: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -50,7 +50,7 @@ try { {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} Name | Type | Description | Notes ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isFile}}[**{{dataType}}**](../Model/{{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}} +{{#allParams}} **{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isFile}}[**{{dataType}}**](../Model/{{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{defaultValue}}]{{/defaultValue}} {{/allParams}} ### Return type diff --git a/modules/swagger-codegen/src/main/resources/php/api_test.mustache b/modules/swagger-codegen/src/main/resources/php/api_test.mustache index 6a525223584..c53cd6e1ad2 100644 --- a/modules/swagger-codegen/src/main/resources/php/api_test.mustache +++ b/modules/swagger-codegen/src/main/resources/php/api_test.mustache @@ -9,22 +9,8 @@ * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 * @link https://github.com/swagger-api/swagger-codegen */ -/** - * Copyright 2016 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +{{>partial_header}} /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen diff --git a/modules/swagger-codegen/src/main/resources/php/autoload.mustache b/modules/swagger-codegen/src/main/resources/php/autoload.mustache index 0942715ce8d..28ce32ae50a 100644 --- a/modules/swagger-codegen/src/main/resources/php/autoload.mustache +++ b/modules/swagger-codegen/src/main/resources/php/autoload.mustache @@ -1,4 +1,6 @@ partial_header}} /** * An example of a project-specific implementation. * diff --git a/modules/swagger-codegen/src/main/resources/php/configuration.mustache b/modules/swagger-codegen/src/main/resources/php/configuration.mustache index 1b920e48357..da21523cfa5 100644 --- a/modules/swagger-codegen/src/main/resources/php/configuration.mustache +++ b/modules/swagger-codegen/src/main/resources/php/configuration.mustache @@ -10,22 +10,7 @@ * @link https://github.com/swagger-api/swagger-codegen */ -/** - * Copyright 2016 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - +{{>partial_header}} /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -513,12 +498,12 @@ class Configuration */ public static function toDebugReport() { - $report = "PHP SDK ({{invokerPackage}}) Debug Report:\n"; - $report .= " OS: ".php_uname()."\n"; - $report .= " PHP Version: ".phpversion()."\n"; - $report .= " OpenAPI Spec Version: {{version}}\n"; - $report .= " SDK Package Version: {{artifactVersion}}\n"; - $report .= " Temp Folder Path: ".self::getDefaultConfiguration()->getTempFolderPath()."\n"; + $report = "PHP SDK ({{invokerPackage}}) Debug Report:".PHP_EOL; + $report .= " OS: ".php_uname().PHP_EOL; + $report .= " PHP Version: ".phpversion().PHP_EOL; + $report .= " OpenAPI Spec Version: {{version}}".PHP_EOL; + $report .= " SDK Package Version: {{artifactVersion}}".PHP_EOL; + $report .= " Temp Folder Path: ".self::getDefaultConfiguration()->getTempFolderPath().PHP_EOL; return $report; } diff --git a/modules/swagger-codegen/src/main/resources/php/model.mustache b/modules/swagger-codegen/src/main/resources/php/model.mustache index 488b82433d9..9fc2b620ddd 100644 --- a/modules/swagger-codegen/src/main/resources/php/model.mustache +++ b/modules/swagger-codegen/src/main/resources/php/model.mustache @@ -12,21 +12,8 @@ * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 * @link https://github.com/swagger-api/swagger-codegen */ -/** - * Copyright 2016 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ + +{{>partial_header}} /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen diff --git a/modules/swagger-codegen/src/main/resources/php/model_test.mustache b/modules/swagger-codegen/src/main/resources/php/model_test.mustache index 3482629f917..d7d93f32186 100644 --- a/modules/swagger-codegen/src/main/resources/php/model_test.mustache +++ b/modules/swagger-codegen/src/main/resources/php/model_test.mustache @@ -12,21 +12,8 @@ * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 * @link https://github.com/swagger-api/swagger-codegen */ -/** - * Copyright 2016 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ + +{{>partial_header}} /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen diff --git a/modules/swagger-codegen/src/main/resources/php/partial_header.mustache b/modules/swagger-codegen/src/main/resources/php/partial_header.mustache new file mode 100644 index 00000000000..61098d84563 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/php/partial_header.mustache @@ -0,0 +1,25 @@ +/** + {{#appName}} + * {{{appName}}} + * + {{/appName}} + {{#appDescription}} + * {{{appDescription}}} + * + {{/appDescription}} + * {{#version}}OpenAPI spec version: {{{version}}}{{/version}} + * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ diff --git a/modules/swagger-codegen/src/main/resources/python/LICENSE b/modules/swagger-codegen/src/main/resources/python/LICENSE new file mode 100644 index 00000000000..9c8f3ea0871 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/python/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/python/__init__model.mustache b/modules/swagger-codegen/src/main/resources/python/__init__model.mustache index da086c10873..1a9eaf62794 100644 --- a/modules/swagger-codegen/src/main/resources/python/__init__model.mustache +++ b/modules/swagger-codegen/src/main/resources/python/__init__model.mustache @@ -1,3 +1,7 @@ +# coding: utf-8 + +{{>partial_header}} + from __future__ import absolute_import # import models into model package diff --git a/modules/swagger-codegen/src/main/resources/python/__init__package.mustache b/modules/swagger-codegen/src/main/resources/python/__init__package.mustache index 5265587cfd9..6528c480eed 100644 --- a/modules/swagger-codegen/src/main/resources/python/__init__package.mustache +++ b/modules/swagger-codegen/src/main/resources/python/__init__package.mustache @@ -1,3 +1,7 @@ +# coding: utf-8 + +{{>partial_header}} + from __future__ import absolute_import # import models into sdk package diff --git a/modules/swagger-codegen/src/main/resources/python/api.mustache b/modules/swagger-codegen/src/main/resources/python/api.mustache index c9c94ad3e3e..43962c7f525 100644 --- a/modules/swagger-codegen/src/main/resources/python/api.mustache +++ b/modules/swagger-codegen/src/main/resources/python/api.mustache @@ -1,21 +1,6 @@ # coding: utf-8 -""" -{{classname}}.py -Copyright 2016 SmartBear Software - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" +{{>partial_header}} from __future__ import absolute_import diff --git a/modules/swagger-codegen/src/main/resources/python/api_test.mustache b/modules/swagger-codegen/src/main/resources/python/api_test.mustache index 5f0b0ab6ecb..4906d0e0371 100644 --- a/modules/swagger-codegen/src/main/resources/python/api_test.mustache +++ b/modules/swagger-codegen/src/main/resources/python/api_test.mustache @@ -1,22 +1,6 @@ # coding: utf-8 -""" -Copyright 2016 SmartBear Software - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - ref: https://github.com/swagger-api/swagger-codegen -""" +{{>partial_header}} from __future__ import absolute_import diff --git a/modules/swagger-codegen/src/main/resources/python/configuration.mustache b/modules/swagger-codegen/src/main/resources/python/configuration.mustache index 8f878f82318..9ea2ab4a7b5 100644 --- a/modules/swagger-codegen/src/main/resources/python/configuration.mustache +++ b/modules/swagger-codegen/src/main/resources/python/configuration.mustache @@ -1,22 +1,6 @@ # coding: utf-8 -""" -Copyright 2016 SmartBear Software - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - ref: https://github.com/swagger-api/swagger-codegen -""" +{{>partial_header}} from __future__ import absolute_import import base64 diff --git a/modules/swagger-codegen/src/main/resources/python/model.mustache b/modules/swagger-codegen/src/main/resources/python/model.mustache index e62fa2cbf66..781bb37e4e5 100644 --- a/modules/swagger-codegen/src/main/resources/python/model.mustache +++ b/modules/swagger-codegen/src/main/resources/python/model.mustache @@ -1,22 +1,6 @@ # coding: utf-8 -""" -Copyright 2016 SmartBear Software - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - Ref: https://github.com/swagger-api/swagger-codegen -""" +{{>partial_header}} {{#models}} {{#model}} diff --git a/modules/swagger-codegen/src/main/resources/python/model_test.mustache b/modules/swagger-codegen/src/main/resources/python/model_test.mustache index c00a10a9b51..ffd38a52b49 100644 --- a/modules/swagger-codegen/src/main/resources/python/model_test.mustache +++ b/modules/swagger-codegen/src/main/resources/python/model_test.mustache @@ -1,22 +1,6 @@ # coding: utf-8 -""" -Copyright 2016 SmartBear Software - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - ref: https://github.com/swagger-api/swagger-codegen -""" +{{>partial_header}} from __future__ import absolute_import diff --git a/modules/swagger-codegen/src/main/resources/python/partial_header.mustache b/modules/swagger-codegen/src/main/resources/python/partial_header.mustache new file mode 100644 index 00000000000..ea97064963c --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/python/partial_header.mustache @@ -0,0 +1,25 @@ +""" +{{#appName}} + {{{appName}}} +{{/appName}} + +{{#appDescription}} + {{{appDescription}}} +{{/appDescription}} + + {{#version}}OpenAPI spec version: {{{version}}}{{/version}} + {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} + Generated by: https://github.com/swagger-api/swagger-codegen.git + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +""" \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/python/rest.mustache b/modules/swagger-codegen/src/main/resources/python/rest.mustache index 352bb503ac5..e09090a9794 100644 --- a/modules/swagger-codegen/src/main/resources/python/rest.mustache +++ b/modules/swagger-codegen/src/main/resources/python/rest.mustache @@ -1,23 +1,7 @@ # coding: utf-8 -""" -Copyright 2016 SmartBear Software +{{>partial_header}} - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -Credit: this file (rest.py) is modified based on rest.py in Dropbox Python SDK: -https://www.dropbox.com/developers/core/sdks/python -""" from __future__ import absolute_import import sys diff --git a/modules/swagger-codegen/src/main/resources/python/setup.mustache b/modules/swagger-codegen/src/main/resources/python/setup.mustache index f95b1f56a0f..c825911f91a 100644 --- a/modules/swagger-codegen/src/main/resources/python/setup.mustache +++ b/modules/swagger-codegen/src/main/resources/python/setup.mustache @@ -1,5 +1,7 @@ # coding: utf-8 +{{>partial_header}} + import sys from setuptools import setup, find_packages diff --git a/modules/swagger-codegen/src/main/resources/rails5/controller.mustache b/modules/swagger-codegen/src/main/resources/rails5/controller.mustache index 321960875d8..d4c44d54d26 100644 --- a/modules/swagger-codegen/src/main/resources/rails5/controller.mustache +++ b/modules/swagger-codegen/src/main/resources/rails5/controller.mustache @@ -1,3 +1,6 @@ +=begin +{{> info}} +=end class {{classname}} < ApplicationController {{#operations}} {{#operation}} diff --git a/modules/swagger-codegen/src/main/resources/rails5/info.mustache b/modules/swagger-codegen/src/main/resources/rails5/info.mustache new file mode 100644 index 00000000000..44d38c5cfad --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/rails5/info.mustache @@ -0,0 +1,23 @@ +{{#appName}} +{{{appName}}} + +{{/appName}} +{{#appDescription}} +{{{appDescription}}} + +{{/appDescription}} +{{#version}}OpenAPI spec version: {{version}}{{/version}} +{{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} +Generated by: https://github.com/swagger-api/swagger-codegen.git + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/modules/swagger-codegen/src/main/resources/rails5/routes.mustache b/modules/swagger-codegen/src/main/resources/rails5/routes.mustache index 6ebc0d4965d..76d745d3606 100644 --- a/modules/swagger-codegen/src/main/resources/rails5/routes.mustache +++ b/modules/swagger-codegen/src/main/resources/rails5/routes.mustache @@ -1,3 +1,6 @@ +=begin +{{> info}} +=end Rails.application.routes.draw do def add_swagger_route http_method, path, opts = {} diff --git a/modules/swagger-codegen/src/main/resources/ruby/LICENSE b/modules/swagger-codegen/src/main/resources/ruby/LICENSE new file mode 100644 index 00000000000..8dada3edaf5 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/ruby/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/modules/swagger-codegen/src/main/resources/ruby/api_client_spec.mustache b/modules/swagger-codegen/src/main/resources/ruby/api_client_spec.mustache index 1ed497da21e..ae32ff0ccfa 100644 --- a/modules/swagger-codegen/src/main/resources/ruby/api_client_spec.mustache +++ b/modules/swagger-codegen/src/main/resources/ruby/api_client_spec.mustache @@ -1,3 +1,7 @@ +=begin +{{> api_info}} +=end + require 'spec_helper' describe {{moduleName}}::ApiClient do diff --git a/modules/swagger-codegen/src/main/resources/ruby/api_info.mustache b/modules/swagger-codegen/src/main/resources/ruby/api_info.mustache index 28301757e70..44d38c5cfad 100644 --- a/modules/swagger-codegen/src/main/resources/ruby/api_info.mustache +++ b/modules/swagger-codegen/src/main/resources/ruby/api_info.mustache @@ -1,18 +1,23 @@ -{{#appName}}{{{appName}}} +{{#appName}} +{{{appName}}} {{/appName}} -{{#appDescription}}{{{appDescription}}} +{{#appDescription}} +{{{appDescription}}} {{/appDescription}} {{#version}}OpenAPI spec version: {{version}}{{/version}} {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} Generated by: https://github.com/swagger-api/swagger-codegen.git -{{#licenseInfo}} -License: {{{licenseInfo}}} -{{#licenseUrl}}{{licenseUrl}}{{/licenseUrl}} +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at -{{/licenseInfo}} -{{#termsOfService}} -Terms of Service: {{{termsOfService}}} -{{/termsOfService}} +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/modules/swagger-codegen/src/main/resources/ruby/configuration.mustache b/modules/swagger-codegen/src/main/resources/ruby/configuration.mustache index 160fa85a57d..e22b6d6f8a1 100644 --- a/modules/swagger-codegen/src/main/resources/ruby/configuration.mustache +++ b/modules/swagger-codegen/src/main/resources/ruby/configuration.mustache @@ -1,3 +1,7 @@ +=begin +{{> api_info}} +=end + require 'uri' module {{moduleName}} diff --git a/modules/swagger-codegen/src/main/resources/ruby/configuration_spec.mustache b/modules/swagger-codegen/src/main/resources/ruby/configuration_spec.mustache index 4c23a067175..6ea22543491 100644 --- a/modules/swagger-codegen/src/main/resources/ruby/configuration_spec.mustache +++ b/modules/swagger-codegen/src/main/resources/ruby/configuration_spec.mustache @@ -1,3 +1,7 @@ +=begin +{{> api_info}} +=end + require 'spec_helper' describe {{moduleName}}::Configuration do diff --git a/modules/swagger-codegen/src/main/resources/ruby/gemspec.mustache b/modules/swagger-codegen/src/main/resources/ruby/gemspec.mustache index 65884d0f562..86d9a6e55d8 100644 --- a/modules/swagger-codegen/src/main/resources/ruby/gemspec.mustache +++ b/modules/swagger-codegen/src/main/resources/ruby/gemspec.mustache @@ -1,4 +1,9 @@ # -*- encoding: utf-8 -*- +# +=begin +{{> api_info}} +=end + $:.push File.expand_path("../lib", __FILE__) require "{{gemName}}/version" diff --git a/modules/swagger-codegen/src/main/resources/ruby/git_push.sh.mustache b/modules/swagger-codegen/src/main/resources/ruby/git_push.sh.mustache index a9b0f28edfb..3def1140afc 100755 --- a/modules/swagger-codegen/src/main/resources/ruby/git_push.sh.mustache +++ b/modules/swagger-codegen/src/main/resources/ruby/git_push.sh.mustache @@ -1,4 +1,19 @@ #!/bin/sh +# +# Generated by: https://github.com/swagger-api/swagger-codegen.git +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ # # Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" diff --git a/modules/swagger-codegen/src/main/resources/ruby/gitignore.mustache b/modules/swagger-codegen/src/main/resources/ruby/gitignore.mustache index a8b1cda23f8..522134fcdd3 100644 --- a/modules/swagger-codegen/src/main/resources/ruby/gitignore.mustache +++ b/modules/swagger-codegen/src/main/resources/ruby/gitignore.mustache @@ -1,3 +1,17 @@ +# Generated by: https://github.com/swagger-api/swagger-codegen.git +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + *.gem *.rbc /.config diff --git a/modules/swagger-codegen/src/main/resources/ruby/model_test.mustache b/modules/swagger-codegen/src/main/resources/ruby/model_test.mustache index 305a10d6467..9425585780f 100644 --- a/modules/swagger-codegen/src/main/resources/ruby/model_test.mustache +++ b/modules/swagger-codegen/src/main/resources/ruby/model_test.mustache @@ -27,7 +27,15 @@ require 'date' {{#vars}} describe 'test attribute "{{{name}}}"' do it 'should work' do + {{#isEnum}} + validator = Petstore::EnumTest::EnumAttributeValidator.new('{{{datatype}}}', [{{#allowableValues}}{{#values}}"{{{this}}}"{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}]) + validator.allowable_values.each do |value| + expect { @instance.{{name}} = value }.not_to raise_error + end + {{/isEnum}} + {{^isEnum}} # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + {{/isEnum}} end end diff --git a/modules/swagger-codegen/src/main/resources/ruby/partial_model_generic.mustache b/modules/swagger-codegen/src/main/resources/ruby/partial_model_generic.mustache index 25a71610168..0335500863f 100644 --- a/modules/swagger-codegen/src/main/resources/ruby/partial_model_generic.mustache +++ b/modules/swagger-codegen/src/main/resources/ruby/partial_model_generic.mustache @@ -4,6 +4,30 @@ attr_accessor :{{{name}}} {{/vars}} +{{#hasEnums}} + 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 +{{/hasEnums}} + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -53,13 +77,6 @@ # @return Array for valid properies with the reasons def list_invalid_properties invalid_properties = Array.new - {{#isEnum}} - allowed_values = [{{#allowableValues}}{{#values}}"{{{this}}}"{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}] - if @{{{name}}} && !allowed_values.include?({{{name}}}) - invalid_properties.push("invalid value for '{{{name}}}', must be one of #{allowed_values}.") - end - - {{/isEnum}} {{#hasValidation}} if @{{{name}}}.nil? fail ArgumentError, "{{{name}}} cannot be nil" @@ -104,50 +121,31 @@ def valid? {{#vars}} {{#required}} - if @{{{name}}}.nil? - return false - end - + return false if @{{{name}}}.nil? {{/required}} {{#isEnum}} - allowed_values = [{{#allowableValues}}{{#values}}"{{{this}}}"{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}] - if @{{{name}}} && !allowed_values.include?(@{{{name}}}) - return false - end + {{{name}}}_validator = EnumAttributeValidator.new('{{{datatype}}}', [{{#allowableValues}}{{#values}}"{{{this}}}"{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}]) + return false unless {{{name}}}_validator.valid?(@{{{name}}}) {{/isEnum}} {{#hasValidation}} {{#minLength}} - if @{{{name}}}.to_s.length > {{{maxLength}}} - return false - end - + return false if @{{{name}}}.to_s.length > {{{maxLength}}} {{/minLength}} {{#maxLength}} - if @{{{name}}}.to_s.length < {{{minLength}}} - return false - end - + return false if @{{{name}}}.to_s.length < {{{minLength}}} {{/maxLength}} {{#maximum}} - if @{{{name}}} > {{{maximum}}} - return false - end - + return false if @{{{name}}} > {{{maximum}}} {{/maximum}} {{#minimum}} - if @{{{name}}} < {{{minimum}}} - return false - end - + return false if @{{{name}}} < {{{minimum}}} {{/minimum}} {{#pattern}} - if @{{{name}}} !~ Regexp.new({{{pattern}}}) - return false - end - + return false if @{{{name}}} !~ Regexp.new({{{pattern}}}) {{/pattern}} {{/hasValidation}} {{/vars}} + return true end {{#vars}} @@ -155,9 +153,9 @@ # Custom attribute writer method checking allowed values (enum). # @param [Object] {{{name}}} Object to be assigned def {{{name}}}=({{{name}}}) - allowed_values = [{{#allowableValues}}{{#values}}"{{{this}}}"{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}] - if {{{name}}} && !allowed_values.include?({{{name}}}) - fail ArgumentError, "invalid value for '{{{name}}}', must be one of #{allowed_values}." + validator = EnumAttributeValidator.new('{{{datatype}}}', [{{#allowableValues}}{{#values}}"{{{this}}}"{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}]) + unless validator.valid?({{{name}}}) + fail ArgumentError, "invalid value for '{{{name}}}', must be one of #{validator.allowable_values}." end @{{{name}}} = {{{name}}} end diff --git a/modules/swagger-codegen/src/main/resources/ruby/spec_helper.mustache b/modules/swagger-codegen/src/main/resources/ruby/spec_helper.mustache index bc4187c3378..8f4bb754165 100644 --- a/modules/swagger-codegen/src/main/resources/ruby/spec_helper.mustache +++ b/modules/swagger-codegen/src/main/resources/ruby/spec_helper.mustache @@ -1,3 +1,7 @@ +=begin +{{> api_info}} +=end + # load the gem require '{{{gemName}}}' diff --git a/modules/swagger-codegen/src/main/resources/swagger-static/package.mustache b/modules/swagger-codegen/src/main/resources/swagger-static/package.mustache index d728e9f0063..637b12bccc0 100644 --- a/modules/swagger-codegen/src/main/resources/swagger-static/package.mustache +++ b/modules/swagger-codegen/src/main/resources/swagger-static/package.mustache @@ -8,5 +8,5 @@ "dependencies": { "express": "3.x" }, - "license": "apache 2.0" + "license": "Apache-2.0" } diff --git a/modules/swagger-codegen/src/main/resources/swift/model.mustache b/modules/swagger-codegen/src/main/resources/swift/model.mustache index 96c4d2ff683..a42ff74a644 100644 --- a/modules/swagger-codegen/src/main/resources/swift/model.mustache +++ b/modules/swagger-codegen/src/main/resources/swift/model.mustache @@ -33,7 +33,7 @@ public class {{classname}}: JSONEncodable { public init() {} {{/unwrapRequired}} {{#unwrapRequired}} - public init({{#requiredVars}}{{^-first}}, {{/-first}}{{name}}: {{#isEnum}}{{datatypeWithEnum}}!{{/isEnum}}{{^isEnum}}{{datatype}}!{{/isEnum}}{{/requiredVars}}) { + public init({{#requiredVars}}{{^-first}}, {{/-first}}{{name}}: {{#isEnum}}{{datatypeWithEnum}}{{/isEnum}}{{^isEnum}}{{datatype}}{{/isEnum}}{{/requiredVars}}) { {{#requiredVars}} self.{{name}} = {{name}} {{/requiredVars}} diff --git a/modules/swagger-codegen/src/main/resources/typescript-angular2/package.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular2/package.mustache index 28a18bfb91b..70cb98cce7e 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-angular2/package.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-angular2/package.mustache @@ -6,7 +6,7 @@ "keywords": [ "swagger-client" ], - "license": "MIT", + "license": "Apache-2.0", "files": [ "lib" ], diff --git a/modules/swagger-codegen/src/main/resources/typescript-node/api.mustache b/modules/swagger-codegen/src/main/resources/typescript-node/api.mustache index 00644f77401..2d1c16309bd 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-node/api.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-node/api.mustache @@ -111,6 +111,7 @@ export enum {{classname}}ApiKeys { export class {{classname}} { protected basePath = defaultBasePath; protected defaultHeaders : any = {}; + protected _useQuerystring : boolean = false; protected authentications = { 'default': new VoidAuth(), @@ -151,12 +152,15 @@ export class {{classname}} { } } + set useQuerystring(value: boolean) { + this._useQuerystring = value; + } + public setApiKey(key: {{classname}}ApiKeys, value: string) { this.authentications[{{classname}}ApiKeys[key]].apiKey = value; } {{#authMethods}} {{#isBasic}} - set username(username: string) { this.authentications.{{name}}.username = username; } @@ -225,6 +229,7 @@ export class {{classname}} { qs: queryParameters, headers: headerParams, uri: localVarPath, + useQuerystring: this._useQuerystring, json: true, {{#bodyParam}} body: {{paramName}}, diff --git a/modules/swagger-codegen/src/main/resources/typescript-node/package.mustache b/modules/swagger-codegen/src/main/resources/typescript-node/package.mustache index 0d419996ed6..d7b5a8142a4 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-node/package.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-node/package.mustache @@ -5,8 +5,10 @@ "repository": "{{gitUserId}}/{{gitRepoId}}", "main": "api.js", "scripts": { + "postinstall": "typings install", "clean": "rm -Rf node_modules/ typings/ *.js", - "build": "typings install && tsc" + "build": "tsc", + "test": "npm run build && node client.js" }, "author": "Swagger Codegen Contributors", "license": "Apache-2.0", diff --git a/modules/swagger-codegen/src/main/resources/typescript-node/tsconfig.mustache b/modules/swagger-codegen/src/main/resources/typescript-node/tsconfig.mustache index 1a3bd00183a..e47082e11e9 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-node/tsconfig.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-node/tsconfig.mustache @@ -10,9 +10,10 @@ "noLib": false, "declaration": true }, - "files": [ - "api.ts", - "typings/main.d.ts" + "exclude": [ + "node_modules", + "typings/browser", + "typings/browser.d.ts" ] } diff --git a/modules/swagger-codegen/src/main/resources/typescript-node/typings.mustache b/modules/swagger-codegen/src/main/resources/typescript-node/typings.mustache index 76c4cc8e6af..22fcebdc231 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-node/typings.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-node/typings.mustache @@ -1,10 +1,10 @@ { "ambientDependencies": { - "bluebird": "registry:dt/bluebird#2.0.0+20160319051630", "core-js": "registry:dt/core-js#0.0.0+20160317120654", "node": "registry:dt/node#4.0.0+20160423143914" }, "dependencies": { + "bluebird": "registry:npm/bluebird#3.3.4+20160515010139", "request": "registry:npm/request#2.69.0+20160304121250" } } \ No newline at end of file diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/ignore/CodegenIgnoreProcessorTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/ignore/CodegenIgnoreProcessorTest.java index a9fe89214d5..784fcfe8480 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/ignore/CodegenIgnoreProcessorTest.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/ignore/CodegenIgnoreProcessorTest.java @@ -1,21 +1,141 @@ package io.swagger.codegen.ignore; -import org.testng.annotations.Test; +import org.apache.commons.io.FileUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.testng.annotations.*; +import static org.testng.Assert.*; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; public class CodegenIgnoreProcessorTest { - @Test - public void loadCodegenRules() throws Exception { + private static final Logger LOGGER = LoggerFactory.getLogger(CodegenIgnoreProcessorTest.class); + + private Boolean allowed; + private final String filename; + private final String ignoreDefinition; + private final String description; + private String outputDir; + private File target; + private Path temp; + + private CodegenIgnoreProcessorTest(String filename, String ignoreDefinition, String description) throws IOException { + this.filename = filename; + this.ignoreDefinition = ignoreDefinition; + this.description = description; + } + + CodegenIgnoreProcessorTest allowed() { + this.allowed = true; + return this; + } + + CodegenIgnoreProcessorTest ignored() { + this.allowed = false; + return this; + } + + private void prepareTestFiles() throws IOException { + // NOTE: Each test needs its own directory because .swagger-codegen-ignore needs to exist at the root. + temp = Files.createTempDirectory(getClass().getSimpleName()); + this.outputDir = temp.toFile().getAbsolutePath(); + + target = new File(this.outputDir, this.filename); + + boolean mkdirs = target.getParentFile().mkdirs(); + if(!mkdirs) { + LOGGER.warn("Failed to create directories for CodegenIgnoreProcessorTest test file. Directory may already exist."); + } + + Path created = Files.createFile(target.toPath()); + if(!created.toFile().exists()) { + throw new IOException("Failed to write CodegenIgnoreProcessorTest test file."); + } + + // System.out.print(String.format("Created codegen ignore processor test file: %s\n", created.toAbsolutePath())); + File ignoreFile = new File(this.outputDir, ".swagger-codegen-ignore"); + try (FileOutputStream stream = new FileOutputStream(ignoreFile)) { + stream.write(this.ignoreDefinition.getBytes()); + } + } + + @AfterTest + public void afterTest() throws IOException { + if(temp != null && temp.toFile().exists() && temp.toFile().isDirectory()) { + FileUtils.deleteDirectory(temp.toFile()); + } } @Test - public void getInclusionRules() throws Exception { + public void evaluate() { + // Arrange + try { + // Lazily setup files to avoid conflicts and creation when these tests may not even run. + prepareTestFiles(); + } catch (IOException e) { + e.printStackTrace(); + fail("Failed to prepare test files. " + e.getMessage()); + } + CodegenIgnoreProcessor processor = new CodegenIgnoreProcessor(outputDir); + Boolean actual = null; + // Act + actual = processor.allowsFile(target); + + // Assert + assertEquals(actual, this.allowed, this.description); } - @Test - public void getExclusionRules() throws Exception { + @Factory + public static Object[] factoryMethod() throws IOException { + return new Object[] { + // Matching filenames + new CodegenIgnoreProcessorTest("build.sh", "build.sh", "A file when matching should ignore.").ignored(), + new CodegenIgnoreProcessorTest("src/build.sh", "**/build.sh", "A file when matching nested files should ignore.").ignored(), + new CodegenIgnoreProcessorTest("Build.sh", "build.sh", "A file when non-matching should allow.").allowed(), + new CodegenIgnoreProcessorTest("build.sh", "/build.sh", "A rooted file when matching should ignore.").ignored(), + new CodegenIgnoreProcessorTest("nested/build.sh", "/build.sh", "A rooted file definition when non-matching should allow.").allowed(), + new CodegenIgnoreProcessorTest("src/IO.Swagger.Test/Model/AnimalFarmTests.cs", "src/IO.Swagger.Test/Model/AnimalFarmTests.cs", "A file when matching exactly should ignore.").ignored(), + // Matching spaces in filenames + new CodegenIgnoreProcessorTest("src/properly escaped.txt", "**/properly escaped.txt", "A file when matching nested files with spaces in the name should ignore.").ignored(), + new CodegenIgnoreProcessorTest("src/improperly escaped.txt", "**/improperly\\ escaped.txt", "A file when matching nested files with spaces in the name (improperly escaped rule) should allow.").allowed(), + + // Match All + new CodegenIgnoreProcessorTest("docs/somefile.md", "docs/**", "A recursive file (0 level) when matching should ignore.").ignored(), + new CodegenIgnoreProcessorTest("docs/1/somefile.md", "docs/**", "A recursive file (1 level) when matching should ignore.").ignored(), + new CodegenIgnoreProcessorTest("docs/1/2/3/somefile.md", "docs/**", "A recursive file (n level) when matching should ignore.").ignored(), + + // Match Any + new CodegenIgnoreProcessorTest("docs/1/2/3/somefile.md", "docs/**/somefile.*", "A recursive file with match-any extension when matching should ignore.").ignored(), + new CodegenIgnoreProcessorTest("docs/1/2/3/somefile.java", "docs/**/*.java", "A recursive file with match-any file name when matching should ignore.").ignored(), + new CodegenIgnoreProcessorTest("docs/1/2/3/4/somefile.md", "docs/**/*", "A recursive file with match-any file name when matching should ignore.").ignored(), + new CodegenIgnoreProcessorTest("docs/1/2/3/4/5/somefile.md", "docs/**/anyfile.*", "A recursive file with match-any extension when non-matching should allow.").allowed(), + + // Directory matches + new CodegenIgnoreProcessorTest("docs/1/Users/a", "docs/**/Users/", "A directory rule when matching should be ignored.").ignored(), + new CodegenIgnoreProcessorTest("docs/1/Users1/a", "docs/**/Users/", "A directory rule when non-matching should be allowed.").allowed(), + + // Negation of excluded recursive files + new CodegenIgnoreProcessorTest("docs/UserApi.md", "docs/**\n!docs/UserApi.md", "A pattern negating a previous ignore FILE rule should be allowed.").allowed(), + + // Negation of excluded directories + new CodegenIgnoreProcessorTest("docs/1/Users/UserApi.md", "docs/**/Users/\n!docs/1/Users/UserApi.md", "A pattern negating a previous ignore DIRECTORY rule should be ignored.").ignored(), + + // Other matches which may not be parsed for correctness, but are free because of PathMatcher + new CodegenIgnoreProcessorTest("docs/1/2/3/Some99File.md", "**/*[0-9]*", "A file when matching against simple regex patterns when matching should be ignored.").ignored(), + new CodegenIgnoreProcessorTest("docs/1/2/3/SomeFile.md", "**/*.{java,md}", "A file when matching against grouped subpatterns for extension when matching (md) should be ignored.").ignored(), + new CodegenIgnoreProcessorTest("docs/1/2/3/SomeFile.java", "**/*.{java,md}", "A file when matching against grouped subpatterns for extension when matching (java) should be ignored.").ignored(), + new CodegenIgnoreProcessorTest("docs/1/2/3/SomeFile.txt", "**/*.{java,md}", "A file when matching against grouped subpatterns for extension when non-matching should be allowed.").allowed(), + + new CodegenIgnoreProcessorTest("docs/1/2/3/foo.c", "**/*.?", "A file when matching against required single-character extension when matching should be ignored.").ignored(), + new CodegenIgnoreProcessorTest("docs/1/2/3/foo.cc", "**/*.?", "A file when matching against required single-character extension when non-matching should be allowed.").allowed() + + }; } - } \ No newline at end of file diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/objc/ObjcClientOptionsTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/objc/ObjcClientOptionsTest.java index 795c6ee2d9c..f1d55e007da 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/objc/ObjcClientOptionsTest.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/objc/ObjcClientOptionsTest.java @@ -38,8 +38,6 @@ public class ObjcClientOptionsTest extends AbstractOptionsTest { times = 1; clientCodegen.setGitRepoURL(ObjcClientOptionsProvider.GIT_REPO_URL_VALUE); times = 1; - clientCodegen.setLicense(ObjcClientOptionsProvider.LICENSE_VALUE); - times = 1; }}; } } diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/ObjcClientOptionsProvider.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/ObjcClientOptionsProvider.java index 2f76199e4f3..4df5c5e1db6 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/ObjcClientOptionsProvider.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/ObjcClientOptionsProvider.java @@ -9,12 +9,12 @@ import java.util.Map; public class ObjcClientOptionsProvider implements OptionsProvider { public static final String CLASS_PREFIX_VALUE = "SWGObjc"; + public static final String CORE_DATA_VALUE = "n"; public static final String POD_NAME_VALUE = "SwaggerClientObjc"; public static final String POD_VERSION_VALUE = "1.0.0-SNAPSHOT"; public static final String AUTHOR_NAME_VALUE = "SwaggerObjc"; public static final String AUTHOR_EMAIL_VALUE = "objc@swagger.io"; public static final String GIT_REPO_URL_VALUE = "https://github.com/swagger-api/swagger-codegen"; - public static final String LICENSE_VALUE = "MIT"; @Override public String getLanguage() { @@ -30,7 +30,7 @@ public class ObjcClientOptionsProvider implements OptionsProvider { .put(ObjcClientCodegen.AUTHOR_NAME, AUTHOR_NAME_VALUE) .put(ObjcClientCodegen.AUTHOR_EMAIL, AUTHOR_EMAIL_VALUE) .put(ObjcClientCodegen.GIT_REPO_URL, GIT_REPO_URL_VALUE) - .put(ObjcClientCodegen.LICENSE, LICENSE_VALUE) + .put(ObjcClientCodegen.CORE_DATA, CORE_DATA_VALUE) .build(); } diff --git a/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml index cb710b32566..ee4c0bfbcc9 100644 --- a/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml @@ -949,8 +949,17 @@ definitions: - -1.2 AdditionalPropertiesClass: type: object - additionalProperties: - type: string + properties: + map_property: + type: object + additionalProperties: + type: string + map_of_map_property: + type: object + additionalProperties: + type: object + additionalProperties: + type: string MixedPropertiesAndAdditionalPropertiesClass: type: object properties: @@ -960,9 +969,10 @@ definitions: dateTime: type: string format: date-time - additionalProperties: - type: string - $ref: '#/definitions/Animal' + map: + type: object + additionalProperties: + $ref: '#/definitions/Animal' ReadOnlyFirst: type: object properties: @@ -971,6 +981,26 @@ definitions: readOnly: true baz: type: string + ArrayTest: + type: object + properties: + array_of_string: + type: array + items: + type: string + array_array_of_integer: + type: array + items: + type: array + items: + type: integer + format: int64 + array_array_of_model: + type: array + items: + type: array + items: + $ref: '#/definitions/ReadOnlyFirst' externalDocs: description: Find out more about Swagger url: 'http://swagger.io' diff --git a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/package.json b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/package.json index 36ec153321d..bdd490f27b9 100644 --- a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/package.json +++ b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/package.json @@ -6,7 +6,7 @@ "keywords": [ "swagger-client" ], - "license": "MIT", + "license": "Apache-2.0", "files": [ "lib" ], diff --git a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/package.json b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/package.json index 83a9a586ab9..adc902b3610 100644 --- a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/package.json +++ b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/package.json @@ -6,7 +6,7 @@ "keywords": [ "swagger-client" ], - "license": "MIT", + "license": "Apache-2.0", "files": [ "lib" ], diff --git a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/node-es5-expected/package.json b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/node-es5-expected/package.json index 960338ff787..fba3fa017f9 100644 --- a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/node-es5-expected/package.json +++ b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/node-es5-expected/package.json @@ -7,7 +7,7 @@ "build": "typings install && tsc" }, "author": "Swagger Codegen Contributors", - "license": "MIT", + "license": "Apache-2.0", "dependencies": { "bluebird": "^3.3.5", "request": "^2.72.0" diff --git a/modules/swagger-generator/pom.xml b/modules/swagger-generator/pom.xml index 2d2b45d7892..7304fdd04bc 100644 --- a/modules/swagger-generator/pom.xml +++ b/modules/swagger-generator/pom.xml @@ -4,7 +4,7 @@ io.swagger swagger-codegen-project - 2.1.6 + 2.2.0-SNAPSHOT ../.. swagger-generator diff --git a/pom.xml b/pom.xml index 4dfd8c6fdcd..2b6c45f8662 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ swagger-codegen-project pom swagger-codegen-project - 2.1.6 + 2.2.0-SNAPSHOT https://github.com/swagger-api/swagger-codegen scm:git:git@github.com:swagger-api/swagger-codegen.git @@ -411,7 +411,7 @@ - samples/client/petstore/swift/SwaggerClientTests + samples/client/petstore/swift/default/SwaggerClientTests @@ -543,13 +543,13 @@ - samples/client/petstore/ruby + samples/client/petstore/typescript-fetch/tests/default + samples/client/petstore/typescript-fetch/builds/default + samples/client/petstore/typescript-fetch/builds/es6-target + samples/client/petstore/typescript-fetch/builds/with-npm-version samples/client/petstore/typescript-angular samples/client/petstore/typescript-node/npm samples/client/petstore/android/volley diff --git a/samples/client/petstore/csharp/SwaggerClient/IO.Swagger.sln b/samples/client/petstore/csharp/SwaggerClient/IO.Swagger.sln index d6a0243de57..c0a42faae52 100644 --- a/samples/client/petstore/csharp/SwaggerClient/IO.Swagger.sln +++ b/samples/client/petstore/csharp/SwaggerClient/IO.Swagger.sln @@ -2,7 +2,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 VisualStudioVersion = 12.0.0.0 MinimumVisualStudioVersion = 10.0.0.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{098D14FD-4F35-417E-9B8E-67875ACD0AD3}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{C81D6286-7BA5-4920-8591-F59169CCE4A4}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger.Test", "src\IO.Swagger.Test\IO.Swagger.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}" EndProject @@ -12,10 +12,10 @@ Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution -{098D14FD-4F35-417E-9B8E-67875ACD0AD3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU -{098D14FD-4F35-417E-9B8E-67875ACD0AD3}.Debug|Any CPU.Build.0 = Debug|Any CPU -{098D14FD-4F35-417E-9B8E-67875ACD0AD3}.Release|Any CPU.ActiveCfg = Release|Any CPU -{098D14FD-4F35-417E-9B8E-67875ACD0AD3}.Release|Any CPU.Build.0 = Release|Any CPU +{C81D6286-7BA5-4920-8591-F59169CCE4A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU +{C81D6286-7BA5-4920-8591-F59169CCE4A4}.Debug|Any CPU.Build.0 = Debug|Any CPU +{C81D6286-7BA5-4920-8591-F59169CCE4A4}.Release|Any CPU.ActiveCfg = Release|Any CPU +{C81D6286-7BA5-4920-8591-F59169CCE4A4}.Release|Any CPU.Build.0 = Release|Any CPU {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/samples/client/petstore/csharp/SwaggerClient/LICENSE b/samples/client/petstore/csharp/SwaggerClient/LICENSE new file mode 100644 index 00000000000..8dada3edaf5 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClient/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/samples/client/petstore/csharp/SwaggerClient/README.md b/samples/client/petstore/csharp/SwaggerClient/README.md index 7cd00026612..d9dcb59b2da 100644 --- a/samples/client/petstore/csharp/SwaggerClient/README.md +++ b/samples/client/petstore/csharp/SwaggerClient/README.md @@ -6,7 +6,7 @@ This C# SDK is automatically generated by the [Swagger Codegen](https://github.c - API version: 1.0.0 - SDK version: 1.0.0 -- Build date: 2016-05-21T22:36:46.367+08:00 +- Build date: 2016-05-29T17:27:36.037+08:00 - Build package: class io.swagger.codegen.languages.CSharpClientCodegen ## Frameworks supported @@ -116,6 +116,7 @@ Class | Method | HTTP request | Description - [Model.Animal](docs/Animal.md) - [Model.AnimalFarm](docs/AnimalFarm.md) - [Model.ApiResponse](docs/ApiResponse.md) + - [Model.ArrayTest](docs/ArrayTest.md) - [Model.Cat](docs/Cat.md) - [Model.Category](docs/Category.md) - [Model.Dog](docs/Dog.md) diff --git a/samples/client/petstore/csharp/SwaggerClient/docs/AdditionalPropertiesClass.md b/samples/client/petstore/csharp/SwaggerClient/docs/AdditionalPropertiesClass.md index e9922fe6e91..ac4f9d10798 100644 --- a/samples/client/petstore/csharp/SwaggerClient/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/csharp/SwaggerClient/docs/AdditionalPropertiesClass.md @@ -3,6 +3,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**MapProperty** | **Dictionary<string, string>** | | [optional] +**MapOfMapProperty** | **Dictionary<string, Dictionary<string, string>>** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/SwaggerClient/docs/ArrayTest.md b/samples/client/petstore/csharp/SwaggerClient/docs/ArrayTest.md new file mode 100644 index 00000000000..37fb2788b77 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClient/docs/ArrayTest.md @@ -0,0 +1,11 @@ +# IO.Swagger.Model.ArrayTest +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayOfString** | **List<string>** | | [optional] +**ArrayArrayOfInteger** | **List<List<long?>>** | | [optional] +**ArrayArrayOfModel** | **List<List<ReadOnlyFirst>>** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/SwaggerClient/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/csharp/SwaggerClient/docs/MixedPropertiesAndAdditionalPropertiesClass.md index 0db3f9ee52d..e2c978f9ab1 100644 --- a/samples/client/petstore/csharp/SwaggerClient/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/csharp/SwaggerClient/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Uuid** | **Guid?** | | [optional] **DateTime** | **DateTime?** | | [optional] +**Map** | [**Dictionary<string, Animal>**](Animal.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/IO.Swagger.Test.csproj b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/IO.Swagger.Test.csproj index a2f1f209fa3..4e4b161e255 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/IO.Swagger.Test.csproj +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/IO.Swagger.Test.csproj @@ -1,4 +1,25 @@ + Debug @@ -65,7 +86,7 @@ - {098D14FD-4F35-417E-9B8E-67875ACD0AD3} + {C81D6286-7BA5-4920-8591-F59169CCE4A4} IO.Swagger diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/ArrayTestTests.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/ArrayTestTests.cs new file mode 100644 index 00000000000..fd6b6f31d86 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/ArrayTestTests.cs @@ -0,0 +1,56 @@ +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing ArrayTest + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class ArrayTestTests + { + private ArrayTest instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + instance = new ArrayTest(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of ArrayTest + /// + [Test] + public void ArrayTestInstanceTest() + { + Assert.IsInstanceOf (instance, "instance is a ArrayTest"); + } + + + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/FakeApi.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/FakeApi.cs index ce3c07d74a5..00ce83ef910 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/FakeApi.cs @@ -1,3 +1,25 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/PetApi.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/PetApi.cs index d1e842d6d79..e147d33cceb 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/PetApi.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/PetApi.cs @@ -1,3 +1,25 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/StoreApi.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/StoreApi.cs index 16f589f924e..ed5dd54ec40 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/StoreApi.cs @@ -1,3 +1,25 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/UserApi.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/UserApi.cs index e7b14a0cdd7..6cb5bee041c 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/UserApi.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/UserApi.cs @@ -1,3 +1,25 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Client/ApiClient.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Client/ApiClient.cs index fa4f899389a..4331456ceaa 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Client/ApiClient.cs @@ -1,3 +1,25 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using System; using System.Collections; using System.Collections.Generic; diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Client/ApiException.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Client/ApiException.cs index 7b7a11721df..a19a664112f 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Client/ApiException.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Client/ApiException.cs @@ -1,3 +1,25 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using System; namespace IO.Swagger.Client diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Client/ApiResponse.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Client/ApiResponse.cs index 808837b4aa1..6c6134c114a 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Client/ApiResponse.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Client/ApiResponse.cs @@ -1,3 +1,25 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using System; using System.Collections.Generic; diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Client/Configuration.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Client/Configuration.cs index acbaee1e688..451f6d61354 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Client/Configuration.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Client/Configuration.cs @@ -1,3 +1,25 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using System; using System.Reflection; using System.Collections.Generic; diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Client/IApiAccessor.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Client/IApiAccessor.cs index a80ed3eb1a0..1c91ef50003 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Client/IApiAccessor.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Client/IApiAccessor.cs @@ -1,3 +1,26 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + using System; using System.Collections.Generic; using System.Collections.ObjectModel; @@ -23,4 +46,4 @@ namespace IO.Swagger.Client /// The base path String GetBasePath(); } -} \ No newline at end of file +} diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/IO.Swagger.csproj b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/IO.Swagger.csproj index dbd3abb9cbd..20fdb3385e1 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/IO.Swagger.csproj +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/IO.Swagger.csproj @@ -1,9 +1,30 @@ + Debug AnyCPU - {098D14FD-4F35-417E-9B8E-67875ACD0AD3} + {C81D6286-7BA5-4920-8591-F59169CCE4A4} Library Properties Swagger Library diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/AdditionalPropertiesClass.cs index d8d95d82d20..db9ac4006b7 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/AdditionalPropertiesClass.cs @@ -1,3 +1,25 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using System; using System.Linq; using System.IO; @@ -15,15 +37,29 @@ namespace IO.Swagger.Model /// AdditionalPropertiesClass /// [DataContract] - public partial class AdditionalPropertiesClass : Dictionary, IEquatable + public partial class AdditionalPropertiesClass : IEquatable { /// /// Initializes a new instance of the class. /// - public AdditionalPropertiesClass() + /// MapProperty. + /// MapOfMapProperty. + public AdditionalPropertiesClass(Dictionary MapProperty = null, Dictionary> MapOfMapProperty = null) { + this.MapProperty = MapProperty; + this.MapOfMapProperty = MapOfMapProperty; } + /// + /// Gets or Sets MapProperty + /// + [DataMember(Name="map_property", EmitDefaultValue=false)] + public Dictionary MapProperty { get; set; } + /// + /// Gets or Sets MapOfMapProperty + /// + [DataMember(Name="map_of_map_property", EmitDefaultValue=false)] + public Dictionary> MapOfMapProperty { get; set; } /// /// Returns the string presentation of the object /// @@ -32,6 +68,8 @@ namespace IO.Swagger.Model { var sb = new StringBuilder(); sb.Append("class AdditionalPropertiesClass {\n"); + sb.Append(" MapProperty: ").Append(MapProperty).Append("\n"); + sb.Append(" MapOfMapProperty: ").Append(MapOfMapProperty).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -40,7 +78,7 @@ namespace IO.Swagger.Model /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -67,7 +105,17 @@ namespace IO.Swagger.Model if (other == null) return false; - return false; + return + ( + this.MapProperty == other.MapProperty || + this.MapProperty != null && + this.MapProperty.SequenceEqual(other.MapProperty) + ) && + ( + this.MapOfMapProperty == other.MapOfMapProperty || + this.MapOfMapProperty != null && + this.MapOfMapProperty.SequenceEqual(other.MapOfMapProperty) + ); } /// @@ -81,6 +129,10 @@ namespace IO.Swagger.Model { int hash = 41; // Suitable nullity checks etc, of course :) + if (this.MapProperty != null) + hash = hash * 59 + this.MapProperty.GetHashCode(); + if (this.MapOfMapProperty != null) + hash = hash * 59 + this.MapOfMapProperty.GetHashCode(); return hash; } } diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Animal.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Animal.cs index a1d69d92f86..5d8417c74a3 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Animal.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Animal.cs @@ -1,3 +1,25 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using System; using System.Linq; using System.IO; diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/AnimalFarm.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/AnimalFarm.cs index 89ac71d7d1e..267ab5f4017 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/AnimalFarm.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/AnimalFarm.cs @@ -1,3 +1,25 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using System; using System.Linq; using System.IO; diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/ApiResponse.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/ApiResponse.cs index c4720de276a..0543e709b29 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/ApiResponse.cs @@ -1,3 +1,25 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using System; using System.Linq; using System.IO; diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/ArrayTest.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/ArrayTest.cs new file mode 100644 index 00000000000..b80118c790f --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/ArrayTest.cs @@ -0,0 +1,156 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace IO.Swagger.Model +{ + /// + /// ArrayTest + /// + [DataContract] + public partial class ArrayTest : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// ArrayOfString. + /// ArrayArrayOfInteger. + /// ArrayArrayOfModel. + public ArrayTest(List ArrayOfString = null, List> ArrayArrayOfInteger = null, List> ArrayArrayOfModel = null) + { + this.ArrayOfString = ArrayOfString; + this.ArrayArrayOfInteger = ArrayArrayOfInteger; + this.ArrayArrayOfModel = ArrayArrayOfModel; + } + + /// + /// Gets or Sets ArrayOfString + /// + [DataMember(Name="array_of_string", EmitDefaultValue=false)] + public List ArrayOfString { get; set; } + /// + /// Gets or Sets ArrayArrayOfInteger + /// + [DataMember(Name="array_array_of_integer", EmitDefaultValue=false)] + public List> ArrayArrayOfInteger { get; set; } + /// + /// Gets or Sets ArrayArrayOfModel + /// + [DataMember(Name="array_array_of_model", EmitDefaultValue=false)] + public List> ArrayArrayOfModel { get; set; } + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ArrayTest {\n"); + sb.Append(" ArrayOfString: ").Append(ArrayOfString).Append("\n"); + sb.Append(" ArrayArrayOfInteger: ").Append(ArrayArrayOfInteger).Append("\n"); + sb.Append(" ArrayArrayOfModel: ").Append(ArrayArrayOfModel).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + // credit: http://stackoverflow.com/a/10454552/677735 + return this.Equals(obj as ArrayTest); + } + + /// + /// Returns true if ArrayTest instances are equal + /// + /// Instance of ArrayTest to be compared + /// Boolean + public bool Equals(ArrayTest other) + { + // credit: http://stackoverflow.com/a/10454552/677735 + if (other == null) + return false; + + return + ( + this.ArrayOfString == other.ArrayOfString || + this.ArrayOfString != null && + this.ArrayOfString.SequenceEqual(other.ArrayOfString) + ) && + ( + this.ArrayArrayOfInteger == other.ArrayArrayOfInteger || + this.ArrayArrayOfInteger != null && + this.ArrayArrayOfInteger.SequenceEqual(other.ArrayArrayOfInteger) + ) && + ( + this.ArrayArrayOfModel == other.ArrayArrayOfModel || + this.ArrayArrayOfModel != null && + this.ArrayArrayOfModel.SequenceEqual(other.ArrayArrayOfModel) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + // credit: http://stackoverflow.com/a/263416/677735 + unchecked // Overflow is fine, just wrap + { + int hash = 41; + // Suitable nullity checks etc, of course :) + if (this.ArrayOfString != null) + hash = hash * 59 + this.ArrayOfString.GetHashCode(); + if (this.ArrayArrayOfInteger != null) + hash = hash * 59 + this.ArrayArrayOfInteger.GetHashCode(); + if (this.ArrayArrayOfModel != null) + hash = hash * 59 + this.ArrayArrayOfModel.GetHashCode(); + return hash; + } + } + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Cat.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Cat.cs index 0ecfc2ee3f5..f288be939c4 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Cat.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Cat.cs @@ -1,3 +1,25 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using System; using System.Linq; using System.IO; diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Category.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Category.cs index bac1069ab9c..be9d35a9fb7 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Category.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Category.cs @@ -1,3 +1,25 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using System; using System.Linq; using System.IO; diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Dog.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Dog.cs index 7984703d1b0..000b1f1bec9 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Dog.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Dog.cs @@ -1,3 +1,25 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using System; using System.Linq; using System.IO; diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/EnumClass.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/EnumClass.cs index 1fb5f0b6626..3ce229e2efd 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/EnumClass.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/EnumClass.cs @@ -1,3 +1,25 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using System; using System.Linq; using System.IO; diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/EnumTest.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/EnumTest.cs index 721482f31c5..2725d9d17a4 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/EnumTest.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/EnumTest.cs @@ -1,3 +1,25 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using System; using System.Linq; using System.IO; diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/FormatTest.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/FormatTest.cs index a0d33e71bb4..eb1a6a8924b 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/FormatTest.cs @@ -1,3 +1,25 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using System; using System.Linq; using System.IO; diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 8d4234e8171..ea20988a1ec 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -1,3 +1,25 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using System; using System.Linq; using System.IO; @@ -15,17 +37,19 @@ namespace IO.Swagger.Model /// MixedPropertiesAndAdditionalPropertiesClass /// [DataContract] - public partial class MixedPropertiesAndAdditionalPropertiesClass : Dictionary, IEquatable + public partial class MixedPropertiesAndAdditionalPropertiesClass : IEquatable { /// /// Initializes a new instance of the class. /// /// Uuid. /// DateTime. - public MixedPropertiesAndAdditionalPropertiesClass(Guid? Uuid = null, DateTime? DateTime = null) + /// Map. + public MixedPropertiesAndAdditionalPropertiesClass(Guid? Uuid = null, DateTime? DateTime = null, Dictionary Map = null) { this.Uuid = Uuid; this.DateTime = DateTime; + this.Map = Map; } /// @@ -39,6 +63,11 @@ namespace IO.Swagger.Model [DataMember(Name="dateTime", EmitDefaultValue=false)] public DateTime? DateTime { get; set; } /// + /// Gets or Sets Map + /// + [DataMember(Name="map", EmitDefaultValue=false)] + public Dictionary Map { get; set; } + /// /// Returns the string presentation of the object /// /// String presentation of the object @@ -48,6 +77,7 @@ namespace IO.Swagger.Model sb.Append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); sb.Append(" Uuid: ").Append(Uuid).Append("\n"); sb.Append(" DateTime: ").Append(DateTime).Append("\n"); + sb.Append(" Map: ").Append(Map).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -56,7 +86,7 @@ namespace IO.Swagger.Model /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -93,6 +123,11 @@ namespace IO.Swagger.Model this.DateTime == other.DateTime || this.DateTime != null && this.DateTime.Equals(other.DateTime) + ) && + ( + this.Map == other.Map || + this.Map != null && + this.Map.SequenceEqual(other.Map) ); } @@ -111,6 +146,8 @@ namespace IO.Swagger.Model hash = hash * 59 + this.Uuid.GetHashCode(); if (this.DateTime != null) hash = hash * 59 + this.DateTime.GetHashCode(); + if (this.Map != null) + hash = hash * 59 + this.Map.GetHashCode(); return hash; } } diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Model200Response.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Model200Response.cs index c772fedc172..7e6d1c79a16 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Model200Response.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Model200Response.cs @@ -1,3 +1,25 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using System; using System.Linq; using System.IO; diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/ModelReturn.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/ModelReturn.cs index b5fa9d341f6..e6255f285ee 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/ModelReturn.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/ModelReturn.cs @@ -1,3 +1,25 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using System; using System.Linq; using System.IO; diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Name.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Name.cs index 35a69deba48..1c1b771f53b 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Name.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Name.cs @@ -1,3 +1,25 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using System; using System.Linq; using System.IO; diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Order.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Order.cs index b030bab781a..33f1b2d99da 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Order.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Order.cs @@ -1,3 +1,25 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using System; using System.Linq; using System.IO; diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Pet.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Pet.cs index ace8a28d34c..7db2644307a 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Pet.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Pet.cs @@ -1,3 +1,25 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using System; using System.Linq; using System.IO; diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/ReadOnlyFirst.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/ReadOnlyFirst.cs index 4627581d86b..422c7671139 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/ReadOnlyFirst.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/ReadOnlyFirst.cs @@ -1,3 +1,25 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using System; using System.Linq; using System.IO; diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/SpecialModelName.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/SpecialModelName.cs index fa2962f6914..82cde053d0b 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/SpecialModelName.cs @@ -1,3 +1,25 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using System; using System.Linq; using System.IO; diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Tag.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Tag.cs index b1d6f167837..93b7b66c005 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Tag.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Tag.cs @@ -1,3 +1,25 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using System; using System.Linq; using System.IO; diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/User.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/User.cs index ef933e5469f..34e60b081b4 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/User.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/User.cs @@ -1,3 +1,25 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using System; using System.Linq; using System.IO; diff --git a/samples/client/petstore/go/go-petstore/.swagger-codegen-ignore b/samples/client/petstore/go/go-petstore/.swagger-codegen-ignore new file mode 100644 index 00000000000..19d3377182e --- /dev/null +++ b/samples/client/petstore/go/go-petstore/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# 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 Swagger Codgen 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 +# Thsi 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/go/go-petstore/LICENSE b/samples/client/petstore/go/go-petstore/LICENSE new file mode 100644 index 00000000000..8dada3edaf5 --- /dev/null +++ b/samples/client/petstore/go/go-petstore/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/samples/client/petstore/go/go-petstore/README.md b/samples/client/petstore/go/go-petstore/README.md index 9f725fb007b..20083469110 100644 --- a/samples/client/petstore/go/go-petstore/README.md +++ b/samples/client/petstore/go/go-petstore/README.md @@ -7,7 +7,7 @@ This API client was generated by the [swagger-codegen](https://github.com/swagge - API version: 1.0.0 - Package version: 1.0.0 -- Build date: 2016-05-03T10:14:09.589-07:00 +- Build date: 2016-05-25T10:00:28.559-07:00 - Build package: class io.swagger.codegen.languages.GoClientCodegen ## Installation diff --git a/samples/client/petstore/go/go-petstore/api_client.go b/samples/client/petstore/go/go-petstore/api_client.go index fe73dc5682a..132ca3949fb 100644 --- a/samples/client/petstore/go/go-petstore/api_client.go +++ b/samples/client/petstore/go/go-petstore/api_client.go @@ -1,3 +1,25 @@ +/* + * Swagger Petstore + * + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package petstore import ( diff --git a/samples/client/petstore/go/go-petstore/api_response.go b/samples/client/petstore/go/go-petstore/api_response.go index 0404289f96b..57b94271eae 100644 --- a/samples/client/petstore/go/go-petstore/api_response.go +++ b/samples/client/petstore/go/go-petstore/api_response.go @@ -1,3 +1,25 @@ +/* + * Swagger Petstore + * + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package petstore import ( diff --git a/samples/client/petstore/go/go-petstore/category.go b/samples/client/petstore/go/go-petstore/category.go index 197316d62ef..b8591811511 100644 --- a/samples/client/petstore/go/go-petstore/category.go +++ b/samples/client/petstore/go/go-petstore/category.go @@ -1,3 +1,25 @@ +/* + * Swagger Petstore + * + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package petstore type Category struct { diff --git a/samples/client/petstore/go/go-petstore/configuration.go b/samples/client/petstore/go/go-petstore/configuration.go index 5d7df91948e..2bba74c7f53 100644 --- a/samples/client/petstore/go/go-petstore/configuration.go +++ b/samples/client/petstore/go/go-petstore/configuration.go @@ -1,3 +1,25 @@ +/* + * Swagger Petstore + * + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package petstore import ( diff --git a/samples/client/petstore/go/go-petstore/model_api_response.go b/samples/client/petstore/go/go-petstore/model_api_response.go index 774f781ee93..85bba3df10e 100644 --- a/samples/client/petstore/go/go-petstore/model_api_response.go +++ b/samples/client/petstore/go/go-petstore/model_api_response.go @@ -1,3 +1,25 @@ +/* + * Swagger Petstore + * + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package petstore type ModelApiResponse struct { diff --git a/samples/client/petstore/go/go-petstore/order.go b/samples/client/petstore/go/go-petstore/order.go index 582d45a747f..f5b83768175 100644 --- a/samples/client/petstore/go/go-petstore/order.go +++ b/samples/client/petstore/go/go-petstore/order.go @@ -1,3 +1,25 @@ +/* + * Swagger Petstore + * + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package petstore import ( diff --git a/samples/client/petstore/go/go-petstore/pet.go b/samples/client/petstore/go/go-petstore/pet.go index 88e86af7399..b230ea45dac 100644 --- a/samples/client/petstore/go/go-petstore/pet.go +++ b/samples/client/petstore/go/go-petstore/pet.go @@ -1,3 +1,25 @@ +/* + * Swagger Petstore + * + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package petstore type Pet struct { diff --git a/samples/client/petstore/go/go-petstore/pet_api.go b/samples/client/petstore/go/go-petstore/pet_api.go index 34efe36d9be..07dc51eb90e 100644 --- a/samples/client/petstore/go/go-petstore/pet_api.go +++ b/samples/client/petstore/go/go-petstore/pet_api.go @@ -1,3 +1,25 @@ +/* + * Swagger Petstore + * + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package petstore import ( diff --git a/samples/client/petstore/go/go-petstore/store_api.go b/samples/client/petstore/go/go-petstore/store_api.go index 9e24fe68b53..e2de74695ee 100644 --- a/samples/client/petstore/go/go-petstore/store_api.go +++ b/samples/client/petstore/go/go-petstore/store_api.go @@ -1,3 +1,25 @@ +/* + * Swagger Petstore + * + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package petstore import ( diff --git a/samples/client/petstore/go/go-petstore/tag.go b/samples/client/petstore/go/go-petstore/tag.go index ae901c30ec4..80d219bb36c 100644 --- a/samples/client/petstore/go/go-petstore/tag.go +++ b/samples/client/petstore/go/go-petstore/tag.go @@ -1,3 +1,25 @@ +/* + * Swagger Petstore + * + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package petstore type Tag struct { diff --git a/samples/client/petstore/go/go-petstore/user.go b/samples/client/petstore/go/go-petstore/user.go index 140a94a275b..a2cc5850d75 100644 --- a/samples/client/petstore/go/go-petstore/user.go +++ b/samples/client/petstore/go/go-petstore/user.go @@ -1,3 +1,25 @@ +/* + * Swagger Petstore + * + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package petstore type User struct { diff --git a/samples/client/petstore/go/go-petstore/user_api.go b/samples/client/petstore/go/go-petstore/user_api.go index af0ea7b85f5..2cd9ed6605c 100644 --- a/samples/client/petstore/go/go-petstore/user_api.go +++ b/samples/client/petstore/go/go-petstore/user_api.go @@ -1,3 +1,25 @@ +/* + * Swagger Petstore + * + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package petstore import ( diff --git a/samples/client/petstore/java/feign/.swagger-codegen-ignore b/samples/client/petstore/java/feign/.swagger-codegen-ignore new file mode 100644 index 00000000000..19d3377182e --- /dev/null +++ b/samples/client/petstore/java/feign/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# 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 Swagger Codgen 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 +# Thsi 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/feign/LICENSE b/samples/client/petstore/java/feign/LICENSE new file mode 100644 index 00000000000..d9a10c0d8e8 --- /dev/null +++ b/samples/client/petstore/java/feign/LICENSE @@ -0,0 +1,176 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS diff --git a/samples/client/petstore/java/feign/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/feign/gradle/wrapper/gradle-wrapper.properties index 5c639c12740..b7a36473955 100644 --- a/samples/client/petstore/java/feign/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/java/feign/gradle/wrapper/gradle-wrapper.properties @@ -1,4 +1,4 @@ -#Tue May 17 23:03:29 CST 2016 +#Tue May 17 23:08:05 CST 2016 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/FormAwareEncoder.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/FormAwareEncoder.java index 70505097dfa..f652b7870f8 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/FormAwareEncoder.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/FormAwareEncoder.java @@ -14,7 +14,7 @@ import feign.codec.EncodeException; import feign.codec.Encoder; import feign.RequestTemplate; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-13T16:29:08.210Z") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-29T21:13:47.191+01:00") public class FormAwareEncoder implements Encoder { public static final String UTF_8 = "utf-8"; private static final String LINE_FEED = "\r\n"; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/StringUtil.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/StringUtil.java index 47bb5836fa5..25b1f52d7f5 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/StringUtil.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/StringUtil.java @@ -1,6 +1,6 @@ package io.swagger.client; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-13T16:29:08.210Z") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-29T21:13:47.191+01:00") public class StringUtil { /** * Check if the given array contains the given value (with case-insensitive comparison). diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/FakeApi.java index 1231d3f3e0a..02e35d2d89a 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/FakeApi.java @@ -11,7 +11,7 @@ import java.util.List; import java.util.Map; import feign.*; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-13T16:29:08.210Z") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-29T21:13:47.191+01:00") public interface FakeApi extends ApiClient.Api { @@ -34,8 +34,8 @@ public interface FakeApi extends ApiClient.Api { */ @RequestLine("POST /fake") @Headers({ - "Content-type: application/x-www-form-urlencoded", - "Accepts: application/json", + "Content-type: application/xml; charset=utf-8", + "Accept: application/xml; charset=utf-8,application/json; charset=utf-8", }) void testEndpointParameters(@Param("number") BigDecimal number, @Param("_double") Double _double, @Param("string") String string, @Param("_byte") byte[] _byte, @Param("integer") Integer integer, @Param("int32") Integer int32, @Param("int64") Long int64, @Param("_float") Float _float, @Param("binary") byte[] binary, @Param("date") Date date, @Param("dateTime") Date dateTime, @Param("password") String password); } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/PetApi.java index 3b50531c607..99ca8dfaa71 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/PetApi.java @@ -12,7 +12,7 @@ import java.util.List; import java.util.Map; import feign.*; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-13T16:29:08.210Z") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-29T21:13:47.191+01:00") public interface PetApi extends ApiClient.Api { @@ -25,7 +25,7 @@ public interface PetApi extends ApiClient.Api { @RequestLine("POST /pet") @Headers({ "Content-type: application/json", - "Accepts: application/json", + "Accept: application/json", }) void addPet(Pet body); @@ -39,7 +39,7 @@ public interface PetApi extends ApiClient.Api { @RequestLine("DELETE /pet/{petId}") @Headers({ "Content-type: application/json", - "Accepts: application/json", + "Accept: application/json", "apiKey: {apiKey}" }) void deletePet(@Param("petId") Long petId, @Param("apiKey") String apiKey); @@ -53,7 +53,7 @@ public interface PetApi extends ApiClient.Api { @RequestLine("GET /pet/findByStatus?status={status}") @Headers({ "Content-type: application/json", - "Accepts: application/json", + "Accept: application/json", }) List findPetsByStatus(@Param("status") List status); @@ -66,7 +66,7 @@ public interface PetApi extends ApiClient.Api { @RequestLine("GET /pet/findByTags?tags={tags}") @Headers({ "Content-type: application/json", - "Accepts: application/json", + "Accept: application/json", }) List findPetsByTags(@Param("tags") List tags); @@ -79,7 +79,7 @@ public interface PetApi extends ApiClient.Api { @RequestLine("GET /pet/{petId}") @Headers({ "Content-type: application/json", - "Accepts: application/json", + "Accept: application/json", }) Pet getPetById(@Param("petId") Long petId); @@ -92,7 +92,7 @@ public interface PetApi extends ApiClient.Api { @RequestLine("PUT /pet") @Headers({ "Content-type: application/json", - "Accepts: application/json", + "Accept: application/json", }) void updatePet(Pet body); @@ -107,7 +107,7 @@ public interface PetApi extends ApiClient.Api { @RequestLine("POST /pet/{petId}") @Headers({ "Content-type: application/x-www-form-urlencoded", - "Accepts: application/json", + "Accept: application/json", }) void updatePetWithForm(@Param("petId") Long petId, @Param("name") String name, @Param("status") String status); @@ -122,7 +122,7 @@ public interface PetApi extends ApiClient.Api { @RequestLine("POST /pet/{petId}/uploadImage") @Headers({ "Content-type: multipart/form-data", - "Accepts: application/json", + "Accept: application/json", }) ModelApiResponse uploadFile(@Param("petId") Long petId, @Param("additionalMetadata") String additionalMetadata, @Param("file") File file); } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/StoreApi.java index 7bf3a3b44c5..2649a4b300d 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/StoreApi.java @@ -10,7 +10,7 @@ import java.util.List; import java.util.Map; import feign.*; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-13T16:29:08.210Z") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-29T21:13:47.191+01:00") public interface StoreApi extends ApiClient.Api { @@ -23,7 +23,7 @@ public interface StoreApi extends ApiClient.Api { @RequestLine("DELETE /store/order/{orderId}") @Headers({ "Content-type: application/json", - "Accepts: application/json", + "Accept: application/json", }) void deleteOrder(@Param("orderId") String orderId); @@ -35,7 +35,7 @@ public interface StoreApi extends ApiClient.Api { @RequestLine("GET /store/inventory") @Headers({ "Content-type: application/json", - "Accepts: application/json", + "Accept: application/json", }) Map getInventory(); @@ -48,7 +48,7 @@ public interface StoreApi extends ApiClient.Api { @RequestLine("GET /store/order/{orderId}") @Headers({ "Content-type: application/json", - "Accepts: application/json", + "Accept: application/json", }) Order getOrderById(@Param("orderId") Long orderId); @@ -61,7 +61,7 @@ public interface StoreApi extends ApiClient.Api { @RequestLine("POST /store/order") @Headers({ "Content-type: application/json", - "Accepts: application/json", + "Accept: application/json", }) Order placeOrder(Order body); } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/UserApi.java index 51e47cb6e33..33140fb4364 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/UserApi.java @@ -10,7 +10,7 @@ import java.util.List; import java.util.Map; import feign.*; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-13T16:29:08.210Z") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-29T21:13:47.191+01:00") public interface UserApi extends ApiClient.Api { @@ -23,7 +23,7 @@ public interface UserApi extends ApiClient.Api { @RequestLine("POST /user") @Headers({ "Content-type: application/json", - "Accepts: application/json", + "Accept: application/json", }) void createUser(User body); @@ -36,7 +36,7 @@ public interface UserApi extends ApiClient.Api { @RequestLine("POST /user/createWithArray") @Headers({ "Content-type: application/json", - "Accepts: application/json", + "Accept: application/json", }) void createUsersWithArrayInput(List body); @@ -49,7 +49,7 @@ public interface UserApi extends ApiClient.Api { @RequestLine("POST /user/createWithList") @Headers({ "Content-type: application/json", - "Accepts: application/json", + "Accept: application/json", }) void createUsersWithListInput(List body); @@ -62,7 +62,7 @@ public interface UserApi extends ApiClient.Api { @RequestLine("DELETE /user/{username}") @Headers({ "Content-type: application/json", - "Accepts: application/json", + "Accept: application/json", }) void deleteUser(@Param("username") String username); @@ -75,7 +75,7 @@ public interface UserApi extends ApiClient.Api { @RequestLine("GET /user/{username}") @Headers({ "Content-type: application/json", - "Accepts: application/json", + "Accept: application/json", }) User getUserByName(@Param("username") String username); @@ -89,7 +89,7 @@ public interface UserApi extends ApiClient.Api { @RequestLine("GET /user/login?username={username}&password={password}") @Headers({ "Content-type: application/json", - "Accepts: application/json", + "Accept: application/json", }) String loginUser(@Param("username") String username, @Param("password") String password); @@ -101,7 +101,7 @@ public interface UserApi extends ApiClient.Api { @RequestLine("GET /user/logout") @Headers({ "Content-type: application/json", - "Accepts: application/json", + "Accept: application/json", }) void logoutUser(); @@ -115,7 +115,7 @@ public interface UserApi extends ApiClient.Api { @RequestLine("PUT /user/{username}") @Headers({ "Content-type: application/json", - "Accepts: application/json", + "Accept: application/json", }) void updateUser(@Param("username") String username, User body); } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java new file mode 100644 index 00000000000..2569b542c27 --- /dev/null +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -0,0 +1,97 @@ +package io.swagger.client.model; + +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +/** + * AdditionalPropertiesClass + */ +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-29T21:13:47.191+01:00") +public class AdditionalPropertiesClass { + + private Map mapProperty = new HashMap(); + private Map> mapOfMapProperty = new HashMap>(); + + + /** + **/ + public AdditionalPropertiesClass mapProperty(Map mapProperty) { + this.mapProperty = mapProperty; + return this; + } + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("map_property") + public Map getMapProperty() { + return mapProperty; + } + public void setMapProperty(Map mapProperty) { + this.mapProperty = mapProperty; + } + + + /** + **/ + public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; + return this; + } + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("map_of_map_property") + public Map> getMapOfMapProperty() { + return mapOfMapProperty; + } + public void setMapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o; + return Objects.equals(this.mapProperty, additionalPropertiesClass.mapProperty) && + Objects.equals(this.mapOfMapProperty, additionalPropertiesClass.mapOfMapProperty); + } + + @Override + public int hashCode() { + return Objects.hash(mapProperty, mapOfMapProperty); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesClass {\n"); + + sb.append(" mapProperty: ").append(toIndentedString(mapProperty)).append("\n"); + sb.append(" mapOfMapProperty: ").append(toIndentedString(mapOfMapProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Animal.java index 2722d7bf0d3..9400f85e994 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Animal.java @@ -10,7 +10,7 @@ import io.swagger.annotations.ApiModelProperty; /** * Animal */ -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-13T16:29:08.210Z") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-29T21:13:47.191+01:00") public class Animal { private String className = null; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/AnimalFarm.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/AnimalFarm.java index 29d71fb8604..4e817de2443 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/AnimalFarm.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/AnimalFarm.java @@ -10,7 +10,7 @@ import java.util.List; /** * AnimalFarm */ -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-13T16:29:08.210Z") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-29T21:13:47.191+01:00") public class AnimalFarm extends ArrayList { diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayTest.java new file mode 100644 index 00000000000..28b8cde7a9a --- /dev/null +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayTest.java @@ -0,0 +1,116 @@ +package io.swagger.client.model; + +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; + + +/** + * ArrayTest + */ +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-29T21:13:47.191+01:00") +public class ArrayTest { + + private List arrayOfString = new ArrayList(); + private List> arrayArrayOfInteger = new ArrayList>(); + private List> arrayArrayOfModel = new ArrayList>(); + + + /** + **/ + public ArrayTest arrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; + return this; + } + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("array_of_string") + public List getArrayOfString() { + return arrayOfString; + } + public void setArrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; + } + + + /** + **/ + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + return this; + } + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("array_array_of_integer") + public List> getArrayArrayOfInteger() { + return arrayArrayOfInteger; + } + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + } + + + /** + **/ + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + return this; + } + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("array_array_of_model") + public List> getArrayArrayOfModel() { + return arrayArrayOfModel; + } + public void setArrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayTest arrayTest = (ArrayTest) o; + return Objects.equals(this.arrayOfString, arrayTest.arrayOfString) && + Objects.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) && + Objects.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel); + } + + @Override + public int hashCode() { + return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayTest {\n"); + + sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n"); + sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n"); + sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Cat.java index b84e83dc9fb..e8914f543ab 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Cat.java @@ -11,7 +11,7 @@ import io.swagger.client.model.Animal; /** * Cat */ -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-13T16:29:08.210Z") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-29T21:13:47.191+01:00") public class Cat extends Animal { private String className = null; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Category.java index d0579ee435f..9e72fbaf7c9 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Category.java @@ -10,7 +10,7 @@ import io.swagger.annotations.ApiModelProperty; /** * Category */ -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-13T16:29:08.210Z") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-29T21:13:47.191+01:00") public class Category { private Long id = null; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Dog.java index 5a7162dce4d..8e79b2ebbaa 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Dog.java @@ -11,7 +11,7 @@ import io.swagger.client.model.Animal; /** * Dog */ -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-13T16:29:08.210Z") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-29T21:13:47.191+01:00") public class Dog extends Animal { private String className = null; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumTest.java index 6ef0a34b1f9..725d74152db 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumTest.java @@ -11,7 +11,7 @@ import io.swagger.annotations.ApiModelProperty; /** * EnumTest */ -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-13T16:29:08.210Z") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-29T21:13:47.191+01:00") public class EnumTest { diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/FormatTest.java index cea8883add4..e583011c39c 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/FormatTest.java @@ -12,7 +12,7 @@ import java.util.Date; /** * FormatTest */ -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-13T16:29:08.210Z") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-29T21:13:47.191+01:00") public class FormatTest { private Integer integer = null; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java new file mode 100644 index 00000000000..256aea8cd1e --- /dev/null +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -0,0 +1,119 @@ +package io.swagger.client.model; + +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import io.swagger.client.model.Animal; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +/** + * MixedPropertiesAndAdditionalPropertiesClass + */ +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-29T21:13:47.191+01:00") +public class MixedPropertiesAndAdditionalPropertiesClass { + + private String uuid = null; + private Date dateTime = null; + private Map map = new HashMap(); + + + /** + **/ + public MixedPropertiesAndAdditionalPropertiesClass uuid(String uuid) { + this.uuid = uuid; + return this; + } + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("uuid") + public String getUuid() { + return uuid; + } + public void setUuid(String uuid) { + this.uuid = uuid; + } + + + /** + **/ + public MixedPropertiesAndAdditionalPropertiesClass dateTime(Date dateTime) { + this.dateTime = dateTime; + return this; + } + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("dateTime") + public Date getDateTime() { + return dateTime; + } + public void setDateTime(Date dateTime) { + this.dateTime = dateTime; + } + + + /** + **/ + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { + this.map = map; + return this; + } + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("map") + public Map getMap() { + return map; + } + public void setMap(Map map) { + this.map = map; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o; + return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) && + Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) && + Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map); + } + + @Override + public int hashCode() { + return Objects.hash(uuid, dateTime, map); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); + + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" map: ").append(toIndentedString(map)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Model200Response.java index a2bee4c634e..2eca6522c5f 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Model200Response.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Model200Response.java @@ -11,7 +11,7 @@ import io.swagger.annotations.ApiModelProperty; * Model for testing model name starting with number */ @ApiModel(description = "Model for testing model name starting with number") -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-13T16:29:08.210Z") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-29T21:13:47.191+01:00") public class Model200Response { private Integer name = null; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelApiResponse.java index 3d4cf0bfc96..e16d627e18f 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -10,7 +10,7 @@ import io.swagger.annotations.ApiModelProperty; /** * ModelApiResponse */ -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-13T16:29:08.210Z") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-29T21:13:47.191+01:00") public class ModelApiResponse { private Integer code = null; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelReturn.java index d3fdac81f3d..074c294cd5a 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelReturn.java @@ -11,7 +11,7 @@ import io.swagger.annotations.ApiModelProperty; * Model for testing reserved words */ @ApiModel(description = "Model for testing reserved words") -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-13T16:29:08.210Z") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-29T21:13:47.191+01:00") public class ModelReturn { private Integer _return = null; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Name.java index 7a0af504643..6f3353dba6e 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Name.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Name.java @@ -11,7 +11,7 @@ import io.swagger.annotations.ApiModelProperty; * Model for testing model name same as property name */ @ApiModel(description = "Model for testing model name same as property name") -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-13T16:29:08.210Z") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-29T21:13:47.191+01:00") public class Name { private Integer name = null; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Order.java index 2ca9531a8af..fdcf2a4251d 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Order.java @@ -12,7 +12,7 @@ import java.util.Date; /** * Order */ -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-13T16:29:08.210Z") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-29T21:13:47.191+01:00") public class Order { private Long id = null; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Pet.java index bd9248120e8..e4b00973d79 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Pet.java @@ -15,7 +15,7 @@ import java.util.List; /** * Pet */ -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-13T16:29:08.210Z") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-29T21:13:47.191+01:00") public class Pet { private Long id = null; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ReadOnlyFirst.java new file mode 100644 index 00000000000..43733beba93 --- /dev/null +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -0,0 +1,84 @@ +package io.swagger.client.model; + +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + + +/** + * ReadOnlyFirst + */ +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-29T21:13:47.191+01:00") +public class ReadOnlyFirst { + + private String bar = null; + private String baz = null; + + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("bar") + public String getBar() { + return bar; + } + + + /** + **/ + public ReadOnlyFirst baz(String baz) { + this.baz = baz; + return this; + } + + @ApiModelProperty(example = "null", value = "") + @JsonProperty("baz") + public String getBaz() { + return baz; + } + public void setBaz(String baz) { + this.baz = baz; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReadOnlyFirst readOnlyFirst = (ReadOnlyFirst) o; + return Objects.equals(this.bar, readOnlyFirst.bar) && + Objects.equals(this.baz, readOnlyFirst.baz); + } + + @Override + public int hashCode() { + return Objects.hash(bar, baz); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReadOnlyFirst {\n"); + + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" baz: ").append(toIndentedString(baz)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/SpecialModelName.java index 58df0f961f0..c58343e8271 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -10,7 +10,7 @@ import io.swagger.annotations.ApiModelProperty; /** * SpecialModelName */ -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-13T16:29:08.210Z") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-29T21:13:47.191+01:00") public class SpecialModelName { private Long specialPropertyName = null; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Tag.java index 24d51b8e59e..b9b7991f621 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Tag.java @@ -10,7 +10,7 @@ import io.swagger.annotations.ApiModelProperty; /** * Tag */ -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-13T16:29:08.210Z") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-29T21:13:47.191+01:00") public class Tag { private Long id = null; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/User.java index 450f177103d..a03f29c20f1 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/User.java @@ -10,7 +10,7 @@ import io.swagger.annotations.ApiModelProperty; /** * User */ -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-13T16:29:08.210Z") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-29T21:13:47.191+01:00") public class User { private Long id = null; diff --git a/samples/client/petstore/java/retrofit2/docs/AdditionalPropertiesClass.md b/samples/client/petstore/java/retrofit2/docs/AdditionalPropertiesClass.md new file mode 100644 index 00000000000..c72785d450f --- /dev/null +++ b/samples/client/petstore/java/retrofit2/docs/AdditionalPropertiesClass.md @@ -0,0 +1,9 @@ + +# AdditionalPropertiesClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/retrofit2/docs/Animal.md b/samples/client/petstore/java/retrofit2/docs/Animal.md new file mode 100644 index 00000000000..b3f325c3524 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/docs/Animal.md @@ -0,0 +1,11 @@ + +# Animal + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2/docs/AnimalFarm.md b/samples/client/petstore/java/retrofit2/docs/AnimalFarm.md new file mode 100644 index 00000000000..c7c7f1ddcce --- /dev/null +++ b/samples/client/petstore/java/retrofit2/docs/AnimalFarm.md @@ -0,0 +1,9 @@ + +# AnimalFarm + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/retrofit2/docs/ArrayTest.md b/samples/client/petstore/java/retrofit2/docs/ArrayTest.md new file mode 100644 index 00000000000..73c3e5305ad --- /dev/null +++ b/samples/client/petstore/java/retrofit2/docs/ArrayTest.md @@ -0,0 +1,9 @@ + +# ArrayTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/retrofit2/docs/Cat.md b/samples/client/petstore/java/retrofit2/docs/Cat.md new file mode 100644 index 00000000000..be6e56fa8ce --- /dev/null +++ b/samples/client/petstore/java/retrofit2/docs/Cat.md @@ -0,0 +1,12 @@ + +# Cat + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] +**declawed** | **Boolean** | | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2/docs/Category.md b/samples/client/petstore/java/retrofit2/docs/Category.md new file mode 100644 index 00000000000..e2df0803278 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/docs/Category.md @@ -0,0 +1,11 @@ + +# Category + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Long** | | [optional] +**name** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2/docs/Dog.md b/samples/client/petstore/java/retrofit2/docs/Dog.md new file mode 100644 index 00000000000..71a7dbe809e --- /dev/null +++ b/samples/client/petstore/java/retrofit2/docs/Dog.md @@ -0,0 +1,12 @@ + +# Dog + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] +**breed** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2/docs/EnumClass.md b/samples/client/petstore/java/retrofit2/docs/EnumClass.md new file mode 100644 index 00000000000..c746edc3cb1 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/docs/EnumClass.md @@ -0,0 +1,14 @@ + +# EnumClass + +## Enum + + +* `_ABC` (value: `"_abc"`) + +* `_EFG` (value: `"-efg"`) + +* `_XYZ_` (value: `"(xyz)"`) + + + diff --git a/samples/client/petstore/java/retrofit2/docs/EnumTest.md b/samples/client/petstore/java/retrofit2/docs/EnumTest.md new file mode 100644 index 00000000000..deb1951c552 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/docs/EnumTest.md @@ -0,0 +1,36 @@ + +# EnumTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional] +**enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] +**enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] + + + +## Enum: EnumStringEnum +Name | Value +---- | ----- +UPPER | "UPPER" +LOWER | "lower" + + + +## Enum: EnumIntegerEnum +Name | Value +---- | ----- +NUMBER_1 | 1 +NUMBER_MINUS_1 | -1 + + + +## Enum: EnumNumberEnum +Name | Value +---- | ----- +NUMBER_1_DOT_1 | 1.1 +NUMBER_MINUS_1_DOT_2 | -1.2 + + + diff --git a/samples/client/petstore/java/retrofit2/docs/FakeApi.md b/samples/client/petstore/java/retrofit2/docs/FakeApi.md new file mode 100644 index 00000000000..55f7cef2df4 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/docs/FakeApi.md @@ -0,0 +1,76 @@ +# FakeApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + + + +# **testEndpointParameters** +> Void testEndpointParameters(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password) + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +BigDecimal number = new BigDecimal(); // BigDecimal | None +Double _double = 3.4D; // Double | None +String string = "string_example"; // String | None +byte[] _byte = B; // byte[] | None +Integer integer = 56; // Integer | None +Integer int32 = 56; // Integer | None +Long int64 = 789L; // Long | None +Float _float = 3.4F; // Float | None +byte[] binary = B; // byte[] | None +Date date = new Date(); // Date | None +Date dateTime = new Date(); // Date | None +String password = "password_example"; // String | None +try { + Void result = apiInstance.testEndpointParameters(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testEndpointParameters"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **number** | **BigDecimal**| None | + **_double** | **Double**| None | + **string** | **String**| None | + **_byte** | **byte[]**| None | + **integer** | **Integer**| None | [optional] + **int32** | **Integer**| None | [optional] + **int64** | **Long**| None | [optional] + **_float** | **Float**| None | [optional] + **binary** | **byte[]**| None | [optional] + **date** | **Date**| None | [optional] + **dateTime** | **Date**| None | [optional] + **password** | **String**| None | [optional] + +### Return type + +[**Void**](.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/xml; charset=utf-8, application/json; charset=utf-8 + - **Accept**: application/xml; charset=utf-8, application/json; charset=utf-8 + diff --git a/samples/client/petstore/java/retrofit2/docs/FormatTest.md b/samples/client/petstore/java/retrofit2/docs/FormatTest.md new file mode 100644 index 00000000000..dc2b559dad2 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/docs/FormatTest.md @@ -0,0 +1,22 @@ + +# FormatTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integer** | **Integer** | | [optional] +**int32** | **Integer** | | [optional] +**int64** | **Long** | | [optional] +**number** | [**BigDecimal**](BigDecimal.md) | | +**_float** | **Float** | | [optional] +**_double** | **Double** | | [optional] +**string** | **String** | | [optional] +**_byte** | **byte[]** | | +**binary** | **byte[]** | | [optional] +**date** | [**Date**](Date.md) | | +**dateTime** | [**Date**](Date.md) | | [optional] +**uuid** | **String** | | [optional] +**password** | **String** | | + + + diff --git a/samples/client/petstore/java/retrofit2/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java/retrofit2/docs/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 00000000000..fcdbd390517 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,11 @@ + +# MixedPropertiesAndAdditionalPropertiesClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uuid** | **String** | | [optional] +**dateTime** | [**Date**](Date.md) | | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2/docs/Model200Response.md b/samples/client/petstore/java/retrofit2/docs/Model200Response.md new file mode 100644 index 00000000000..0819b88c4f4 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/docs/Model200Response.md @@ -0,0 +1,10 @@ + +# Model200Response + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **Integer** | | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2/docs/ModelApiResponse.md b/samples/client/petstore/java/retrofit2/docs/ModelApiResponse.md new file mode 100644 index 00000000000..3eec8686cc9 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/docs/ModelApiResponse.md @@ -0,0 +1,12 @@ + +# ModelApiResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **Integer** | | [optional] +**type** | **String** | | [optional] +**message** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2/docs/ModelReturn.md b/samples/client/petstore/java/retrofit2/docs/ModelReturn.md new file mode 100644 index 00000000000..a679b04953e --- /dev/null +++ b/samples/client/petstore/java/retrofit2/docs/ModelReturn.md @@ -0,0 +1,10 @@ + +# ModelReturn + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_return** | **Integer** | | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2/docs/Name.md b/samples/client/petstore/java/retrofit2/docs/Name.md new file mode 100644 index 00000000000..ce2fb4dee50 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/docs/Name.md @@ -0,0 +1,13 @@ + +# Name + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **Integer** | | +**snakeCase** | **Integer** | | [optional] +**property** | **String** | | [optional] +**_123Number** | **Integer** | | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2/docs/Order.md b/samples/client/petstore/java/retrofit2/docs/Order.md new file mode 100644 index 00000000000..29ca3ddbc6b --- /dev/null +++ b/samples/client/petstore/java/retrofit2/docs/Order.md @@ -0,0 +1,24 @@ + +# Order + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Long** | | [optional] +**petId** | **Long** | | [optional] +**quantity** | **Integer** | | [optional] +**shipDate** | [**Date**](Date.md) | | [optional] +**status** | [**StatusEnum**](#StatusEnum) | Order Status | [optional] +**complete** | **Boolean** | | [optional] + + + +## Enum: StatusEnum +Name | Value +---- | ----- +PLACED | "placed" +APPROVED | "approved" +DELIVERED | "delivered" + + + diff --git a/samples/client/petstore/java/retrofit2/docs/Pet.md b/samples/client/petstore/java/retrofit2/docs/Pet.md new file mode 100644 index 00000000000..5b63109ef92 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/docs/Pet.md @@ -0,0 +1,24 @@ + +# Pet + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Long** | | [optional] +**category** | [**Category**](Category.md) | | [optional] +**name** | **String** | | +**photoUrls** | **List<String>** | | +**tags** | [**List<Tag>**](Tag.md) | | [optional] +**status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] + + + +## Enum: StatusEnum +Name | Value +---- | ----- +AVAILABLE | "available" +PENDING | "pending" +SOLD | "sold" + + + diff --git a/samples/client/petstore/java/retrofit2/docs/PetApi.md b/samples/client/petstore/java/retrofit2/docs/PetApi.md new file mode 100644 index 00000000000..40ea199b153 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/docs/PetApi.md @@ -0,0 +1,452 @@ +# PetApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addPet**](PetApi.md#addPet) | **POST** pet | Add a new pet to the store +[**deletePet**](PetApi.md#deletePet) | **DELETE** pet/{petId} | Deletes a pet +[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** pet/findByStatus | Finds Pets by status +[**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** pet/findByTags | Finds Pets by tags +[**getPetById**](PetApi.md#getPetById) | **GET** pet/{petId} | Find pet by ID +[**updatePet**](PetApi.md#updatePet) | **PUT** pet | Update an existing pet +[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** pet/{petId} | Updates a pet in the store with form data +[**uploadFile**](PetApi.md#uploadFile) | **POST** pet/{petId}/uploadImage | uploads an image + + + +# **addPet** +> Void addPet(body) + +Add a new pet to the store + + + +### Example +```java +// Import classes: +//import io.swagger.client.ApiClient; +//import io.swagger.client.ApiException; +//import io.swagger.client.Configuration; +//import io.swagger.client.auth.*; +//import io.swagger.client.api.PetApi; + +ApiClient defaultClient = Configuration.getDefaultApiClient(); + +// Configure OAuth2 access token for authorization: petstore_auth +OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); +petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + +PetApi apiInstance = new PetApi(); +Pet body = new Pet(); // Pet | Pet object that needs to be added to the store +try { + Void result = apiInstance.addPet(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling PetApi#addPet"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +[**Void**](.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: application/xml, application/json + + +# **deletePet** +> Void deletePet(petId, apiKey) + +Deletes a pet + + + +### Example +```java +// Import classes: +//import io.swagger.client.ApiClient; +//import io.swagger.client.ApiException; +//import io.swagger.client.Configuration; +//import io.swagger.client.auth.*; +//import io.swagger.client.api.PetApi; + +ApiClient defaultClient = Configuration.getDefaultApiClient(); + +// Configure OAuth2 access token for authorization: petstore_auth +OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); +petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + +PetApi apiInstance = new PetApi(); +Long petId = 789L; // Long | Pet id to delete +String apiKey = "apiKey_example"; // String | +try { + Void result = apiInstance.deletePet(petId, apiKey); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling PetApi#deletePet"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **Long**| Pet id to delete | + **apiKey** | **String**| | [optional] + +### Return type + +[**Void**](.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **findPetsByStatus** +> List<Pet> findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```java +// Import classes: +//import io.swagger.client.ApiClient; +//import io.swagger.client.ApiException; +//import io.swagger.client.Configuration; +//import io.swagger.client.auth.*; +//import io.swagger.client.api.PetApi; + +ApiClient defaultClient = Configuration.getDefaultApiClient(); + +// Configure OAuth2 access token for authorization: petstore_auth +OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); +petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + +PetApi apiInstance = new PetApi(); +List status = Arrays.asList("status_example"); // List | Status values that need to be considered for filter +try { + List result = apiInstance.findPetsByStatus(status); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling PetApi#findPetsByStatus"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | + +### Return type + +[**List<Pet>**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **findPetsByTags** +> List<Pet> findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```java +// Import classes: +//import io.swagger.client.ApiClient; +//import io.swagger.client.ApiException; +//import io.swagger.client.Configuration; +//import io.swagger.client.auth.*; +//import io.swagger.client.api.PetApi; + +ApiClient defaultClient = Configuration.getDefaultApiClient(); + +// Configure OAuth2 access token for authorization: petstore_auth +OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); +petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + +PetApi apiInstance = new PetApi(); +List tags = Arrays.asList("tags_example"); // List | Tags to filter by +try { + List result = apiInstance.findPetsByTags(tags); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling PetApi#findPetsByTags"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**List<String>**](String.md)| Tags to filter by | + +### Return type + +[**List<Pet>**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **getPetById** +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Example +```java +// Import classes: +//import io.swagger.client.ApiClient; +//import io.swagger.client.ApiException; +//import io.swagger.client.Configuration; +//import io.swagger.client.auth.*; +//import io.swagger.client.api.PetApi; + +ApiClient defaultClient = Configuration.getDefaultApiClient(); + +// Configure API key authorization: api_key +ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); +api_key.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//api_key.setApiKeyPrefix("Token"); + +PetApi apiInstance = new PetApi(); +Long petId = 789L; // Long | ID of pet to return +try { + Pet result = apiInstance.getPetById(petId); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling PetApi#getPetById"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **Long**| ID of pet to return | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **updatePet** +> Void updatePet(body) + +Update an existing pet + + + +### Example +```java +// Import classes: +//import io.swagger.client.ApiClient; +//import io.swagger.client.ApiException; +//import io.swagger.client.Configuration; +//import io.swagger.client.auth.*; +//import io.swagger.client.api.PetApi; + +ApiClient defaultClient = Configuration.getDefaultApiClient(); + +// Configure OAuth2 access token for authorization: petstore_auth +OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); +petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + +PetApi apiInstance = new PetApi(); +Pet body = new Pet(); // Pet | Pet object that needs to be added to the store +try { + Void result = apiInstance.updatePet(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling PetApi#updatePet"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +[**Void**](.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: application/xml, application/json + + +# **updatePetWithForm** +> Void updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + + + +### Example +```java +// Import classes: +//import io.swagger.client.ApiClient; +//import io.swagger.client.ApiException; +//import io.swagger.client.Configuration; +//import io.swagger.client.auth.*; +//import io.swagger.client.api.PetApi; + +ApiClient defaultClient = Configuration.getDefaultApiClient(); + +// Configure OAuth2 access token for authorization: petstore_auth +OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); +petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + +PetApi apiInstance = new PetApi(); +Long petId = 789L; // Long | ID of pet that needs to be updated +String name = "name_example"; // String | Updated name of the pet +String status = "status_example"; // String | Updated status of the pet +try { + Void result = apiInstance.updatePetWithForm(petId, name, status); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling PetApi#updatePetWithForm"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **Long**| ID of pet that needs to be updated | + **name** | **String**| Updated name of the pet | [optional] + **status** | **String**| Updated status of the pet | [optional] + +### Return type + +[**Void**](.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/xml, application/json + + +# **uploadFile** +> ModelApiResponse uploadFile(petId, additionalMetadata, file) + +uploads an image + + + +### Example +```java +// Import classes: +//import io.swagger.client.ApiClient; +//import io.swagger.client.ApiException; +//import io.swagger.client.Configuration; +//import io.swagger.client.auth.*; +//import io.swagger.client.api.PetApi; + +ApiClient defaultClient = Configuration.getDefaultApiClient(); + +// Configure OAuth2 access token for authorization: petstore_auth +OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); +petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + +PetApi apiInstance = new PetApi(); +Long petId = 789L; // Long | ID of pet to update +String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server +File file = new File("/path/to/file.txt"); // File | file to upload +try { + ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling PetApi#uploadFile"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **Long**| ID of pet to update | + **additionalMetadata** | **String**| Additional data to pass to server | [optional] + **file** | **File**| file to upload | [optional] + +### Return type + +[**ModelApiResponse**](ModelApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + diff --git a/samples/client/petstore/java/retrofit2/docs/ReadOnlyFirst.md b/samples/client/petstore/java/retrofit2/docs/ReadOnlyFirst.md new file mode 100644 index 00000000000..426b7cde95a --- /dev/null +++ b/samples/client/petstore/java/retrofit2/docs/ReadOnlyFirst.md @@ -0,0 +1,11 @@ + +# ReadOnlyFirst + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **String** | | [optional] +**baz** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2/docs/SpecialModelName.md b/samples/client/petstore/java/retrofit2/docs/SpecialModelName.md new file mode 100644 index 00000000000..c2c6117c552 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/docs/SpecialModelName.md @@ -0,0 +1,10 @@ + +# SpecialModelName + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**specialPropertyName** | **Long** | | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2/docs/StoreApi.md b/samples/client/petstore/java/retrofit2/docs/StoreApi.md new file mode 100644 index 00000000000..30e3c11d440 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/docs/StoreApi.md @@ -0,0 +1,198 @@ +# StoreApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** store/order/{orderId} | Delete purchase order by ID +[**getInventory**](StoreApi.md#getInventory) | **GET** store/inventory | Returns pet inventories by status +[**getOrderById**](StoreApi.md#getOrderById) | **GET** store/order/{orderId} | Find purchase order by ID +[**placeOrder**](StoreApi.md#placeOrder) | **POST** store/order | Place an order for a pet + + + +# **deleteOrder** +> Void deleteOrder(orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.StoreApi; + + +StoreApi apiInstance = new StoreApi(); +String orderId = "orderId_example"; // String | ID of the order that needs to be deleted +try { + Void result = apiInstance.deleteOrder(orderId); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling StoreApi#deleteOrder"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **String**| ID of the order that needs to be deleted | + +### Return type + +[**Void**](.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **getInventory** +> Map<String, Integer> getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```java +// Import classes: +//import io.swagger.client.ApiClient; +//import io.swagger.client.ApiException; +//import io.swagger.client.Configuration; +//import io.swagger.client.auth.*; +//import io.swagger.client.api.StoreApi; + +ApiClient defaultClient = Configuration.getDefaultApiClient(); + +// Configure API key authorization: api_key +ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); +api_key.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//api_key.setApiKeyPrefix("Token"); + +StoreApi apiInstance = new StoreApi(); +try { + Map result = apiInstance.getInventory(); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling StoreApi#getInventory"); + e.printStackTrace(); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**Map<String, Integer>**](Map.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **getOrderById** +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.StoreApi; + + +StoreApi apiInstance = new StoreApi(); +Long orderId = 789L; // Long | ID of pet that needs to be fetched +try { + Order result = apiInstance.getOrderById(orderId); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling StoreApi#getOrderById"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **Long**| ID of pet that needs to be fetched | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **placeOrder** +> Order placeOrder(body) + +Place an order for a pet + + + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.StoreApi; + + +StoreApi apiInstance = new StoreApi(); +Order body = new Order(); // Order | order placed for purchasing the pet +try { + Order result = apiInstance.placeOrder(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling StoreApi#placeOrder"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Order**](Order.md)| order placed for purchasing the pet | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + diff --git a/samples/client/petstore/java/retrofit2/docs/Tag.md b/samples/client/petstore/java/retrofit2/docs/Tag.md new file mode 100644 index 00000000000..de6814b55d5 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/docs/Tag.md @@ -0,0 +1,11 @@ + +# Tag + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Long** | | [optional] +**name** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2/docs/User.md b/samples/client/petstore/java/retrofit2/docs/User.md new file mode 100644 index 00000000000..8b6753dd284 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/docs/User.md @@ -0,0 +1,17 @@ + +# User + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Long** | | [optional] +**username** | **String** | | [optional] +**firstName** | **String** | | [optional] +**lastName** | **String** | | [optional] +**email** | **String** | | [optional] +**password** | **String** | | [optional] +**phone** | **String** | | [optional] +**userStatus** | **Integer** | User Status | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2/docs/UserApi.md b/samples/client/petstore/java/retrofit2/docs/UserApi.md new file mode 100644 index 00000000000..b0a0149a50a --- /dev/null +++ b/samples/client/petstore/java/retrofit2/docs/UserApi.md @@ -0,0 +1,376 @@ +# UserApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createUser**](UserApi.md#createUser) | **POST** user | Create user +[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** user/createWithArray | Creates list of users with given input array +[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** user/createWithList | Creates list of users with given input array +[**deleteUser**](UserApi.md#deleteUser) | **DELETE** user/{username} | Delete user +[**getUserByName**](UserApi.md#getUserByName) | **GET** user/{username} | Get user by user name +[**loginUser**](UserApi.md#loginUser) | **GET** user/login | Logs user into the system +[**logoutUser**](UserApi.md#logoutUser) | **GET** user/logout | Logs out current logged in user session +[**updateUser**](UserApi.md#updateUser) | **PUT** user/{username} | Updated user + + + +# **createUser** +> Void createUser(body) + +Create user + +This can only be done by the logged in user. + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.UserApi; + + +UserApi apiInstance = new UserApi(); +User body = new User(); // User | Created user object +try { + Void result = apiInstance.createUser(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling UserApi#createUser"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**User**](User.md)| Created user object | + +### Return type + +[**Void**](.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **createUsersWithArrayInput** +> Void createUsersWithArrayInput(body) + +Creates list of users with given input array + + + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.UserApi; + + +UserApi apiInstance = new UserApi(); +List body = Arrays.asList(new User()); // List | List of user object +try { + Void result = apiInstance.createUsersWithArrayInput(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**List<User>**](User.md)| List of user object | + +### Return type + +[**Void**](.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **createUsersWithListInput** +> Void createUsersWithListInput(body) + +Creates list of users with given input array + + + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.UserApi; + + +UserApi apiInstance = new UserApi(); +List body = Arrays.asList(new User()); // List | List of user object +try { + Void result = apiInstance.createUsersWithListInput(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling UserApi#createUsersWithListInput"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**List<User>**](User.md)| List of user object | + +### Return type + +[**Void**](.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **deleteUser** +> Void deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.UserApi; + + +UserApi apiInstance = new UserApi(); +String username = "username_example"; // String | The name that needs to be deleted +try { + Void result = apiInstance.deleteUser(username); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling UserApi#deleteUser"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The name that needs to be deleted | + +### Return type + +[**Void**](.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **getUserByName** +> User getUserByName(username) + +Get user by user name + + + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.UserApi; + + +UserApi apiInstance = new UserApi(); +String username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing. +try { + User result = apiInstance.getUserByName(username); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling UserApi#getUserByName"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The name that needs to be fetched. Use user1 for testing. | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **loginUser** +> String loginUser(username, password) + +Logs user into the system + + + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.UserApi; + + +UserApi apiInstance = new UserApi(); +String username = "username_example"; // String | The user name for login +String password = "password_example"; // String | The password for login in clear text +try { + String result = apiInstance.loginUser(username, password); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling UserApi#loginUser"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The user name for login | + **password** | **String**| The password for login in clear text | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **logoutUser** +> Void logoutUser() + +Logs out current logged in user session + + + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.UserApi; + + +UserApi apiInstance = new UserApi(); +try { + Void result = apiInstance.logoutUser(); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling UserApi#logoutUser"); + e.printStackTrace(); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**Void**](.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **updateUser** +> Void updateUser(username, body) + +Updated user + +This can only be done by the logged in user. + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.UserApi; + + +UserApi apiInstance = new UserApi(); +String username = "username_example"; // String | name that need to be deleted +User body = new User(); // User | Updated user object +try { + Void result = apiInstance.updateUser(username, body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling UserApi#updateUser"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| name that need to be deleted | + **body** | [**User**](User.md)| Updated user object | + +### Return type + +[**Void**](.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + diff --git a/samples/client/petstore/java/retrofit2rx/docs/AdditionalPropertiesClass.md b/samples/client/petstore/java/retrofit2rx/docs/AdditionalPropertiesClass.md new file mode 100644 index 00000000000..c72785d450f --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/docs/AdditionalPropertiesClass.md @@ -0,0 +1,9 @@ + +# AdditionalPropertiesClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/retrofit2rx/docs/Animal.md b/samples/client/petstore/java/retrofit2rx/docs/Animal.md new file mode 100644 index 00000000000..b3f325c3524 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/docs/Animal.md @@ -0,0 +1,11 @@ + +# Animal + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2rx/docs/AnimalFarm.md b/samples/client/petstore/java/retrofit2rx/docs/AnimalFarm.md new file mode 100644 index 00000000000..c7c7f1ddcce --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/docs/AnimalFarm.md @@ -0,0 +1,9 @@ + +# AnimalFarm + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/retrofit2rx/docs/ArrayTest.md b/samples/client/petstore/java/retrofit2rx/docs/ArrayTest.md new file mode 100644 index 00000000000..73c3e5305ad --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/docs/ArrayTest.md @@ -0,0 +1,9 @@ + +# ArrayTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/retrofit2rx/docs/Cat.md b/samples/client/petstore/java/retrofit2rx/docs/Cat.md new file mode 100644 index 00000000000..be6e56fa8ce --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/docs/Cat.md @@ -0,0 +1,12 @@ + +# Cat + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] +**declawed** | **Boolean** | | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2rx/docs/Category.md b/samples/client/petstore/java/retrofit2rx/docs/Category.md new file mode 100644 index 00000000000..e2df0803278 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/docs/Category.md @@ -0,0 +1,11 @@ + +# Category + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Long** | | [optional] +**name** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2rx/docs/Dog.md b/samples/client/petstore/java/retrofit2rx/docs/Dog.md new file mode 100644 index 00000000000..71a7dbe809e --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/docs/Dog.md @@ -0,0 +1,12 @@ + +# Dog + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] +**breed** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2rx/docs/EnumClass.md b/samples/client/petstore/java/retrofit2rx/docs/EnumClass.md new file mode 100644 index 00000000000..c746edc3cb1 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/docs/EnumClass.md @@ -0,0 +1,14 @@ + +# EnumClass + +## Enum + + +* `_ABC` (value: `"_abc"`) + +* `_EFG` (value: `"-efg"`) + +* `_XYZ_` (value: `"(xyz)"`) + + + diff --git a/samples/client/petstore/java/retrofit2rx/docs/EnumTest.md b/samples/client/petstore/java/retrofit2rx/docs/EnumTest.md new file mode 100644 index 00000000000..deb1951c552 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/docs/EnumTest.md @@ -0,0 +1,36 @@ + +# EnumTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional] +**enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] +**enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] + + + +## Enum: EnumStringEnum +Name | Value +---- | ----- +UPPER | "UPPER" +LOWER | "lower" + + + +## Enum: EnumIntegerEnum +Name | Value +---- | ----- +NUMBER_1 | 1 +NUMBER_MINUS_1 | -1 + + + +## Enum: EnumNumberEnum +Name | Value +---- | ----- +NUMBER_1_DOT_1 | 1.1 +NUMBER_MINUS_1_DOT_2 | -1.2 + + + diff --git a/samples/client/petstore/java/retrofit2rx/docs/FakeApi.md b/samples/client/petstore/java/retrofit2rx/docs/FakeApi.md new file mode 100644 index 00000000000..55f7cef2df4 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/docs/FakeApi.md @@ -0,0 +1,76 @@ +# FakeApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + + + +# **testEndpointParameters** +> Void testEndpointParameters(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password) + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +BigDecimal number = new BigDecimal(); // BigDecimal | None +Double _double = 3.4D; // Double | None +String string = "string_example"; // String | None +byte[] _byte = B; // byte[] | None +Integer integer = 56; // Integer | None +Integer int32 = 56; // Integer | None +Long int64 = 789L; // Long | None +Float _float = 3.4F; // Float | None +byte[] binary = B; // byte[] | None +Date date = new Date(); // Date | None +Date dateTime = new Date(); // Date | None +String password = "password_example"; // String | None +try { + Void result = apiInstance.testEndpointParameters(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testEndpointParameters"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **number** | **BigDecimal**| None | + **_double** | **Double**| None | + **string** | **String**| None | + **_byte** | **byte[]**| None | + **integer** | **Integer**| None | [optional] + **int32** | **Integer**| None | [optional] + **int64** | **Long**| None | [optional] + **_float** | **Float**| None | [optional] + **binary** | **byte[]**| None | [optional] + **date** | **Date**| None | [optional] + **dateTime** | **Date**| None | [optional] + **password** | **String**| None | [optional] + +### Return type + +[**Void**](.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/xml; charset=utf-8, application/json; charset=utf-8 + - **Accept**: application/xml; charset=utf-8, application/json; charset=utf-8 + diff --git a/samples/client/petstore/java/retrofit2rx/docs/FormatTest.md b/samples/client/petstore/java/retrofit2rx/docs/FormatTest.md new file mode 100644 index 00000000000..dc2b559dad2 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/docs/FormatTest.md @@ -0,0 +1,22 @@ + +# FormatTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integer** | **Integer** | | [optional] +**int32** | **Integer** | | [optional] +**int64** | **Long** | | [optional] +**number** | [**BigDecimal**](BigDecimal.md) | | +**_float** | **Float** | | [optional] +**_double** | **Double** | | [optional] +**string** | **String** | | [optional] +**_byte** | **byte[]** | | +**binary** | **byte[]** | | [optional] +**date** | [**Date**](Date.md) | | +**dateTime** | [**Date**](Date.md) | | [optional] +**uuid** | **String** | | [optional] +**password** | **String** | | + + + diff --git a/samples/client/petstore/java/retrofit2rx/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java/retrofit2rx/docs/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 00000000000..fcdbd390517 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,11 @@ + +# MixedPropertiesAndAdditionalPropertiesClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uuid** | **String** | | [optional] +**dateTime** | [**Date**](Date.md) | | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2rx/docs/Model200Response.md b/samples/client/petstore/java/retrofit2rx/docs/Model200Response.md new file mode 100644 index 00000000000..0819b88c4f4 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/docs/Model200Response.md @@ -0,0 +1,10 @@ + +# Model200Response + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **Integer** | | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2rx/docs/ModelApiResponse.md b/samples/client/petstore/java/retrofit2rx/docs/ModelApiResponse.md new file mode 100644 index 00000000000..3eec8686cc9 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/docs/ModelApiResponse.md @@ -0,0 +1,12 @@ + +# ModelApiResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **Integer** | | [optional] +**type** | **String** | | [optional] +**message** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2rx/docs/ModelReturn.md b/samples/client/petstore/java/retrofit2rx/docs/ModelReturn.md new file mode 100644 index 00000000000..a679b04953e --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/docs/ModelReturn.md @@ -0,0 +1,10 @@ + +# ModelReturn + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_return** | **Integer** | | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2rx/docs/Name.md b/samples/client/petstore/java/retrofit2rx/docs/Name.md new file mode 100644 index 00000000000..ce2fb4dee50 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/docs/Name.md @@ -0,0 +1,13 @@ + +# Name + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **Integer** | | +**snakeCase** | **Integer** | | [optional] +**property** | **String** | | [optional] +**_123Number** | **Integer** | | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2rx/docs/Order.md b/samples/client/petstore/java/retrofit2rx/docs/Order.md new file mode 100644 index 00000000000..29ca3ddbc6b --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/docs/Order.md @@ -0,0 +1,24 @@ + +# Order + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Long** | | [optional] +**petId** | **Long** | | [optional] +**quantity** | **Integer** | | [optional] +**shipDate** | [**Date**](Date.md) | | [optional] +**status** | [**StatusEnum**](#StatusEnum) | Order Status | [optional] +**complete** | **Boolean** | | [optional] + + + +## Enum: StatusEnum +Name | Value +---- | ----- +PLACED | "placed" +APPROVED | "approved" +DELIVERED | "delivered" + + + diff --git a/samples/client/petstore/java/retrofit2rx/docs/Pet.md b/samples/client/petstore/java/retrofit2rx/docs/Pet.md new file mode 100644 index 00000000000..5b63109ef92 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/docs/Pet.md @@ -0,0 +1,24 @@ + +# Pet + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Long** | | [optional] +**category** | [**Category**](Category.md) | | [optional] +**name** | **String** | | +**photoUrls** | **List<String>** | | +**tags** | [**List<Tag>**](Tag.md) | | [optional] +**status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] + + + +## Enum: StatusEnum +Name | Value +---- | ----- +AVAILABLE | "available" +PENDING | "pending" +SOLD | "sold" + + + diff --git a/samples/client/petstore/java/retrofit2rx/docs/PetApi.md b/samples/client/petstore/java/retrofit2rx/docs/PetApi.md new file mode 100644 index 00000000000..40ea199b153 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/docs/PetApi.md @@ -0,0 +1,452 @@ +# PetApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addPet**](PetApi.md#addPet) | **POST** pet | Add a new pet to the store +[**deletePet**](PetApi.md#deletePet) | **DELETE** pet/{petId} | Deletes a pet +[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** pet/findByStatus | Finds Pets by status +[**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** pet/findByTags | Finds Pets by tags +[**getPetById**](PetApi.md#getPetById) | **GET** pet/{petId} | Find pet by ID +[**updatePet**](PetApi.md#updatePet) | **PUT** pet | Update an existing pet +[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** pet/{petId} | Updates a pet in the store with form data +[**uploadFile**](PetApi.md#uploadFile) | **POST** pet/{petId}/uploadImage | uploads an image + + + +# **addPet** +> Void addPet(body) + +Add a new pet to the store + + + +### Example +```java +// Import classes: +//import io.swagger.client.ApiClient; +//import io.swagger.client.ApiException; +//import io.swagger.client.Configuration; +//import io.swagger.client.auth.*; +//import io.swagger.client.api.PetApi; + +ApiClient defaultClient = Configuration.getDefaultApiClient(); + +// Configure OAuth2 access token for authorization: petstore_auth +OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); +petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + +PetApi apiInstance = new PetApi(); +Pet body = new Pet(); // Pet | Pet object that needs to be added to the store +try { + Void result = apiInstance.addPet(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling PetApi#addPet"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +[**Void**](.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: application/xml, application/json + + +# **deletePet** +> Void deletePet(petId, apiKey) + +Deletes a pet + + + +### Example +```java +// Import classes: +//import io.swagger.client.ApiClient; +//import io.swagger.client.ApiException; +//import io.swagger.client.Configuration; +//import io.swagger.client.auth.*; +//import io.swagger.client.api.PetApi; + +ApiClient defaultClient = Configuration.getDefaultApiClient(); + +// Configure OAuth2 access token for authorization: petstore_auth +OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); +petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + +PetApi apiInstance = new PetApi(); +Long petId = 789L; // Long | Pet id to delete +String apiKey = "apiKey_example"; // String | +try { + Void result = apiInstance.deletePet(petId, apiKey); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling PetApi#deletePet"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **Long**| Pet id to delete | + **apiKey** | **String**| | [optional] + +### Return type + +[**Void**](.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **findPetsByStatus** +> List<Pet> findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```java +// Import classes: +//import io.swagger.client.ApiClient; +//import io.swagger.client.ApiException; +//import io.swagger.client.Configuration; +//import io.swagger.client.auth.*; +//import io.swagger.client.api.PetApi; + +ApiClient defaultClient = Configuration.getDefaultApiClient(); + +// Configure OAuth2 access token for authorization: petstore_auth +OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); +petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + +PetApi apiInstance = new PetApi(); +List status = Arrays.asList("status_example"); // List | Status values that need to be considered for filter +try { + List result = apiInstance.findPetsByStatus(status); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling PetApi#findPetsByStatus"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | + +### Return type + +[**List<Pet>**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **findPetsByTags** +> List<Pet> findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```java +// Import classes: +//import io.swagger.client.ApiClient; +//import io.swagger.client.ApiException; +//import io.swagger.client.Configuration; +//import io.swagger.client.auth.*; +//import io.swagger.client.api.PetApi; + +ApiClient defaultClient = Configuration.getDefaultApiClient(); + +// Configure OAuth2 access token for authorization: petstore_auth +OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); +petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + +PetApi apiInstance = new PetApi(); +List tags = Arrays.asList("tags_example"); // List | Tags to filter by +try { + List result = apiInstance.findPetsByTags(tags); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling PetApi#findPetsByTags"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**List<String>**](String.md)| Tags to filter by | + +### Return type + +[**List<Pet>**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **getPetById** +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Example +```java +// Import classes: +//import io.swagger.client.ApiClient; +//import io.swagger.client.ApiException; +//import io.swagger.client.Configuration; +//import io.swagger.client.auth.*; +//import io.swagger.client.api.PetApi; + +ApiClient defaultClient = Configuration.getDefaultApiClient(); + +// Configure API key authorization: api_key +ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); +api_key.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//api_key.setApiKeyPrefix("Token"); + +PetApi apiInstance = new PetApi(); +Long petId = 789L; // Long | ID of pet to return +try { + Pet result = apiInstance.getPetById(petId); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling PetApi#getPetById"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **Long**| ID of pet to return | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **updatePet** +> Void updatePet(body) + +Update an existing pet + + + +### Example +```java +// Import classes: +//import io.swagger.client.ApiClient; +//import io.swagger.client.ApiException; +//import io.swagger.client.Configuration; +//import io.swagger.client.auth.*; +//import io.swagger.client.api.PetApi; + +ApiClient defaultClient = Configuration.getDefaultApiClient(); + +// Configure OAuth2 access token for authorization: petstore_auth +OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); +petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + +PetApi apiInstance = new PetApi(); +Pet body = new Pet(); // Pet | Pet object that needs to be added to the store +try { + Void result = apiInstance.updatePet(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling PetApi#updatePet"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +[**Void**](.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: application/xml, application/json + + +# **updatePetWithForm** +> Void updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + + + +### Example +```java +// Import classes: +//import io.swagger.client.ApiClient; +//import io.swagger.client.ApiException; +//import io.swagger.client.Configuration; +//import io.swagger.client.auth.*; +//import io.swagger.client.api.PetApi; + +ApiClient defaultClient = Configuration.getDefaultApiClient(); + +// Configure OAuth2 access token for authorization: petstore_auth +OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); +petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + +PetApi apiInstance = new PetApi(); +Long petId = 789L; // Long | ID of pet that needs to be updated +String name = "name_example"; // String | Updated name of the pet +String status = "status_example"; // String | Updated status of the pet +try { + Void result = apiInstance.updatePetWithForm(petId, name, status); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling PetApi#updatePetWithForm"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **Long**| ID of pet that needs to be updated | + **name** | **String**| Updated name of the pet | [optional] + **status** | **String**| Updated status of the pet | [optional] + +### Return type + +[**Void**](.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/xml, application/json + + +# **uploadFile** +> ModelApiResponse uploadFile(petId, additionalMetadata, file) + +uploads an image + + + +### Example +```java +// Import classes: +//import io.swagger.client.ApiClient; +//import io.swagger.client.ApiException; +//import io.swagger.client.Configuration; +//import io.swagger.client.auth.*; +//import io.swagger.client.api.PetApi; + +ApiClient defaultClient = Configuration.getDefaultApiClient(); + +// Configure OAuth2 access token for authorization: petstore_auth +OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); +petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + +PetApi apiInstance = new PetApi(); +Long petId = 789L; // Long | ID of pet to update +String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server +File file = new File("/path/to/file.txt"); // File | file to upload +try { + ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling PetApi#uploadFile"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **Long**| ID of pet to update | + **additionalMetadata** | **String**| Additional data to pass to server | [optional] + **file** | **File**| file to upload | [optional] + +### Return type + +[**ModelApiResponse**](ModelApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + diff --git a/samples/client/petstore/java/retrofit2rx/docs/ReadOnlyFirst.md b/samples/client/petstore/java/retrofit2rx/docs/ReadOnlyFirst.md new file mode 100644 index 00000000000..426b7cde95a --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/docs/ReadOnlyFirst.md @@ -0,0 +1,11 @@ + +# ReadOnlyFirst + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **String** | | [optional] +**baz** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2rx/docs/SpecialModelName.md b/samples/client/petstore/java/retrofit2rx/docs/SpecialModelName.md new file mode 100644 index 00000000000..c2c6117c552 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/docs/SpecialModelName.md @@ -0,0 +1,10 @@ + +# SpecialModelName + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**specialPropertyName** | **Long** | | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2rx/docs/StoreApi.md b/samples/client/petstore/java/retrofit2rx/docs/StoreApi.md new file mode 100644 index 00000000000..30e3c11d440 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/docs/StoreApi.md @@ -0,0 +1,198 @@ +# StoreApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** store/order/{orderId} | Delete purchase order by ID +[**getInventory**](StoreApi.md#getInventory) | **GET** store/inventory | Returns pet inventories by status +[**getOrderById**](StoreApi.md#getOrderById) | **GET** store/order/{orderId} | Find purchase order by ID +[**placeOrder**](StoreApi.md#placeOrder) | **POST** store/order | Place an order for a pet + + + +# **deleteOrder** +> Void deleteOrder(orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.StoreApi; + + +StoreApi apiInstance = new StoreApi(); +String orderId = "orderId_example"; // String | ID of the order that needs to be deleted +try { + Void result = apiInstance.deleteOrder(orderId); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling StoreApi#deleteOrder"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **String**| ID of the order that needs to be deleted | + +### Return type + +[**Void**](.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **getInventory** +> Map<String, Integer> getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```java +// Import classes: +//import io.swagger.client.ApiClient; +//import io.swagger.client.ApiException; +//import io.swagger.client.Configuration; +//import io.swagger.client.auth.*; +//import io.swagger.client.api.StoreApi; + +ApiClient defaultClient = Configuration.getDefaultApiClient(); + +// Configure API key authorization: api_key +ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); +api_key.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//api_key.setApiKeyPrefix("Token"); + +StoreApi apiInstance = new StoreApi(); +try { + Map result = apiInstance.getInventory(); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling StoreApi#getInventory"); + e.printStackTrace(); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**Map<String, Integer>**](Map.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **getOrderById** +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.StoreApi; + + +StoreApi apiInstance = new StoreApi(); +Long orderId = 789L; // Long | ID of pet that needs to be fetched +try { + Order result = apiInstance.getOrderById(orderId); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling StoreApi#getOrderById"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **Long**| ID of pet that needs to be fetched | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **placeOrder** +> Order placeOrder(body) + +Place an order for a pet + + + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.StoreApi; + + +StoreApi apiInstance = new StoreApi(); +Order body = new Order(); // Order | order placed for purchasing the pet +try { + Order result = apiInstance.placeOrder(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling StoreApi#placeOrder"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Order**](Order.md)| order placed for purchasing the pet | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + diff --git a/samples/client/petstore/java/retrofit2rx/docs/Tag.md b/samples/client/petstore/java/retrofit2rx/docs/Tag.md new file mode 100644 index 00000000000..de6814b55d5 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/docs/Tag.md @@ -0,0 +1,11 @@ + +# Tag + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Long** | | [optional] +**name** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2rx/docs/User.md b/samples/client/petstore/java/retrofit2rx/docs/User.md new file mode 100644 index 00000000000..8b6753dd284 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/docs/User.md @@ -0,0 +1,17 @@ + +# User + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Long** | | [optional] +**username** | **String** | | [optional] +**firstName** | **String** | | [optional] +**lastName** | **String** | | [optional] +**email** | **String** | | [optional] +**password** | **String** | | [optional] +**phone** | **String** | | [optional] +**userStatus** | **Integer** | User Status | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2rx/docs/UserApi.md b/samples/client/petstore/java/retrofit2rx/docs/UserApi.md new file mode 100644 index 00000000000..b0a0149a50a --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/docs/UserApi.md @@ -0,0 +1,376 @@ +# UserApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createUser**](UserApi.md#createUser) | **POST** user | Create user +[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** user/createWithArray | Creates list of users with given input array +[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** user/createWithList | Creates list of users with given input array +[**deleteUser**](UserApi.md#deleteUser) | **DELETE** user/{username} | Delete user +[**getUserByName**](UserApi.md#getUserByName) | **GET** user/{username} | Get user by user name +[**loginUser**](UserApi.md#loginUser) | **GET** user/login | Logs user into the system +[**logoutUser**](UserApi.md#logoutUser) | **GET** user/logout | Logs out current logged in user session +[**updateUser**](UserApi.md#updateUser) | **PUT** user/{username} | Updated user + + + +# **createUser** +> Void createUser(body) + +Create user + +This can only be done by the logged in user. + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.UserApi; + + +UserApi apiInstance = new UserApi(); +User body = new User(); // User | Created user object +try { + Void result = apiInstance.createUser(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling UserApi#createUser"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**User**](User.md)| Created user object | + +### Return type + +[**Void**](.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **createUsersWithArrayInput** +> Void createUsersWithArrayInput(body) + +Creates list of users with given input array + + + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.UserApi; + + +UserApi apiInstance = new UserApi(); +List body = Arrays.asList(new User()); // List | List of user object +try { + Void result = apiInstance.createUsersWithArrayInput(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**List<User>**](User.md)| List of user object | + +### Return type + +[**Void**](.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **createUsersWithListInput** +> Void createUsersWithListInput(body) + +Creates list of users with given input array + + + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.UserApi; + + +UserApi apiInstance = new UserApi(); +List body = Arrays.asList(new User()); // List | List of user object +try { + Void result = apiInstance.createUsersWithListInput(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling UserApi#createUsersWithListInput"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**List<User>**](User.md)| List of user object | + +### Return type + +[**Void**](.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **deleteUser** +> Void deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.UserApi; + + +UserApi apiInstance = new UserApi(); +String username = "username_example"; // String | The name that needs to be deleted +try { + Void result = apiInstance.deleteUser(username); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling UserApi#deleteUser"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The name that needs to be deleted | + +### Return type + +[**Void**](.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **getUserByName** +> User getUserByName(username) + +Get user by user name + + + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.UserApi; + + +UserApi apiInstance = new UserApi(); +String username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing. +try { + User result = apiInstance.getUserByName(username); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling UserApi#getUserByName"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The name that needs to be fetched. Use user1 for testing. | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **loginUser** +> String loginUser(username, password) + +Logs user into the system + + + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.UserApi; + + +UserApi apiInstance = new UserApi(); +String username = "username_example"; // String | The user name for login +String password = "password_example"; // String | The password for login in clear text +try { + String result = apiInstance.loginUser(username, password); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling UserApi#loginUser"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The user name for login | + **password** | **String**| The password for login in clear text | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **logoutUser** +> Void logoutUser() + +Logs out current logged in user session + + + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.UserApi; + + +UserApi apiInstance = new UserApi(); +try { + Void result = apiInstance.logoutUser(); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling UserApi#logoutUser"); + e.printStackTrace(); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**Void**](.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **updateUser** +> Void updateUser(username, body) + +Updated user + +This can only be done by the logged in user. + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.UserApi; + + +UserApi apiInstance = new UserApi(); +String username = "username_example"; // String | name that need to be deleted +User body = new User(); // User | Updated user object +try { + Void result = apiInstance.updateUser(username, body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling UserApi#updateUser"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| name that need to be deleted | + **body** | [**User**](User.md)| Updated user object | + +### Return type + +[**Void**](.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + diff --git a/samples/client/petstore/javascript/.swagger-codegen-ignore b/samples/client/petstore/javascript/.swagger-codegen-ignore new file mode 100644 index 00000000000..19d3377182e --- /dev/null +++ b/samples/client/petstore/javascript/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# 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 Swagger Codgen 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 +# Thsi 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/javascript/LICENSE b/samples/client/petstore/javascript/LICENSE new file mode 100644 index 00000000000..d9a10c0d8e8 --- /dev/null +++ b/samples/client/petstore/javascript/LICENSE @@ -0,0 +1,176 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS diff --git a/samples/client/petstore/javascript/README.md b/samples/client/petstore/javascript/README.md index 1bf60abb9c3..dfc15cba3f9 100644 --- a/samples/client/petstore/javascript/README.md +++ b/samples/client/petstore/javascript/README.md @@ -1,12 +1,12 @@ # swagger-petstore SwaggerPetstore - JavaScript client for swagger-petstore -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - API version: 1.0.0 - Package version: 1.0.0 -- Build date: 2016-05-06T18:34:50.267+08:00 +- Build date: 2016-05-29T20:52:27.873+08:00 - Build package: class io.swagger.codegen.languages.JavascriptClientCodegen ## Installation @@ -91,7 +91,7 @@ All URIs are relative to *http://petstore.swagger.io/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*SwaggerPetstore.FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters +*SwaggerPetstore.FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *SwaggerPetstore.PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store *SwaggerPetstore.PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet *SwaggerPetstore.PetApi* | [**findPetsByStatus**](docs/PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status @@ -116,20 +116,24 @@ Class | Method | HTTP request | Description ## Documentation for Models + - [SwaggerPetstore.AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) - [SwaggerPetstore.Animal](docs/Animal.md) - [SwaggerPetstore.AnimalFarm](docs/AnimalFarm.md) - [SwaggerPetstore.ApiResponse](docs/ApiResponse.md) + - [SwaggerPetstore.ArrayTest](docs/ArrayTest.md) - [SwaggerPetstore.Cat](docs/Cat.md) - [SwaggerPetstore.Category](docs/Category.md) - [SwaggerPetstore.Dog](docs/Dog.md) - [SwaggerPetstore.EnumClass](docs/EnumClass.md) - [SwaggerPetstore.EnumTest](docs/EnumTest.md) - [SwaggerPetstore.FormatTest](docs/FormatTest.md) + - [SwaggerPetstore.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - [SwaggerPetstore.Model200Response](docs/Model200Response.md) - [SwaggerPetstore.ModelReturn](docs/ModelReturn.md) - [SwaggerPetstore.Name](docs/Name.md) - [SwaggerPetstore.Order](docs/Order.md) - [SwaggerPetstore.Pet](docs/Pet.md) + - [SwaggerPetstore.ReadOnlyFirst](docs/ReadOnlyFirst.md) - [SwaggerPetstore.SpecialModelName](docs/SpecialModelName.md) - [SwaggerPetstore.Tag](docs/Tag.md) - [SwaggerPetstore.User](docs/User.md) @@ -138,6 +142,12 @@ Class | Method | HTTP request | Description ## Documentation for Authorization +### api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + ### petstore_auth - **Type**: OAuth @@ -147,9 +157,3 @@ Class | Method | HTTP request | Description - write:pets: modify pets in your account - read:pets: read your pets -### api_key - -- **Type**: API key -- **API key parameter name**: api_key -- **Location**: HTTP header - diff --git a/samples/client/petstore/javascript/docs/AdditionalPropertiesClass.md b/samples/client/petstore/javascript/docs/AdditionalPropertiesClass.md new file mode 100644 index 00000000000..f25c4fceec7 --- /dev/null +++ b/samples/client/petstore/javascript/docs/AdditionalPropertiesClass.md @@ -0,0 +1,7 @@ +# SwaggerPetstore.AdditionalPropertiesClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/samples/client/petstore/javascript/docs/Animal.md b/samples/client/petstore/javascript/docs/Animal.md index c37d95695a0..3ae52d9db17 100644 --- a/samples/client/petstore/javascript/docs/Animal.md +++ b/samples/client/petstore/javascript/docs/Animal.md @@ -4,5 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **className** | **String** | | +**color** | **String** | | [optional] [default to 'red'] diff --git a/samples/client/petstore/javascript/docs/ArrayTest.md b/samples/client/petstore/javascript/docs/ArrayTest.md new file mode 100644 index 00000000000..2e056172023 --- /dev/null +++ b/samples/client/petstore/javascript/docs/ArrayTest.md @@ -0,0 +1,7 @@ +# SwaggerPetstore.ArrayTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/samples/client/petstore/javascript/docs/FakeApi.md b/samples/client/petstore/javascript/docs/FakeApi.md index 121056d1c56..6eba9c1b023 100644 --- a/samples/client/petstore/javascript/docs/FakeApi.md +++ b/samples/client/petstore/javascript/docs/FakeApi.md @@ -4,16 +4,16 @@ All URIs are relative to *http://petstore.swagger.io/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters +[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # **testEndpointParameters** > testEndpointParameters(_number, _double, _string, _byte, opts) -Fake endpoint for testing various parameters +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -Fake endpoint for testing various parameters +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ### Example ```javascript @@ -77,6 +77,6 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Content-Type**: application/xml; charset=utf-8, application/json; charset=utf-8 + - **Accept**: application/xml; charset=utf-8, application/json; charset=utf-8 diff --git a/samples/client/petstore/javascript/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/javascript/docs/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 00000000000..cecc4a1156a --- /dev/null +++ b/samples/client/petstore/javascript/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,9 @@ +# SwaggerPetstore.MixedPropertiesAndAdditionalPropertiesClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uuid** | **String** | | [optional] +**dateTime** | **Date** | | [optional] + + diff --git a/samples/client/petstore/javascript/docs/Name.md b/samples/client/petstore/javascript/docs/Name.md index 3bdb76be085..6c47d402743 100644 --- a/samples/client/petstore/javascript/docs/Name.md +++ b/samples/client/petstore/javascript/docs/Name.md @@ -6,5 +6,6 @@ Name | Type | Description | Notes **name** | **Integer** | | **snakeCase** | **Integer** | | [optional] **property** | **String** | | [optional] +**_123Number** | **Integer** | | [optional] diff --git a/samples/client/petstore/javascript/docs/ReadOnlyFirst.md b/samples/client/petstore/javascript/docs/ReadOnlyFirst.md new file mode 100644 index 00000000000..5a16f8acce0 --- /dev/null +++ b/samples/client/petstore/javascript/docs/ReadOnlyFirst.md @@ -0,0 +1,9 @@ +# SwaggerPetstore.ReadOnlyFirst + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **String** | | [optional] +**baz** | **String** | | [optional] + + diff --git a/samples/client/petstore/javascript/package.json b/samples/client/petstore/javascript/package.json index 8ff02a78ae3..53ea2d8faf9 100644 --- a/samples/client/petstore/javascript/package.json +++ b/samples/client/petstore/javascript/package.json @@ -1,8 +1,8 @@ { "name": "swagger-petstore", "version": "1.0.0", - "description": "This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose.", - "license": "Apache 2.0", + "description": "This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ", + "license": "Apache-2.0", "main": "src/index.js", "scripts": { "test": "./node_modules/mocha/bin/mocha --recursive" diff --git a/samples/client/petstore/javascript/src/ApiClient.js b/samples/client/petstore/javascript/src/ApiClient.js index 2598dd8d9ea..d45704dcdac 100644 --- a/samples/client/petstore/javascript/src/ApiClient.js +++ b/samples/client/petstore/javascript/src/ApiClient.js @@ -40,8 +40,8 @@ * @type {Array.} */ this.authentications = { - 'petstore_auth': {type: 'oauth2'}, - 'api_key': {type: 'apiKey', 'in': 'header', name: 'api_key'} + 'api_key': {type: 'apiKey', 'in': 'header', name: 'api_key'}, + 'petstore_auth': {type: 'oauth2'} }; /** * The default HTTP headers to be included for all API calls. diff --git a/samples/client/petstore/javascript/src/api/FakeApi.js b/samples/client/petstore/javascript/src/api/FakeApi.js index f75b8f55890..9db45d334f5 100644 --- a/samples/client/petstore/javascript/src/api/FakeApi.js +++ b/samples/client/petstore/javascript/src/api/FakeApi.js @@ -41,8 +41,8 @@ */ /** - * Fake endpoint for testing various parameters - * Fake endpoint for testing various parameters + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * @param {Number} _number None * @param {Number} _double None * @param {String} _string None @@ -105,8 +105,8 @@ }; var authNames = []; - var contentTypes = []; - var accepts = ['application/xml', 'application/json']; + var contentTypes = ['application/xml; charset=utf-8', 'application/json; charset=utf-8']; + var accepts = ['application/xml; charset=utf-8', 'application/json; charset=utf-8']; var returnType = null; return this.apiClient.callApi( diff --git a/samples/client/petstore/javascript/src/index.js b/samples/client/petstore/javascript/src/index.js index 727b4782f45..2c3e34b4efd 100644 --- a/samples/client/petstore/javascript/src/index.js +++ b/samples/client/petstore/javascript/src/index.js @@ -1,16 +1,16 @@ (function(factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. - define(['ApiClient', 'model/Animal', 'model/AnimalFarm', 'model/ApiResponse', 'model/Cat', 'model/Category', 'model/Dog', 'model/EnumClass', 'model/EnumTest', 'model/FormatTest', 'model/Model200Response', 'model/ModelReturn', 'model/Name', 'model/Order', 'model/Pet', 'model/SpecialModelName', 'model/Tag', 'model/User', 'api/FakeApi', 'api/PetApi', 'api/StoreApi', 'api/UserApi'], factory); + define(['ApiClient', 'model/AdditionalPropertiesClass', 'model/Animal', 'model/AnimalFarm', 'model/ApiResponse', 'model/ArrayTest', 'model/Cat', 'model/Category', 'model/Dog', 'model/EnumClass', 'model/EnumTest', 'model/FormatTest', 'model/MixedPropertiesAndAdditionalPropertiesClass', 'model/Model200Response', 'model/ModelReturn', 'model/Name', 'model/Order', 'model/Pet', 'model/ReadOnlyFirst', 'model/SpecialModelName', 'model/Tag', 'model/User', 'api/FakeApi', 'api/PetApi', 'api/StoreApi', 'api/UserApi'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('./ApiClient'), require('./model/Animal'), require('./model/AnimalFarm'), require('./model/ApiResponse'), require('./model/Cat'), require('./model/Category'), require('./model/Dog'), require('./model/EnumClass'), require('./model/EnumTest'), require('./model/FormatTest'), require('./model/Model200Response'), require('./model/ModelReturn'), require('./model/Name'), require('./model/Order'), require('./model/Pet'), require('./model/SpecialModelName'), require('./model/Tag'), require('./model/User'), require('./api/FakeApi'), require('./api/PetApi'), require('./api/StoreApi'), require('./api/UserApi')); + module.exports = factory(require('./ApiClient'), require('./model/AdditionalPropertiesClass'), require('./model/Animal'), require('./model/AnimalFarm'), require('./model/ApiResponse'), require('./model/ArrayTest'), require('./model/Cat'), require('./model/Category'), require('./model/Dog'), require('./model/EnumClass'), require('./model/EnumTest'), require('./model/FormatTest'), require('./model/MixedPropertiesAndAdditionalPropertiesClass'), require('./model/Model200Response'), require('./model/ModelReturn'), require('./model/Name'), require('./model/Order'), require('./model/Pet'), require('./model/ReadOnlyFirst'), require('./model/SpecialModelName'), require('./model/Tag'), require('./model/User'), require('./api/FakeApi'), require('./api/PetApi'), require('./api/StoreApi'), require('./api/UserApi')); } -}(function(ApiClient, Animal, AnimalFarm, ApiResponse, Cat, Category, Dog, EnumClass, EnumTest, FormatTest, Model200Response, ModelReturn, Name, Order, Pet, SpecialModelName, Tag, User, FakeApi, PetApi, StoreApi, UserApi) { +}(function(ApiClient, AdditionalPropertiesClass, Animal, AnimalFarm, ApiResponse, ArrayTest, Cat, Category, Dog, EnumClass, EnumTest, FormatTest, MixedPropertiesAndAdditionalPropertiesClass, Model200Response, ModelReturn, Name, Order, Pet, ReadOnlyFirst, SpecialModelName, Tag, User, FakeApi, PetApi, StoreApi, UserApi) { 'use strict'; /** - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose..
+ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ .
* The index module provides access to constructors for all the classes which comprise the public API. *

* An AMD (recommended!) or CommonJS application will generally do something equivalent to the following: @@ -46,6 +46,11 @@ * @property {module:ApiClient} */ ApiClient: ApiClient, + /** + * The AdditionalPropertiesClass model constructor. + * @property {module:model/AdditionalPropertiesClass} + */ + AdditionalPropertiesClass: AdditionalPropertiesClass, /** * The Animal model constructor. * @property {module:model/Animal} @@ -61,6 +66,11 @@ * @property {module:model/ApiResponse} */ ApiResponse: ApiResponse, + /** + * The ArrayTest model constructor. + * @property {module:model/ArrayTest} + */ + ArrayTest: ArrayTest, /** * The Cat model constructor. * @property {module:model/Cat} @@ -91,6 +101,11 @@ * @property {module:model/FormatTest} */ FormatTest: FormatTest, + /** + * The MixedPropertiesAndAdditionalPropertiesClass model constructor. + * @property {module:model/MixedPropertiesAndAdditionalPropertiesClass} + */ + MixedPropertiesAndAdditionalPropertiesClass: MixedPropertiesAndAdditionalPropertiesClass, /** * The Model200Response model constructor. * @property {module:model/Model200Response} @@ -116,6 +131,11 @@ * @property {module:model/Pet} */ Pet: Pet, + /** + * The ReadOnlyFirst model constructor. + * @property {module:model/ReadOnlyFirst} + */ + ReadOnlyFirst: ReadOnlyFirst, /** * The SpecialModelName model constructor. * @property {module:model/SpecialModelName} diff --git a/samples/client/petstore/javascript/src/model/AdditionalPropertiesClass.js b/samples/client/petstore/javascript/src/model/AdditionalPropertiesClass.js new file mode 100644 index 00000000000..8dd4d1c9795 --- /dev/null +++ b/samples/client/petstore/javascript/src/model/AdditionalPropertiesClass.js @@ -0,0 +1,62 @@ +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.SwaggerPetstore) { + root.SwaggerPetstore = {}; + } + root.SwaggerPetstore.AdditionalPropertiesClass = factory(root.SwaggerPetstore.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + + + /** + * The AdditionalPropertiesClass model module. + * @module model/AdditionalPropertiesClass + * @version 1.0.0 + */ + + /** + * Constructs a new AdditionalPropertiesClass. + * @alias module:model/AdditionalPropertiesClass + * @class + * @extends Object + */ + var exports = function() { + var _this = this; + + return _this; + }; + + /** + * Constructs a AdditionalPropertiesClass from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/AdditionalPropertiesClass} obj Optional instance to populate. + * @return {module:model/AdditionalPropertiesClass} The populated AdditionalPropertiesClass instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + ApiClient.constructFromObject(data, obj, String); + + } + return obj; + } + + + + + + return exports; +})); + + diff --git a/samples/client/petstore/javascript/src/model/Animal.js b/samples/client/petstore/javascript/src/model/Animal.js index e42874c669b..28e5904e840 100644 --- a/samples/client/petstore/javascript/src/model/Animal.js +++ b/samples/client/petstore/javascript/src/model/Animal.js @@ -34,6 +34,7 @@ var _this = this; _this['className'] = className; + }; /** @@ -50,6 +51,9 @@ if (data.hasOwnProperty('className')) { obj['className'] = ApiClient.convertToType(data['className'], 'String'); } + if (data.hasOwnProperty('color')) { + obj['color'] = ApiClient.convertToType(data['color'], 'String'); + } } return obj; } @@ -58,6 +62,11 @@ * @member {String} className */ exports.prototype['className'] = undefined; + /** + * @member {String} color + * @default 'red' + */ + exports.prototype['color'] = 'red'; diff --git a/samples/client/petstore/javascript/src/model/ArrayTest.js b/samples/client/petstore/javascript/src/model/ArrayTest.js new file mode 100644 index 00000000000..5a11c6a47bf --- /dev/null +++ b/samples/client/petstore/javascript/src/model/ArrayTest.js @@ -0,0 +1,59 @@ +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.SwaggerPetstore) { + root.SwaggerPetstore = {}; + } + root.SwaggerPetstore.ArrayTest = factory(root.SwaggerPetstore.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + + + /** + * The ArrayTest model module. + * @module model/ArrayTest + * @version 1.0.0 + */ + + /** + * Constructs a new ArrayTest. + * @alias module:model/ArrayTest + * @class + */ + var exports = function() { + var _this = this; + + }; + + /** + * Constructs a ArrayTest from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/ArrayTest} obj Optional instance to populate. + * @return {module:model/ArrayTest} The populated ArrayTest instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + } + return obj; + } + + + + + + return exports; +})); + + diff --git a/samples/client/petstore/javascript/src/model/MixedPropertiesAndAdditionalPropertiesClass.js b/samples/client/petstore/javascript/src/model/MixedPropertiesAndAdditionalPropertiesClass.js new file mode 100644 index 00000000000..1d51ce6c3f8 --- /dev/null +++ b/samples/client/petstore/javascript/src/model/MixedPropertiesAndAdditionalPropertiesClass.js @@ -0,0 +1,78 @@ +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/Animal'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('./Animal')); + } else { + // Browser globals (root is window) + if (!root.SwaggerPetstore) { + root.SwaggerPetstore = {}; + } + root.SwaggerPetstore.MixedPropertiesAndAdditionalPropertiesClass = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.Animal); + } +}(this, function(ApiClient, Animal) { + 'use strict'; + + + + + /** + * The MixedPropertiesAndAdditionalPropertiesClass model module. + * @module model/MixedPropertiesAndAdditionalPropertiesClass + * @version 1.0.0 + */ + + /** + * Constructs a new MixedPropertiesAndAdditionalPropertiesClass. + * @alias module:model/MixedPropertiesAndAdditionalPropertiesClass + * @class + * @extends Object + */ + var exports = function() { + var _this = this; + + + + return _this; + }; + + /** + * Constructs a MixedPropertiesAndAdditionalPropertiesClass from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/MixedPropertiesAndAdditionalPropertiesClass} obj Optional instance to populate. + * @return {module:model/MixedPropertiesAndAdditionalPropertiesClass} The populated MixedPropertiesAndAdditionalPropertiesClass instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + ApiClient.constructFromObject(data, obj, Animal); + + if (data.hasOwnProperty('uuid')) { + obj['uuid'] = ApiClient.convertToType(data['uuid'], 'String'); + } + if (data.hasOwnProperty('dateTime')) { + obj['dateTime'] = ApiClient.convertToType(data['dateTime'], 'Date'); + } + } + return obj; + } + + /** + * @member {String} uuid + */ + exports.prototype['uuid'] = undefined; + /** + * @member {Date} dateTime + */ + exports.prototype['dateTime'] = undefined; + + + + + return exports; +})); + + diff --git a/samples/client/petstore/javascript/src/model/Name.js b/samples/client/petstore/javascript/src/model/Name.js index 93d1d55deb2..f8c24ef770c 100644 --- a/samples/client/petstore/javascript/src/model/Name.js +++ b/samples/client/petstore/javascript/src/model/Name.js @@ -37,6 +37,7 @@ _this['name'] = name; + }; /** @@ -59,6 +60,9 @@ if (data.hasOwnProperty('property')) { obj['property'] = ApiClient.convertToType(data['property'], 'String'); } + if (data.hasOwnProperty('123Number')) { + obj['123Number'] = ApiClient.convertToType(data['123Number'], 'Integer'); + } } return obj; } @@ -75,6 +79,10 @@ * @member {String} property */ exports.prototype['property'] = undefined; + /** + * @member {Integer} 123Number + */ + exports.prototype['123Number'] = undefined; diff --git a/samples/client/petstore/javascript/src/model/ReadOnlyFirst.js b/samples/client/petstore/javascript/src/model/ReadOnlyFirst.js new file mode 100644 index 00000000000..394af906e73 --- /dev/null +++ b/samples/client/petstore/javascript/src/model/ReadOnlyFirst.js @@ -0,0 +1,75 @@ +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.SwaggerPetstore) { + root.SwaggerPetstore = {}; + } + root.SwaggerPetstore.ReadOnlyFirst = factory(root.SwaggerPetstore.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + + + /** + * The ReadOnlyFirst model module. + * @module model/ReadOnlyFirst + * @version 1.0.0 + */ + + /** + * Constructs a new ReadOnlyFirst. + * @alias module:model/ReadOnlyFirst + * @class + */ + var exports = function() { + var _this = this; + + + + }; + + /** + * Constructs a ReadOnlyFirst from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/ReadOnlyFirst} obj Optional instance to populate. + * @return {module:model/ReadOnlyFirst} The populated ReadOnlyFirst instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('bar')) { + obj['bar'] = ApiClient.convertToType(data['bar'], 'String'); + } + if (data.hasOwnProperty('baz')) { + obj['baz'] = ApiClient.convertToType(data['baz'], 'String'); + } + } + return obj; + } + + /** + * @member {String} bar + */ + exports.prototype['bar'] = undefined; + /** + * @member {String} baz + */ + exports.prototype['baz'] = undefined; + + + + + return exports; +})); + + diff --git a/samples/client/petstore/objc/.swagger-codegen-ignore b/samples/client/petstore/objc/.swagger-codegen-ignore new file mode 100644 index 00000000000..19d3377182e --- /dev/null +++ b/samples/client/petstore/objc/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# 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 Swagger Codgen 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 +# Thsi 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/objc/LICENSE b/samples/client/petstore/objc/LICENSE new file mode 100644 index 00000000000..d9a10c0d8e8 --- /dev/null +++ b/samples/client/petstore/objc/LICENSE @@ -0,0 +1,176 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS diff --git a/samples/client/petstore/objc/README.md b/samples/client/petstore/objc/README.md index 32999a5e80b..44bff87c42e 100644 --- a/samples/client/petstore/objc/README.md +++ b/samples/client/petstore/objc/README.md @@ -6,7 +6,7 @@ This ObjC package is automatically generated by the [Swagger Codegen](https://gi - API version: 1.0.0 - Package version: -- Build date: 2016-05-18T23:48:57.670+08:00 +- Build date: 2016-05-27T16:03:28.462+02:00 - Build package: class io.swagger.codegen.languages.ObjcClientCodegen ## Requirements @@ -124,12 +124,6 @@ Class | Method | HTTP request | Description ## Documentation For Authorization -## api_key - -- **Type**: API key -- **API key parameter name**: api_key -- **Location**: HTTP header - ## petstore_auth - **Type**: OAuth @@ -139,6 +133,12 @@ Class | Method | HTTP request | Description - **write:pets**: modify pets in your account - **read:pets**: read your pets +## api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + ## Author diff --git a/samples/client/petstore/objc/SwaggerClient.podspec b/samples/client/petstore/objc/SwaggerClient.podspec index 885b29f7806..eab61d4dc32 100644 --- a/samples/client/petstore/objc/SwaggerClient.podspec +++ b/samples/client/petstore/objc/SwaggerClient.podspec @@ -19,15 +19,16 @@ Pod::Spec.new do |s| s.platform = :ios, '7.0' s.requires_arc = true - s.framework = 'SystemConfiguration' - + s.frameworks = 'SystemConfiguration', 'CoreData' + s.homepage = "https://github.com/swagger-api/swagger-codegen" - s.license = "MIT" + s.license = "Apache License, Version 2.0" s.source = { :git => "https://github.com/swagger-api/swagger-codegen.git", :tag => "#{s.version}" } s.author = { "Swagger" => "apiteam@swagger.io" } - s.source_files = 'SwaggerClient/**/*' + s.source_files = 'SwaggerClient/**/*.{m,h}' s.public_header_files = 'SwaggerClient/**/*.h' + s.resources = 'SwaggerClient/**/*.{xcdatamodeld,xcdatamodel}' s.dependency 'AFNetworking', '~> 3' s.dependency 'JSONModel', '~> 1.2' diff --git a/samples/client/petstore/objc/SwaggerClient/Api/SWGPetApi.h b/samples/client/petstore/objc/SwaggerClient/Api/SWGPetApi.h index be068cdb77e..97f914a627e 100644 --- a/samples/client/petstore/objc/SwaggerClient/Api/SWGPetApi.h +++ b/samples/client/petstore/objc/SwaggerClient/Api/SWGPetApi.h @@ -3,10 +3,28 @@ #import "SWGApi.h" /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen - * Do not edit the class manually. - */ +* Swagger Petstore +* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* OpenAPI spec version: 1.0.0 +* Contact: apiteam@wordnik.com +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ @interface SWGPetApi: NSObject diff --git a/samples/client/petstore/objc/SwaggerClient/Api/SWGPetApi.m b/samples/client/petstore/objc/SwaggerClient/Api/SWGPetApi.m index e35421fc520..409f5b86655 100644 --- a/samples/client/petstore/objc/SwaggerClient/Api/SWGPetApi.m +++ b/samples/client/petstore/objc/SwaggerClient/Api/SWGPetApi.m @@ -376,7 +376,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; // Authentication setting - NSArray *authSettings = @[@"api_key", @"petstore_auth"]; + NSArray *authSettings = @[@"petstore_auth", @"api_key"]; id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; diff --git a/samples/client/petstore/objc/SwaggerClient/Api/SWGStoreApi.h b/samples/client/petstore/objc/SwaggerClient/Api/SWGStoreApi.h index b39dcce9e6b..bbd588dba25 100644 --- a/samples/client/petstore/objc/SwaggerClient/Api/SWGStoreApi.h +++ b/samples/client/petstore/objc/SwaggerClient/Api/SWGStoreApi.h @@ -3,10 +3,28 @@ #import "SWGApi.h" /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen - * Do not edit the class manually. - */ +* Swagger Petstore +* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* OpenAPI spec version: 1.0.0 +* Contact: apiteam@wordnik.com +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ @interface SWGStoreApi: NSObject diff --git a/samples/client/petstore/objc/SwaggerClient/Api/SWGUserApi.h b/samples/client/petstore/objc/SwaggerClient/Api/SWGUserApi.h index c3b375d7133..67f8ec9cbb2 100644 --- a/samples/client/petstore/objc/SwaggerClient/Api/SWGUserApi.h +++ b/samples/client/petstore/objc/SwaggerClient/Api/SWGUserApi.h @@ -3,10 +3,28 @@ #import "SWGApi.h" /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen - * Do not edit the class manually. - */ +* Swagger Petstore +* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* OpenAPI spec version: 1.0.0 +* Contact: apiteam@wordnik.com +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ @interface SWGUserApi: NSObject diff --git a/samples/client/petstore/objc/SwaggerClient/Core/JSONValueTransformer+ISO8601.h b/samples/client/petstore/objc/SwaggerClient/Core/JSONValueTransformer+ISO8601.h index 832f485f4f0..dd8e721b3b9 100644 --- a/samples/client/petstore/objc/SwaggerClient/Core/JSONValueTransformer+ISO8601.h +++ b/samples/client/petstore/objc/SwaggerClient/Core/JSONValueTransformer+ISO8601.h @@ -2,5 +2,30 @@ #import #import +/** +* Swagger Petstore +* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* OpenAPI spec version: 1.0.0 +* Contact: apiteam@wordnik.com +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + @interface JSONValueTransformer (ISO8601) + @end diff --git a/samples/client/petstore/objc/SwaggerClient/Core/SWGApi.h b/samples/client/petstore/objc/SwaggerClient/Core/SWGApi.h index 874f1f48a5d..93b564be3d1 100644 --- a/samples/client/petstore/objc/SwaggerClient/Core/SWGApi.h +++ b/samples/client/petstore/objc/SwaggerClient/Core/SWGApi.h @@ -3,10 +3,28 @@ #import "SWGApiClient.h" /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen - * Do not edit the class manually. - */ +* Swagger Petstore +* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* OpenAPI spec version: 1.0.0 +* Contact: apiteam@wordnik.com +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ @protocol SWGApi diff --git a/samples/client/petstore/objc/SwaggerClient/Core/SWGApiClient.h b/samples/client/petstore/objc/SwaggerClient/Core/SWGApiClient.h index bd35b341eff..a926598ce5f 100644 --- a/samples/client/petstore/objc/SwaggerClient/Core/SWGApiClient.h +++ b/samples/client/petstore/objc/SwaggerClient/Core/SWGApiClient.h @@ -8,11 +8,30 @@ #import "SWGResponseDeserializer.h" #import "SWGSanitizer.h" #import "SWGLogger.h" + /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen - * Do not edit the class manually. - */ +* Swagger Petstore +* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* OpenAPI spec version: 1.0.0 +* Contact: apiteam@wordnik.com +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ #import "SWGCategory.h" #import "SWGOrder.h" diff --git a/samples/client/petstore/objc/SwaggerClient/Core/SWGConfiguration.h b/samples/client/petstore/objc/SwaggerClient/Core/SWGConfiguration.h index 0738a528171..b6c37405ca2 100644 --- a/samples/client/petstore/objc/SwaggerClient/Core/SWGConfiguration.h +++ b/samples/client/petstore/objc/SwaggerClient/Core/SWGConfiguration.h @@ -2,12 +2,29 @@ #import "SWGApiClient.h" #import "SWGLogger.h" -/** The `SWGConfiguration` class manages the configurations for the sdk. - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen - * Do not edit the class manually. - */ +/** +* Swagger Petstore +* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* OpenAPI spec version: 1.0.0 +* Contact: apiteam@wordnik.com +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ @class SWGApiClient; diff --git a/samples/client/petstore/objc/SwaggerClient/Core/SWGConfiguration.m b/samples/client/petstore/objc/SwaggerClient/Core/SWGConfiguration.m index 630c751ce74..cd8d6e7aeef 100644 --- a/samples/client/petstore/objc/SwaggerClient/Core/SWGConfiguration.m +++ b/samples/client/petstore/objc/SwaggerClient/Core/SWGConfiguration.m @@ -109,13 +109,6 @@ - (NSDictionary *) authSettings { return @{ - @"api_key": - @{ - @"type": @"api_key", - @"in": @"header", - @"key": @"api_key", - @"value": [self getApiKeyWithPrefix:@"api_key"] - }, @"petstore_auth": @{ @"type": @"oauth", @@ -123,6 +116,13 @@ @"key": @"Authorization", @"value": [self getAccessToken] }, + @"api_key": + @{ + @"type": @"api_key", + @"in": @"header", + @"key": @"api_key", + @"value": [self getApiKeyWithPrefix:@"api_key"] + }, }; } diff --git a/samples/client/petstore/objc/SwaggerClient/Core/SWGJSONRequestSerializer.h b/samples/client/petstore/objc/SwaggerClient/Core/SWGJSONRequestSerializer.h index 49dd7fca3e2..d9c4d4ad060 100644 --- a/samples/client/petstore/objc/SwaggerClient/Core/SWGJSONRequestSerializer.h +++ b/samples/client/petstore/objc/SwaggerClient/Core/SWGJSONRequestSerializer.h @@ -1,5 +1,29 @@ #import #import +/** +* Swagger Petstore +* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* OpenAPI spec version: 1.0.0 +* Contact: apiteam@wordnik.com +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + @interface SWGJSONRequestSerializer : AFJSONRequestSerializer @end diff --git a/samples/client/petstore/objc/SwaggerClient/Core/SWGJSONResponseSerializer.h b/samples/client/petstore/objc/SwaggerClient/Core/SWGJSONResponseSerializer.h index 16cda122217..20535a6b92e 100644 --- a/samples/client/petstore/objc/SwaggerClient/Core/SWGJSONResponseSerializer.h +++ b/samples/client/petstore/objc/SwaggerClient/Core/SWGJSONResponseSerializer.h @@ -1,6 +1,30 @@ #import #import +/** +* Swagger Petstore +* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* OpenAPI spec version: 1.0.0 +* Contact: apiteam@wordnik.com +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + @interface SWGJSONResponseSerializer : AFJSONResponseSerializer @end diff --git a/samples/client/petstore/objc/SwaggerClient/Core/SWGJSONResponseSerializer.m b/samples/client/petstore/objc/SwaggerClient/Core/SWGJSONResponseSerializer.m index a2dd21bcf5d..73c696d341a 100644 --- a/samples/client/petstore/objc/SwaggerClient/Core/SWGJSONResponseSerializer.m +++ b/samples/client/petstore/objc/SwaggerClient/Core/SWGJSONResponseSerializer.m @@ -1,13 +1,5 @@ #import "SWGJSONResponseSerializer.h" -static BOOL JSONParseError(NSError *error) { - if ([error.domain isEqualToString:NSCocoaErrorDomain] && error.code == 3840) { - return YES; - } - - return NO; -} - @implementation SWGJSONResponseSerializer /// @@ -17,7 +9,7 @@ static BOOL JSONParseError(NSError *error) { /// /// @param response The response to be processed. /// @param data The response data to be decoded. -/// @param error The error that occurred while attempting to decode the respnse data. +/// @param error The error that occurred while attempting to decode the response data. /// /// @return The object decoded from the specified response data. /// @@ -27,7 +19,7 @@ static BOOL JSONParseError(NSError *error) { NSDictionary *responseJson = [super responseObjectForResponse:response data:data error:error]; // if response data is not a valid json, return string of data. - if (JSONParseError(*error)) { + if ([self isParseError:*error]) { *error = nil; NSString *responseString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; return responseString; @@ -36,4 +28,12 @@ static BOOL JSONParseError(NSError *error) { return responseJson; } +-(BOOL)isParseError:(NSError *)error { + return [error.domain isEqualToString:NSCocoaErrorDomain] && error.code == 3840; +} + ++ (instancetype)serializer { + return [self serializerWithReadingOptions:NSJSONReadingAllowFragments]; +} + @end diff --git a/samples/client/petstore/objc/SwaggerClient/Core/SWGLogger.h b/samples/client/petstore/objc/SwaggerClient/Core/SWGLogger.h index 19c1e509dfa..cb4279f182b 100644 --- a/samples/client/petstore/objc/SwaggerClient/Core/SWGLogger.h +++ b/samples/client/petstore/objc/SwaggerClient/Core/SWGLogger.h @@ -1,10 +1,28 @@ #import /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen - * Do not edit the class manually. - */ +* Swagger Petstore +* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* OpenAPI spec version: 1.0.0 +* Contact: apiteam@wordnik.com +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ #ifndef SWGDebugLogResponse #define SWGDebugLogResponse(response, responseObject,request, error) [[SWGLogger sharedLogger] logResponse:response responseObject:responseObject request:request error:error]; diff --git a/samples/client/petstore/objc/SwaggerClient/Core/SWGObject.h b/samples/client/petstore/objc/SwaggerClient/Core/SWGObject.h index fb27b4a4ebb..be57583b8f6 100644 --- a/samples/client/petstore/objc/SwaggerClient/Core/SWGObject.h +++ b/samples/client/petstore/objc/SwaggerClient/Core/SWGObject.h @@ -1,5 +1,30 @@ #import #import +/** +* Swagger Petstore +* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* OpenAPI spec version: 1.0.0 +* Contact: apiteam@wordnik.com +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + @interface SWGObject : JSONModel + @end diff --git a/samples/client/petstore/objc/SwaggerClient/Core/SWGQueryParamCollection.h b/samples/client/petstore/objc/SwaggerClient/Core/SWGQueryParamCollection.h index 3b771881b0f..69a5ab3c133 100644 --- a/samples/client/petstore/objc/SwaggerClient/Core/SWGQueryParamCollection.h +++ b/samples/client/petstore/objc/SwaggerClient/Core/SWGQueryParamCollection.h @@ -1,5 +1,29 @@ #import +/** +* Swagger Petstore +* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* OpenAPI spec version: 1.0.0 +* Contact: apiteam@wordnik.com +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + @interface SWGQueryParamCollection : NSObject @property(nonatomic, readonly) NSArray* values; diff --git a/samples/client/petstore/objc/SwaggerClient/Core/SWGResponseDeserializer.h b/samples/client/petstore/objc/SwaggerClient/Core/SWGResponseDeserializer.h index b20ead44f83..c0d7b716a01 100644 --- a/samples/client/petstore/objc/SwaggerClient/Core/SWGResponseDeserializer.h +++ b/samples/client/petstore/objc/SwaggerClient/Core/SWGResponseDeserializer.h @@ -1,10 +1,28 @@ #import /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen - * Do not edit the class manually. - */ +* Swagger Petstore +* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* OpenAPI spec version: 1.0.0 +* Contact: apiteam@wordnik.com +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ /** * A key for deserialization ErrorDomain diff --git a/samples/client/petstore/objc/SwaggerClient/Core/SWGSanitizer.h b/samples/client/petstore/objc/SwaggerClient/Core/SWGSanitizer.h index aa2c6f85163..59699c2bdd5 100644 --- a/samples/client/petstore/objc/SwaggerClient/Core/SWGSanitizer.h +++ b/samples/client/petstore/objc/SwaggerClient/Core/SWGSanitizer.h @@ -1,10 +1,28 @@ #import /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen - * Do not edit the class manually. - */ +* Swagger Petstore +* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* OpenAPI spec version: 1.0.0 +* Contact: apiteam@wordnik.com +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ extern NSString * SWGPercentEscapedStringFromString(NSString *string); diff --git a/samples/client/petstore/objc/SwaggerClient/Model/SWGCategory.h b/samples/client/petstore/objc/SwaggerClient/Model/SWGCategory.h index 983fd610123..1565724cf8c 100644 --- a/samples/client/petstore/objc/SwaggerClient/Model/SWGCategory.h +++ b/samples/client/petstore/objc/SwaggerClient/Model/SWGCategory.h @@ -2,10 +2,28 @@ #import "SWGObject.h" /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen - * Do not edit the class manually. - */ +* Swagger Petstore +* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* OpenAPI spec version: 1.0.0 +* Contact: apiteam@wordnik.com +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ diff --git a/samples/client/petstore/objc/SwaggerClient/Model/SWGCategory.m b/samples/client/petstore/objc/SwaggerClient/Model/SWGCategory.m index 29e3bc16226..00745d1f499 100644 --- a/samples/client/petstore/objc/SwaggerClient/Model/SWGCategory.m +++ b/samples/client/petstore/objc/SwaggerClient/Model/SWGCategory.m @@ -5,7 +5,7 @@ - (instancetype)init { self = [super init]; if (self) { - // initalise property's default value, if any + // initialize property's default value, if any } return self; @@ -29,7 +29,6 @@ NSArray *optionalProperties = @[@"_id", @"name"]; return [optionalProperties containsObject:propertyName]; - } @end diff --git a/samples/client/petstore/objc/SwaggerClient/Model/SWGCategoryManagedObject.h b/samples/client/petstore/objc/SwaggerClient/Model/SWGCategoryManagedObject.h new file mode 100644 index 00000000000..535c2329b95 --- /dev/null +++ b/samples/client/petstore/objc/SwaggerClient/Model/SWGCategoryManagedObject.h @@ -0,0 +1,28 @@ +#import +#import + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + + + +NS_ASSUME_NONNULL_BEGIN + +@interface SWGCategoryManagedObject : NSManagedObject + + +@property (nullable, nonatomic, retain) NSNumber* _id; + +@property (nullable, nonatomic, retain) NSString* name; + +@end + +@interface SWGCategoryManagedObject (GeneratedAccessors) + + +@end + +NS_ASSUME_NONNULL_END \ No newline at end of file diff --git a/samples/client/petstore/objc/SwaggerClient/Model/SWGCategoryManagedObject.m b/samples/client/petstore/objc/SwaggerClient/Model/SWGCategoryManagedObject.m new file mode 100644 index 00000000000..aa4d5f4b822 --- /dev/null +++ b/samples/client/petstore/objc/SwaggerClient/Model/SWGCategoryManagedObject.m @@ -0,0 +1,13 @@ +#import "SWGCategoryManagedObject.h" + +/** +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen +* Do not edit the class manually. +*/ +@implementation SWGCategoryManagedObject + +@dynamic _id; +@dynamic name; + +@end diff --git a/samples/client/petstore/objc/SwaggerClient/Model/SWGCategoryManagedObjectBuilder.h b/samples/client/petstore/objc/SwaggerClient/Model/SWGCategoryManagedObjectBuilder.h new file mode 100644 index 00000000000..9ee59f63862 --- /dev/null +++ b/samples/client/petstore/objc/SwaggerClient/Model/SWGCategoryManagedObjectBuilder.h @@ -0,0 +1,28 @@ +#import +#import + + +#import "SWGCategoryManagedObject.h" +#import "SWGCategory.h" + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +@interface SWGCategoryManagedObjectBuilder : NSObject + + + +-(SWGCategoryManagedObject*)createNewSWGCategoryManagedObjectInContext:(NSManagedObjectContext*)context; + +-(SWGCategoryManagedObject*)SWGCategoryManagedObjectFromSWGCategory:(SWGCategory*)Category context:(NSManagedObjectContext*)context; + +-(void)updateSWGCategoryManagedObject:(SWGCategoryManagedObject*)Category withSWGCategory:(SWGCategory*)Category2; + +-(SWGCategory*)SWGCategoryFromSWGCategoryManagedObject:(SWGCategoryManagedObject*)obj; + +-(void)updateSWGCategory:(SWGCategory*)Category withSWGCategoryManagedObject:(SWGCategoryManagedObject*)Category2; + +@end diff --git a/samples/client/petstore/objc/SwaggerClient/Model/SWGCategoryManagedObjectBuilder.m b/samples/client/petstore/objc/SwaggerClient/Model/SWGCategoryManagedObjectBuilder.m new file mode 100644 index 00000000000..6c895a4c0d6 --- /dev/null +++ b/samples/client/petstore/objc/SwaggerClient/Model/SWGCategoryManagedObjectBuilder.m @@ -0,0 +1,53 @@ + + +#import "SWGCategoryManagedObjectBuilder.h" + +/** +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen +* Do not edit the class manually. +*/ + +@implementation SWGCategoryManagedObjectBuilder + +-(instancetype)init { + self = [super init]; + if (self != nil) { + } + return self; +} + +-(SWGCategoryManagedObject*)createNewSWGCategoryManagedObjectInContext:(NSManagedObjectContext*)context { + SWGCategoryManagedObject *managedObject = [NSEntityDescription insertNewObjectForEntityForName:NSStringFromClass([SWGCategoryManagedObject class]) inManagedObjectContext:context]; + return managedObject; +} + +-(SWGCategoryManagedObject*)SWGCategoryManagedObjectFromSWGCategory:(SWGCategory*)Category context:(NSManagedObjectContext*)context { + SWGCategoryManagedObject* newSWGCategory = [self createNewSWGCategoryManagedObjectInContext:context]; + [self updateSWGCategoryManagedObject:newSWGCategory withSWGCategory:Category]; + return newSWGCategory; +} + +-(void)updateSWGCategoryManagedObject:(SWGCategoryManagedObject*)managedObject withSWGCategory:(SWGCategory*)object { + if(!managedObject || !object) { + return; + } + managedObject._id = [object._id copy]; + managedObject.name = [object.name copy]; +} + +-(SWGCategory*)SWGCategoryFromSWGCategoryManagedObject:(SWGCategoryManagedObject*)obj { + if(!obj) { + return nil; + } + SWGCategory* newSWGCategory = [[SWGCategory alloc] init]; + [self updateSWGCategory:newSWGCategory withSWGCategoryManagedObject:obj]; + return newSWGCategory; +} + +-(void)updateSWGCategory:(SWGCategory*)newSWGCategory withSWGCategoryManagedObject:(SWGCategoryManagedObject*)obj { + newSWGCategory._id = [obj._id copy]; + newSWGCategory.name = [obj.name copy]; +} + +@end diff --git a/samples/client/petstore/objc/SwaggerClient/Model/SWGModel.xcdatamodeld/.xccurrentversion b/samples/client/petstore/objc/SwaggerClient/Model/SWGModel.xcdatamodeld/.xccurrentversion new file mode 100644 index 00000000000..c38112b62d2 --- /dev/null +++ b/samples/client/petstore/objc/SwaggerClient/Model/SWGModel.xcdatamodeld/.xccurrentversion @@ -0,0 +1,8 @@ + + + + + _XCCurrentVersionName + SWGModel.xcdatamodel + + diff --git a/samples/client/petstore/objc/SwaggerClient/Model/SWGModel.xcdatamodeld/SWGModel.xcdatamodel/contents b/samples/client/petstore/objc/SwaggerClient/Model/SWGModel.xcdatamodeld/SWGModel.xcdatamodel/contents new file mode 100644 index 00000000000..d6c893f1d25 --- /dev/null +++ b/samples/client/petstore/objc/SwaggerClient/Model/SWGModel.xcdatamodeld/SWGModel.xcdatamodel/contents @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/samples/client/petstore/objc/SwaggerClient/Model/SWGOrder.h b/samples/client/petstore/objc/SwaggerClient/Model/SWGOrder.h index 48a7cf0d6c1..5c29f61c0e6 100644 --- a/samples/client/petstore/objc/SwaggerClient/Model/SWGOrder.h +++ b/samples/client/petstore/objc/SwaggerClient/Model/SWGOrder.h @@ -2,10 +2,28 @@ #import "SWGObject.h" /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen - * Do not edit the class manually. - */ +* Swagger Petstore +* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* OpenAPI spec version: 1.0.0 +* Contact: apiteam@wordnik.com +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ diff --git a/samples/client/petstore/objc/SwaggerClient/Model/SWGOrder.m b/samples/client/petstore/objc/SwaggerClient/Model/SWGOrder.m index d10ed802b8d..e0b44e06954 100644 --- a/samples/client/petstore/objc/SwaggerClient/Model/SWGOrder.m +++ b/samples/client/petstore/objc/SwaggerClient/Model/SWGOrder.m @@ -5,7 +5,7 @@ - (instancetype)init { self = [super init]; if (self) { - // initalise property's default value, if any + // initialize property's default value, if any } return self; @@ -29,7 +29,6 @@ NSArray *optionalProperties = @[@"_id", @"petId", @"quantity", @"shipDate", @"status", @"complete"]; return [optionalProperties containsObject:propertyName]; - } @end diff --git a/samples/client/petstore/objc/SwaggerClient/Model/SWGOrderManagedObject.h b/samples/client/petstore/objc/SwaggerClient/Model/SWGOrderManagedObject.h new file mode 100644 index 00000000000..0ec4c858ca0 --- /dev/null +++ b/samples/client/petstore/objc/SwaggerClient/Model/SWGOrderManagedObject.h @@ -0,0 +1,37 @@ +#import +#import + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + + + +NS_ASSUME_NONNULL_BEGIN + +@interface SWGOrderManagedObject : NSManagedObject + + +@property (nullable, nonatomic, retain) NSNumber* _id; + +@property (nullable, nonatomic, retain) NSNumber* petId; + +@property (nullable, nonatomic, retain) NSNumber* quantity; + +@property (nullable, nonatomic, retain) NSDate* shipDate; +/* Order Status [optional] + */ +@property (nullable, nonatomic, retain) NSString* status; + +@property (nullable, nonatomic, retain) NSNumber* complete; + +@end + +@interface SWGOrderManagedObject (GeneratedAccessors) + + +@end + +NS_ASSUME_NONNULL_END \ No newline at end of file diff --git a/samples/client/petstore/objc/SwaggerClient/Model/SWGOrderManagedObject.m b/samples/client/petstore/objc/SwaggerClient/Model/SWGOrderManagedObject.m new file mode 100644 index 00000000000..7a1b9298a95 --- /dev/null +++ b/samples/client/petstore/objc/SwaggerClient/Model/SWGOrderManagedObject.m @@ -0,0 +1,17 @@ +#import "SWGOrderManagedObject.h" + +/** +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen +* Do not edit the class manually. +*/ +@implementation SWGOrderManagedObject + +@dynamic _id; +@dynamic petId; +@dynamic quantity; +@dynamic shipDate; +@dynamic status; +@dynamic complete; + +@end diff --git a/samples/client/petstore/objc/SwaggerClient/Model/SWGOrderManagedObjectBuilder.h b/samples/client/petstore/objc/SwaggerClient/Model/SWGOrderManagedObjectBuilder.h new file mode 100644 index 00000000000..bac7b660157 --- /dev/null +++ b/samples/client/petstore/objc/SwaggerClient/Model/SWGOrderManagedObjectBuilder.h @@ -0,0 +1,28 @@ +#import +#import + + +#import "SWGOrderManagedObject.h" +#import "SWGOrder.h" + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +@interface SWGOrderManagedObjectBuilder : NSObject + + + +-(SWGOrderManagedObject*)createNewSWGOrderManagedObjectInContext:(NSManagedObjectContext*)context; + +-(SWGOrderManagedObject*)SWGOrderManagedObjectFromSWGOrder:(SWGOrder*)Order context:(NSManagedObjectContext*)context; + +-(void)updateSWGOrderManagedObject:(SWGOrderManagedObject*)Order withSWGOrder:(SWGOrder*)Order2; + +-(SWGOrder*)SWGOrderFromSWGOrderManagedObject:(SWGOrderManagedObject*)obj; + +-(void)updateSWGOrder:(SWGOrder*)Order withSWGOrderManagedObject:(SWGOrderManagedObject*)Order2; + +@end diff --git a/samples/client/petstore/objc/SwaggerClient/Model/SWGOrderManagedObjectBuilder.m b/samples/client/petstore/objc/SwaggerClient/Model/SWGOrderManagedObjectBuilder.m new file mode 100644 index 00000000000..ce1c6352b11 --- /dev/null +++ b/samples/client/petstore/objc/SwaggerClient/Model/SWGOrderManagedObjectBuilder.m @@ -0,0 +1,61 @@ + + +#import "SWGOrderManagedObjectBuilder.h" + +/** +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen +* Do not edit the class manually. +*/ + +@implementation SWGOrderManagedObjectBuilder + +-(instancetype)init { + self = [super init]; + if (self != nil) { + } + return self; +} + +-(SWGOrderManagedObject*)createNewSWGOrderManagedObjectInContext:(NSManagedObjectContext*)context { + SWGOrderManagedObject *managedObject = [NSEntityDescription insertNewObjectForEntityForName:NSStringFromClass([SWGOrderManagedObject class]) inManagedObjectContext:context]; + return managedObject; +} + +-(SWGOrderManagedObject*)SWGOrderManagedObjectFromSWGOrder:(SWGOrder*)Order context:(NSManagedObjectContext*)context { + SWGOrderManagedObject* newSWGOrder = [self createNewSWGOrderManagedObjectInContext:context]; + [self updateSWGOrderManagedObject:newSWGOrder withSWGOrder:Order]; + return newSWGOrder; +} + +-(void)updateSWGOrderManagedObject:(SWGOrderManagedObject*)managedObject withSWGOrder:(SWGOrder*)object { + if(!managedObject || !object) { + return; + } + managedObject._id = [object._id copy]; + managedObject.petId = [object.petId copy]; + managedObject.quantity = [object.quantity copy]; + managedObject.shipDate = [object.shipDate copy]; + managedObject.status = [object.status copy]; + managedObject.complete = [object.complete copy]; +} + +-(SWGOrder*)SWGOrderFromSWGOrderManagedObject:(SWGOrderManagedObject*)obj { + if(!obj) { + return nil; + } + SWGOrder* newSWGOrder = [[SWGOrder alloc] init]; + [self updateSWGOrder:newSWGOrder withSWGOrderManagedObject:obj]; + return newSWGOrder; +} + +-(void)updateSWGOrder:(SWGOrder*)newSWGOrder withSWGOrderManagedObject:(SWGOrderManagedObject*)obj { + newSWGOrder._id = [obj._id copy]; + newSWGOrder.petId = [obj.petId copy]; + newSWGOrder.quantity = [obj.quantity copy]; + newSWGOrder.shipDate = [obj.shipDate copy]; + newSWGOrder.status = [obj.status copy]; + newSWGOrder.complete = [obj.complete copy]; +} + +@end diff --git a/samples/client/petstore/objc/SwaggerClient/Model/SWGPet.h b/samples/client/petstore/objc/SwaggerClient/Model/SWGPet.h index 2f83af6c4e1..90de23fbbf5 100644 --- a/samples/client/petstore/objc/SwaggerClient/Model/SWGPet.h +++ b/samples/client/petstore/objc/SwaggerClient/Model/SWGPet.h @@ -2,10 +2,28 @@ #import "SWGObject.h" /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen - * Do not edit the class manually. - */ +* Swagger Petstore +* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* OpenAPI spec version: 1.0.0 +* Contact: apiteam@wordnik.com +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ #import "SWGCategory.h" #import "SWGTag.h" diff --git a/samples/client/petstore/objc/SwaggerClient/Model/SWGPet.m b/samples/client/petstore/objc/SwaggerClient/Model/SWGPet.m index 98e75189ed3..a1c63520dc4 100644 --- a/samples/client/petstore/objc/SwaggerClient/Model/SWGPet.m +++ b/samples/client/petstore/objc/SwaggerClient/Model/SWGPet.m @@ -5,7 +5,7 @@ - (instancetype)init { self = [super init]; if (self) { - // initalise property's default value, if any + // initialize property's default value, if any } return self; @@ -29,7 +29,6 @@ NSArray *optionalProperties = @[@"_id", @"category", @"tags", @"status"]; return [optionalProperties containsObject:propertyName]; - } @end diff --git a/samples/client/petstore/objc/SwaggerClient/Model/SWGPetManagedObject.h b/samples/client/petstore/objc/SwaggerClient/Model/SWGPetManagedObject.h new file mode 100644 index 00000000000..d526d962324 --- /dev/null +++ b/samples/client/petstore/objc/SwaggerClient/Model/SWGPetManagedObject.h @@ -0,0 +1,43 @@ +#import +#import + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +#import "SWGCategoryManagedObject.h" +#import "SWGTagManagedObject.h" + + +NS_ASSUME_NONNULL_BEGIN + +@interface SWGPetManagedObject : NSManagedObject + + +@property (nullable, nonatomic, retain) NSNumber* _id; + +@property (nullable, nonatomic, retain) SWGCategoryManagedObject* category; + +@property (nullable, nonatomic, retain) NSString* name; + +@property (nullable, nonatomic, retain) NSArray* photoUrls; + +@property (nullable, nonatomic, retain) NSSet* tags; +/* pet status in the store [optional] + */ +@property (nullable, nonatomic, retain) NSString* status; + +@end + +@interface SWGPetManagedObject (GeneratedAccessors) + +- (void)addTagsObject:(SWGTagManagedObject *)value; +- (void)removeTagsObject:(SWGTagManagedObject *)value; +- (void)addTags:(NSSet *)values; +- (void)removeTags:(NSSet *)values; + +@end + +NS_ASSUME_NONNULL_END diff --git a/samples/client/petstore/objc/SwaggerClient/Model/SWGPetManagedObject.m b/samples/client/petstore/objc/SwaggerClient/Model/SWGPetManagedObject.m new file mode 100644 index 00000000000..7526628c42b --- /dev/null +++ b/samples/client/petstore/objc/SwaggerClient/Model/SWGPetManagedObject.m @@ -0,0 +1,17 @@ +#import "SWGPetManagedObject.h" + +/** +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen +* Do not edit the class manually. +*/ +@implementation SWGPetManagedObject + +@dynamic _id; +@dynamic category; +@dynamic name; +@dynamic photoUrls; +@dynamic tags; +@dynamic status; + +@end diff --git a/samples/client/petstore/objc/SwaggerClient/Model/SWGPetManagedObjectBuilder.h b/samples/client/petstore/objc/SwaggerClient/Model/SWGPetManagedObjectBuilder.h new file mode 100644 index 00000000000..83877706ff6 --- /dev/null +++ b/samples/client/petstore/objc/SwaggerClient/Model/SWGPetManagedObjectBuilder.h @@ -0,0 +1,32 @@ +#import +#import + +#import "SWGCategoryManagedObjectBuilder.h" +#import "SWGTagManagedObjectBuilder.h" + +#import "SWGPetManagedObject.h" +#import "SWGPet.h" + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +@interface SWGPetManagedObjectBuilder : NSObject + +@property (nonatomic, strong) SWGCategoryManagedObjectBuilder * categoryBuilder; +@property (nonatomic, strong) SWGTagManagedObjectBuilder * tagsBuilder; + + +-(SWGPetManagedObject*)createNewSWGPetManagedObjectInContext:(NSManagedObjectContext*)context; + +-(SWGPetManagedObject*)SWGPetManagedObjectFromSWGPet:(SWGPet*)Pet context:(NSManagedObjectContext*)context; + +-(void)updateSWGPetManagedObject:(SWGPetManagedObject*)Pet withSWGPet:(SWGPet*)Pet2; + +-(SWGPet*)SWGPetFromSWGPetManagedObject:(SWGPetManagedObject*)obj; + +-(void)updateSWGPet:(SWGPet*)Pet withSWGPetManagedObject:(SWGPetManagedObject*)Pet2; + +@end diff --git a/samples/client/petstore/objc/SwaggerClient/Model/SWGPetManagedObjectBuilder.m b/samples/client/petstore/objc/SwaggerClient/Model/SWGPetManagedObjectBuilder.m new file mode 100644 index 00000000000..84a3463ea78 --- /dev/null +++ b/samples/client/petstore/objc/SwaggerClient/Model/SWGPetManagedObjectBuilder.m @@ -0,0 +1,83 @@ + + +#import "SWGPetManagedObjectBuilder.h" + +/** +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen +* Do not edit the class manually. +*/ + +@implementation SWGPetManagedObjectBuilder + +-(instancetype)init { + self = [super init]; + if (self != nil) { + _categoryBuilder = [[SWGCategoryManagedObjectBuilder alloc] init]; + _tagsBuilder = [[SWGTagManagedObjectBuilder alloc] init]; + } + return self; +} + +-(SWGPetManagedObject*)createNewSWGPetManagedObjectInContext:(NSManagedObjectContext*)context { + SWGPetManagedObject *managedObject = [NSEntityDescription insertNewObjectForEntityForName:NSStringFromClass([SWGPetManagedObject class]) inManagedObjectContext:context]; + return managedObject; +} + +-(SWGPetManagedObject*)SWGPetManagedObjectFromSWGPet:(SWGPet*)Pet context:(NSManagedObjectContext*)context { + SWGPetManagedObject* newSWGPet = [self createNewSWGPetManagedObjectInContext:context]; + [self updateSWGPetManagedObject:newSWGPet withSWGPet:Pet]; + return newSWGPet; +} + +-(void)updateSWGPetManagedObject:(SWGPetManagedObject*)managedObject withSWGPet:(SWGPet*)object { + if(!managedObject || !object) { + return; + } + managedObject._id = [object._id copy]; + + if(!managedObject.category) { + managedObject.category = [self.categoryBuilder SWGCategoryManagedObjectFromSWGCategory:object.category context:managedObject.managedObjectContext]; + } else { + [self.categoryBuilder updateSWGCategoryManagedObject:managedObject.category withSWGCategory:object.category]; + } + managedObject.name = [object.name copy]; + managedObject.photoUrls = [object.photoUrls copy]; + if(object.tags) { + NSMutableSet * convertedObjs = [NSMutableSet set]; + for (id innerObject in object.tags) { + id convertedObj = [self.tagsBuilder SWGTagManagedObjectFromSWGTag:innerObject context:managedObject.managedObjectContext]; + [convertedObjs addObject:convertedObj]; + } + managedObject.tags = convertedObjs; + } + managedObject.status = [object.status copy]; +} + +-(SWGPet*)SWGPetFromSWGPetManagedObject:(SWGPetManagedObject*)obj { + if(!obj) { + return nil; + } + SWGPet* newSWGPet = [[SWGPet alloc] init]; + [self updateSWGPet:newSWGPet withSWGPetManagedObject:obj]; + return newSWGPet; +} + +-(void)updateSWGPet:(SWGPet*)newSWGPet withSWGPetManagedObject:(SWGPetManagedObject*)obj { + newSWGPet._id = [obj._id copy]; + newSWGPet.category = [self.categoryBuilder SWGCategoryFromSWGCategoryManagedObject:obj.category]; + newSWGPet.name = [obj.name copy]; + newSWGPet.photoUrls = [obj.photoUrls copy]; + if(obj.tags != nil) { + NSMutableArray* convertedObjs = [NSMutableArray array]; + for (id innerObject in obj.tags) { + id convertedObj = [self.tagsBuilder SWGTagFromSWGTagManagedObject:innerObject]; + [convertedObjs addObject:convertedObj]; + } + newSWGPet.tags = (NSArray*)convertedObjs; + } + + newSWGPet.status = [obj.status copy]; +} + +@end diff --git a/samples/client/petstore/objc/SwaggerClient/Model/SWGTag.h b/samples/client/petstore/objc/SwaggerClient/Model/SWGTag.h index 97e95807550..97aa6162af6 100644 --- a/samples/client/petstore/objc/SwaggerClient/Model/SWGTag.h +++ b/samples/client/petstore/objc/SwaggerClient/Model/SWGTag.h @@ -2,10 +2,28 @@ #import "SWGObject.h" /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen - * Do not edit the class manually. - */ +* Swagger Petstore +* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* OpenAPI spec version: 1.0.0 +* Contact: apiteam@wordnik.com +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ diff --git a/samples/client/petstore/objc/SwaggerClient/Model/SWGTag.m b/samples/client/petstore/objc/SwaggerClient/Model/SWGTag.m index 8ad1742750d..e71829873d1 100644 --- a/samples/client/petstore/objc/SwaggerClient/Model/SWGTag.m +++ b/samples/client/petstore/objc/SwaggerClient/Model/SWGTag.m @@ -5,7 +5,7 @@ - (instancetype)init { self = [super init]; if (self) { - // initalise property's default value, if any + // initialize property's default value, if any } return self; @@ -29,7 +29,6 @@ NSArray *optionalProperties = @[@"_id", @"name"]; return [optionalProperties containsObject:propertyName]; - } @end diff --git a/samples/client/petstore/objc/SwaggerClient/Model/SWGTagManagedObject.h b/samples/client/petstore/objc/SwaggerClient/Model/SWGTagManagedObject.h new file mode 100644 index 00000000000..d5e881e8191 --- /dev/null +++ b/samples/client/petstore/objc/SwaggerClient/Model/SWGTagManagedObject.h @@ -0,0 +1,28 @@ +#import +#import + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + + + +NS_ASSUME_NONNULL_BEGIN + +@interface SWGTagManagedObject : NSManagedObject + + +@property (nullable, nonatomic, retain) NSNumber* _id; + +@property (nullable, nonatomic, retain) NSString* name; + +@end + +@interface SWGTagManagedObject (GeneratedAccessors) + + +@end + +NS_ASSUME_NONNULL_END \ No newline at end of file diff --git a/samples/client/petstore/objc/SwaggerClient/Model/SWGTagManagedObject.m b/samples/client/petstore/objc/SwaggerClient/Model/SWGTagManagedObject.m new file mode 100644 index 00000000000..9f616af1ea8 --- /dev/null +++ b/samples/client/petstore/objc/SwaggerClient/Model/SWGTagManagedObject.m @@ -0,0 +1,13 @@ +#import "SWGTagManagedObject.h" + +/** +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen +* Do not edit the class manually. +*/ +@implementation SWGTagManagedObject + +@dynamic _id; +@dynamic name; + +@end diff --git a/samples/client/petstore/objc/SwaggerClient/Model/SWGTagManagedObjectBuilder.h b/samples/client/petstore/objc/SwaggerClient/Model/SWGTagManagedObjectBuilder.h new file mode 100644 index 00000000000..6895f09262c --- /dev/null +++ b/samples/client/petstore/objc/SwaggerClient/Model/SWGTagManagedObjectBuilder.h @@ -0,0 +1,28 @@ +#import +#import + + +#import "SWGTagManagedObject.h" +#import "SWGTag.h" + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +@interface SWGTagManagedObjectBuilder : NSObject + + + +-(SWGTagManagedObject*)createNewSWGTagManagedObjectInContext:(NSManagedObjectContext*)context; + +-(SWGTagManagedObject*)SWGTagManagedObjectFromSWGTag:(SWGTag*)Tag context:(NSManagedObjectContext*)context; + +-(void)updateSWGTagManagedObject:(SWGTagManagedObject*)Tag withSWGTag:(SWGTag*)Tag2; + +-(SWGTag*)SWGTagFromSWGTagManagedObject:(SWGTagManagedObject*)obj; + +-(void)updateSWGTag:(SWGTag*)Tag withSWGTagManagedObject:(SWGTagManagedObject*)Tag2; + +@end diff --git a/samples/client/petstore/objc/SwaggerClient/Model/SWGTagManagedObjectBuilder.m b/samples/client/petstore/objc/SwaggerClient/Model/SWGTagManagedObjectBuilder.m new file mode 100644 index 00000000000..2e26bfc555c --- /dev/null +++ b/samples/client/petstore/objc/SwaggerClient/Model/SWGTagManagedObjectBuilder.m @@ -0,0 +1,53 @@ + + +#import "SWGTagManagedObjectBuilder.h" + +/** +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen +* Do not edit the class manually. +*/ + +@implementation SWGTagManagedObjectBuilder + +-(instancetype)init { + self = [super init]; + if (self != nil) { + } + return self; +} + +-(SWGTagManagedObject*)createNewSWGTagManagedObjectInContext:(NSManagedObjectContext*)context { + SWGTagManagedObject *managedObject = [NSEntityDescription insertNewObjectForEntityForName:NSStringFromClass([SWGTagManagedObject class]) inManagedObjectContext:context]; + return managedObject; +} + +-(SWGTagManagedObject*)SWGTagManagedObjectFromSWGTag:(SWGTag*)Tag context:(NSManagedObjectContext*)context { + SWGTagManagedObject* newSWGTag = [self createNewSWGTagManagedObjectInContext:context]; + [self updateSWGTagManagedObject:newSWGTag withSWGTag:Tag]; + return newSWGTag; +} + +-(void)updateSWGTagManagedObject:(SWGTagManagedObject*)managedObject withSWGTag:(SWGTag*)object { + if(!managedObject || !object) { + return; + } + managedObject._id = [object._id copy]; + managedObject.name = [object.name copy]; +} + +-(SWGTag*)SWGTagFromSWGTagManagedObject:(SWGTagManagedObject*)obj { + if(!obj) { + return nil; + } + SWGTag* newSWGTag = [[SWGTag alloc] init]; + [self updateSWGTag:newSWGTag withSWGTagManagedObject:obj]; + return newSWGTag; +} + +-(void)updateSWGTag:(SWGTag*)newSWGTag withSWGTagManagedObject:(SWGTagManagedObject*)obj { + newSWGTag._id = [obj._id copy]; + newSWGTag.name = [obj.name copy]; +} + +@end diff --git a/samples/client/petstore/objc/SwaggerClient/Model/SWGUser.h b/samples/client/petstore/objc/SwaggerClient/Model/SWGUser.h index 6ba19e632b8..2c94220a57e 100644 --- a/samples/client/petstore/objc/SwaggerClient/Model/SWGUser.h +++ b/samples/client/petstore/objc/SwaggerClient/Model/SWGUser.h @@ -2,10 +2,28 @@ #import "SWGObject.h" /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen - * Do not edit the class manually. - */ +* Swagger Petstore +* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* OpenAPI spec version: 1.0.0 +* Contact: apiteam@wordnik.com +* +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen.git +* Do not edit the class manually. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ diff --git a/samples/client/petstore/objc/SwaggerClient/Model/SWGUser.m b/samples/client/petstore/objc/SwaggerClient/Model/SWGUser.m index 2551108cb5f..c8195660df6 100644 --- a/samples/client/petstore/objc/SwaggerClient/Model/SWGUser.m +++ b/samples/client/petstore/objc/SwaggerClient/Model/SWGUser.m @@ -5,7 +5,7 @@ - (instancetype)init { self = [super init]; if (self) { - // initalise property's default value, if any + // initialize property's default value, if any } return self; @@ -29,7 +29,6 @@ NSArray *optionalProperties = @[@"_id", @"username", @"firstName", @"lastName", @"email", @"password", @"phone", @"userStatus"]; return [optionalProperties containsObject:propertyName]; - } @end diff --git a/samples/client/petstore/objc/SwaggerClient/Model/SWGUserManagedObject.h b/samples/client/petstore/objc/SwaggerClient/Model/SWGUserManagedObject.h new file mode 100644 index 00000000000..20fd2e336d2 --- /dev/null +++ b/samples/client/petstore/objc/SwaggerClient/Model/SWGUserManagedObject.h @@ -0,0 +1,41 @@ +#import +#import + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + + + +NS_ASSUME_NONNULL_BEGIN + +@interface SWGUserManagedObject : NSManagedObject + + +@property (nullable, nonatomic, retain) NSNumber* _id; + +@property (nullable, nonatomic, retain) NSString* username; + +@property (nullable, nonatomic, retain) NSString* firstName; + +@property (nullable, nonatomic, retain) NSString* lastName; + +@property (nullable, nonatomic, retain) NSString* email; + +@property (nullable, nonatomic, retain) NSString* password; + +@property (nullable, nonatomic, retain) NSString* phone; +/* User Status [optional] + */ +@property (nullable, nonatomic, retain) NSNumber* userStatus; + +@end + +@interface SWGUserManagedObject (GeneratedAccessors) + + +@end + +NS_ASSUME_NONNULL_END \ No newline at end of file diff --git a/samples/client/petstore/objc/SwaggerClient/Model/SWGUserManagedObject.m b/samples/client/petstore/objc/SwaggerClient/Model/SWGUserManagedObject.m new file mode 100644 index 00000000000..f6779715858 --- /dev/null +++ b/samples/client/petstore/objc/SwaggerClient/Model/SWGUserManagedObject.m @@ -0,0 +1,19 @@ +#import "SWGUserManagedObject.h" + +/** +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen +* Do not edit the class manually. +*/ +@implementation SWGUserManagedObject + +@dynamic _id; +@dynamic username; +@dynamic firstName; +@dynamic lastName; +@dynamic email; +@dynamic password; +@dynamic phone; +@dynamic userStatus; + +@end diff --git a/samples/client/petstore/objc/SwaggerClient/Model/SWGUserManagedObjectBuilder.h b/samples/client/petstore/objc/SwaggerClient/Model/SWGUserManagedObjectBuilder.h new file mode 100644 index 00000000000..d62b03d8c87 --- /dev/null +++ b/samples/client/petstore/objc/SwaggerClient/Model/SWGUserManagedObjectBuilder.h @@ -0,0 +1,28 @@ +#import +#import + + +#import "SWGUserManagedObject.h" +#import "SWGUser.h" + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +@interface SWGUserManagedObjectBuilder : NSObject + + + +-(SWGUserManagedObject*)createNewSWGUserManagedObjectInContext:(NSManagedObjectContext*)context; + +-(SWGUserManagedObject*)SWGUserManagedObjectFromSWGUser:(SWGUser*)User context:(NSManagedObjectContext*)context; + +-(void)updateSWGUserManagedObject:(SWGUserManagedObject*)User withSWGUser:(SWGUser*)User2; + +-(SWGUser*)SWGUserFromSWGUserManagedObject:(SWGUserManagedObject*)obj; + +-(void)updateSWGUser:(SWGUser*)User withSWGUserManagedObject:(SWGUserManagedObject*)User2; + +@end diff --git a/samples/client/petstore/objc/SwaggerClient/Model/SWGUserManagedObjectBuilder.m b/samples/client/petstore/objc/SwaggerClient/Model/SWGUserManagedObjectBuilder.m new file mode 100644 index 00000000000..8086e6a20e6 --- /dev/null +++ b/samples/client/petstore/objc/SwaggerClient/Model/SWGUserManagedObjectBuilder.m @@ -0,0 +1,65 @@ + + +#import "SWGUserManagedObjectBuilder.h" + +/** +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen +* Do not edit the class manually. +*/ + +@implementation SWGUserManagedObjectBuilder + +-(instancetype)init { + self = [super init]; + if (self != nil) { + } + return self; +} + +-(SWGUserManagedObject*)createNewSWGUserManagedObjectInContext:(NSManagedObjectContext*)context { + SWGUserManagedObject *managedObject = [NSEntityDescription insertNewObjectForEntityForName:NSStringFromClass([SWGUserManagedObject class]) inManagedObjectContext:context]; + return managedObject; +} + +-(SWGUserManagedObject*)SWGUserManagedObjectFromSWGUser:(SWGUser*)User context:(NSManagedObjectContext*)context { + SWGUserManagedObject* newSWGUser = [self createNewSWGUserManagedObjectInContext:context]; + [self updateSWGUserManagedObject:newSWGUser withSWGUser:User]; + return newSWGUser; +} + +-(void)updateSWGUserManagedObject:(SWGUserManagedObject*)managedObject withSWGUser:(SWGUser*)object { + if(!managedObject || !object) { + return; + } + managedObject._id = [object._id copy]; + managedObject.username = [object.username copy]; + managedObject.firstName = [object.firstName copy]; + managedObject.lastName = [object.lastName copy]; + managedObject.email = [object.email copy]; + managedObject.password = [object.password copy]; + managedObject.phone = [object.phone copy]; + managedObject.userStatus = [object.userStatus copy]; +} + +-(SWGUser*)SWGUserFromSWGUserManagedObject:(SWGUserManagedObject*)obj { + if(!obj) { + return nil; + } + SWGUser* newSWGUser = [[SWGUser alloc] init]; + [self updateSWGUser:newSWGUser withSWGUserManagedObject:obj]; + return newSWGUser; +} + +-(void)updateSWGUser:(SWGUser*)newSWGUser withSWGUserManagedObject:(SWGUserManagedObject*)obj { + newSWGUser._id = [obj._id copy]; + newSWGUser.username = [obj.username copy]; + newSWGUser.firstName = [obj.firstName copy]; + newSWGUser.lastName = [obj.lastName copy]; + newSWGUser.email = [obj.email copy]; + newSWGUser.password = [obj.password copy]; + newSWGUser.phone = [obj.phone copy]; + newSWGUser.userStatus = [obj.userStatus copy]; +} + +@end diff --git a/samples/client/petstore/objc/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj b/samples/client/petstore/objc/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj index f7274144997..1a8aa88ce42 100644 --- a/samples/client/petstore/objc/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj +++ b/samples/client/petstore/objc/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj @@ -21,8 +21,10 @@ 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5B8195388D20070C39A /* InfoPlist.strings */; }; 6003F5BC195388D20070C39A /* Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5BB195388D20070C39A /* Tests.m */; }; 94BE6BE84795B5034A811E61 /* libPods-SwaggerClient_Example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8D46325ECAD48245C07F6733 /* libPods-SwaggerClient_Example.a */; }; + B2ADC0B1C8A60A05C48B4DF7 /* DatabaseHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = B2ADC55130D5E329ED945E8F /* DatabaseHelper.m */; }; B2ADC17C287DCABF329BA8AC /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B2ADC7027D4B025ABCA7999F /* Main.storyboard */; }; B2ADC2D632658A5F73C6CE66 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B2ADC65E342ADA697322D68C /* Images.xcassets */; }; + B2ADC3C7634D15595DD14814 /* BuildersTest.m in Sources */ = {isa = PBXBuildFile; fileRef = B2ADC838FCC22F4BC6C41106 /* BuildersTest.m */; }; B2ADC56977372855A63F4E4D /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B2ADC084A2C0BDF217832B03 /* Launch Screen.storyboard */; }; CF0ADB481B5F95D6008A2729 /* PetTest.m in Sources */ = {isa = PBXBuildFile; fileRef = CF0ADB471B5F95D6008A2729 /* PetTest.m */; }; CF8F71391B5F73AC00162980 /* DeserializationTest.m in Sources */ = {isa = PBXBuildFile; fileRef = CF8F71381B5F73AC00162980 /* DeserializationTest.m */; }; @@ -66,8 +68,11 @@ 73CCD82196AABD64F2807C7B /* Pods-SwaggerClient_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient_Tests/Pods-SwaggerClient_Tests.debug.xcconfig"; sourceTree = ""; }; 8D46325ECAD48245C07F6733 /* libPods-SwaggerClient_Example.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SwaggerClient_Example.a"; sourceTree = BUILT_PRODUCTS_DIR; }; B2ADC084A2C0BDF217832B03 /* Launch Screen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = "Launch Screen.storyboard"; path = "SwaggerClient/Launch Screen.storyboard"; sourceTree = ""; }; + B2ADC2F3483B3117A00FA91C /* DatabaseHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DatabaseHelper.h; sourceTree = ""; }; + B2ADC55130D5E329ED945E8F /* DatabaseHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DatabaseHelper.m; sourceTree = ""; }; B2ADC65E342ADA697322D68C /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = SwaggerClient/Images.xcassets; sourceTree = ""; }; B2ADC7027D4B025ABCA7999F /* Main.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Main.storyboard; path = SwaggerClient/Main.storyboard; sourceTree = ""; }; + B2ADC838FCC22F4BC6C41106 /* BuildersTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BuildersTest.m; sourceTree = ""; }; BFB4BE760737508B3CFC23B2 /* Pods-SwaggerClient_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient_Example/Pods-SwaggerClient_Example.release.xcconfig"; sourceTree = ""; }; CF0ADB471B5F95D6008A2729 /* PetTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PetTest.m; sourceTree = ""; }; CF8F71381B5F73AC00162980 /* DeserializationTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DeserializationTest.m; sourceTree = ""; }; @@ -176,6 +181,8 @@ CFDFB40D1B3CFEC3009739C5 /* UserApiTest.m */, 6003F5BB195388D20070C39A /* Tests.m */, 6003F5B6195388D20070C39A /* Supporting Files */, + B2ADC838FCC22F4BC6C41106 /* BuildersTest.m */, + B2ADCA62DE4AC0F5BAB42208 /* Helpers */, ); path = Tests; sourceTree = ""; @@ -201,6 +208,15 @@ name = "Podspec Metadata"; sourceTree = ""; }; + B2ADCA62DE4AC0F5BAB42208 /* Helpers */ = { + isa = PBXGroup; + children = ( + B2ADC2F3483B3117A00FA91C /* DatabaseHelper.h */, + B2ADC55130D5E329ED945E8F /* DatabaseHelper.m */, + ); + path = Helpers; + sourceTree = ""; + }; CCE77F10C6D41F74B075ECD0 /* Pods */ = { isa = PBXGroup; children = ( @@ -422,6 +438,8 @@ CFDFB4151B3D000B009739C5 /* SWGApiClientTest.m in Sources */, CFDFB4121B3CFFA8009739C5 /* UserApiTest.m in Sources */, CF8F71391B5F73AC00162980 /* DeserializationTest.m in Sources */, + B2ADC3C7634D15595DD14814 /* BuildersTest.m in Sources */, + B2ADC0B1C8A60A05C48B4DF7 /* DatabaseHelper.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/samples/client/petstore/objc/SwaggerClientTests/Tests/BuildersTest.m b/samples/client/petstore/objc/SwaggerClientTests/Tests/BuildersTest.m new file mode 100644 index 00000000000..c822d59d799 --- /dev/null +++ b/samples/client/petstore/objc/SwaggerClientTests/Tests/BuildersTest.m @@ -0,0 +1,117 @@ +// +// BuildersTest.m +// SwaggerClient +// +// Created by mmackowiak on 16.05.2016. +// Copyright (c) 2016 geekerzp. All rights reserved. +// + +#import +#import +#import "SWGPetManagedObject.h" +#import "SWGPetManagedObjectBuilder.h" +#import "DatabaseHelper.h" +#import "SWGUserManagedObject.h" +#import "SWGUserManagedObjectBuilder.h" +#import "SWGOrderManagedObjectBuilder.h" + +@interface BuildersTest : XCTestCase { + SWGPet *pet; + SWGUser* user; + SWGOrder *order; + NSManagedObjectContext *context; +} + +@end + +@implementation BuildersTest + +- (void)setUp { + [super setUp]; + + NSDictionary *petDict = @{ @"id": @1, @"name": @"test pet", + @"status": @"sold", + @"photoUrls": @[@"string"], + @"category": @{ @"id": @1, @"name": @"test category" }, + @"tags": @[ @{ @"id": @1, @"name": @"test tag" }], + }; + NSError * error; + pet = [[SWGPet alloc] initWithDictionary:petDict error:&error]; + XCTAssertNil(error); + + NSDictionary *userDict = @{ + @"id": @1, + @"email": @"test@test.com", + @"firstName": @"firstName", + @"lastName": @"lastName", + @"password": @"password", + @"username": @"username", + @"phone": @"57676767", + }; + error = nil; + user = [[SWGUser alloc] initWithDictionary:userDict error:&error]; + XCTAssertNil(error); + + NSDictionary *orderDict = @{ + @"id": @324, + @"petId": @234, + @"quantity": @12, + @"shipDate": @"1997-07-16T19:20:30+00:00", + @"status": @"status", + @"complete": @1, + }; + error = nil; + order = [[SWGOrder alloc] initWithDictionary:orderDict error:&error]; + XCTAssertNil(error); + + context = [DatabaseHelper createContextWithModelName:@"SWGModel"]; + + +} + +- (void)testSWGPetExample { + SWGPetManagedObjectBuilder* builder = [[SWGPetManagedObjectBuilder alloc] init]; + + SWGPetManagedObject * managedObject = [builder SWGPetManagedObjectFromSWGPet:pet context:context]; + SWGPet *pet2 = [builder SWGPetFromSWGPetManagedObject:managedObject]; + NSError * error; + XCTAssertTrue([context save:&error]); + XCTAssertNil(error); + [context deleteObject:managedObject]; + XCTAssertTrue([context save:&error]); + XCTAssertNil(error); + XCTAssertEqualObjects(pet.description,pet2.description); + +} + + +- (void)testSWGUserExample { + SWGUserManagedObjectBuilder * builder = [[SWGUserManagedObjectBuilder alloc] init]; + SWGUserManagedObject * managedObject = [builder SWGUserManagedObjectFromSWGUser:user context:context]; + SWGUser *user2 = [builder SWGUserFromSWGUserManagedObject:managedObject]; + NSError * error; + XCTAssertTrue([context save:&error]); + XCTAssertNil(error); + [context deleteObject:managedObject]; + XCTAssertTrue([context save:&error]); + XCTAssertNil(error); + XCTAssertEqualObjects(user.description,user2.description); + +} + +- (void)testSWGOrderExample { + SWGOrderManagedObjectBuilder * builder = [[SWGOrderManagedObjectBuilder alloc] init]; + SWGOrderManagedObject * managedObject = [builder SWGOrderManagedObjectFromSWGOrder:order context:context]; + SWGOrder *order2 = [builder SWGOrderFromSWGOrderManagedObject:managedObject]; + NSError * error; + XCTAssertTrue([context save:&error]); + XCTAssertNil(error); + [context deleteObject:managedObject]; + XCTAssertTrue([context save:&error]); + XCTAssertNil(error); + + XCTAssertEqualObjects(order.description,order2.description); + +} + +@end diff --git a/samples/client/petstore/objc/SwaggerClientTests/Tests/Helpers/DatabaseHelper.h b/samples/client/petstore/objc/SwaggerClientTests/Tests/Helpers/DatabaseHelper.h new file mode 100644 index 00000000000..8216e012a32 --- /dev/null +++ b/samples/client/petstore/objc/SwaggerClientTests/Tests/Helpers/DatabaseHelper.h @@ -0,0 +1,14 @@ +#import +#import + +@interface DatabaseHelper : NSObject + ++ (NSManagedObjectContext *)createContextWithModelName:(NSString *)mName; + ++ (void)clearContext:(NSManagedObjectContext *)ctx fromEntitiesWithName:(NSString *)entityName; + ++ (NSManagedObjectModel *)createModelWithModelName:(NSString *)mName; + ++ (NSManagedObjectContext *)createDatabaseWithModel:(NSManagedObjectModel*)model; + +@end diff --git a/samples/client/petstore/objc/SwaggerClientTests/Tests/Helpers/DatabaseHelper.m b/samples/client/petstore/objc/SwaggerClientTests/Tests/Helpers/DatabaseHelper.m new file mode 100644 index 00000000000..3433ac19ddb --- /dev/null +++ b/samples/client/petstore/objc/SwaggerClientTests/Tests/Helpers/DatabaseHelper.m @@ -0,0 +1,42 @@ +#import "DatabaseHelper.h" + +@implementation DatabaseHelper + + ++ (NSManagedObjectContext *)createContextWithModelName:(NSString *)mName { + NSManagedObjectModel *model = [self createModelWithModelName:mName]; + return [self createDatabaseWithModel:model]; +} + ++ (NSManagedObjectContext *)createDatabaseWithModel:(NSManagedObjectModel*)model { + NSPersistentStoreCoordinator *coordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:model]; + [coordinator addPersistentStoreWithType:NSInMemoryStoreType configuration:nil URL:nil options:nil error:nil]; + + NSManagedObjectContext *testingContext = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSMainQueueConcurrencyType]; + [testingContext setPersistentStoreCoordinator:coordinator]; + [testingContext setMergePolicy:NSMergeByPropertyObjectTrumpMergePolicy]; + return testingContext; +} + ++ (NSManagedObjectModel *)createModelWithModelName:(NSString *)mName { + NSBundle *bundle = [NSBundle bundleForClass:[self class]]; + NSString *path = [bundle pathForResource:mName ofType:@"momd"]; + NSAssert(path, @"Missing Model for name: %@",mName); + NSURL *modURL = [NSURL fileURLWithPath:path]; + return [[NSManagedObjectModel alloc] initWithContentsOfURL:modURL]; +} + ++ (void)clearContext:(NSManagedObjectContext *)ctx fromEntitiesWithName:(NSString *)entityName { + NSFetchRequest *fetch = [[NSFetchRequest alloc] init]; + [fetch setEntity:[NSEntityDescription entityForName:entityName inManagedObjectContext:ctx]]; + NSError *error = nil; + NSArray *result = [ctx executeFetchRequest:fetch error:&error]; + if (error) { + NSLog(@"Failed clearing context from entities with name [%@]", error); + } + for (id basket in result) { + [ctx deleteObject:basket]; + } +} + +@end diff --git a/samples/client/petstore/objc/docs/SWGPetApi.md b/samples/client/petstore/objc/docs/SWGPetApi.md index 92fb2c4de81..d702c353855 100644 --- a/samples/client/petstore/objc/docs/SWGPetApi.md +++ b/samples/client/petstore/objc/docs/SWGPetApi.md @@ -246,14 +246,14 @@ Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error cond ```objc SWGConfiguration *apiConfig = [SWGConfiguration sharedConfig]; +// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) +[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; + // Configure API key authorization: (authentication scheme: api_key) [apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"api_key"]; // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed //[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"api_key"]; -// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) -[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; - NSNumber* petId = @789; // ID of pet that needs to be fetched @@ -283,7 +283,7 @@ Name | Type | Description | Notes ### Authorization -[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth) +[petstore_auth](../README.md#petstore_auth), [api_key](../README.md#api_key) ### HTTP request headers diff --git a/samples/client/petstore/php/.swagger-codegen-ignore b/samples/client/petstore/php/.swagger-codegen-ignore new file mode 100644 index 00000000000..19d3377182e --- /dev/null +++ b/samples/client/petstore/php/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# 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 Swagger Codgen 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 +# Thsi 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/SwaggerClient-php/LICENSE b/samples/client/petstore/php/SwaggerClient-php/LICENSE new file mode 100644 index 00000000000..8dada3edaf5 --- /dev/null +++ b/samples/client/petstore/php/SwaggerClient-php/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/samples/client/petstore/php/SwaggerClient-php/README.md b/samples/client/petstore/php/SwaggerClient-php/README.md index 25596bbd7d9..8d69c7da9e4 100644 --- a/samples/client/petstore/php/SwaggerClient-php/README.md +++ b/samples/client/petstore/php/SwaggerClient-php/README.md @@ -1,11 +1,11 @@ # SwaggerClient-php -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This PHP package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - API version: 1.0.0 - Package version: -- Build date: 2016-05-20T17:45:19.363+08:00 +- Build date: 2016-05-25T22:55:19.912+02:00 - Build package: class io.swagger.codegen.languages.PhpClientCodegen ## Requirements @@ -75,7 +75,7 @@ $password = "password_example"; // string | None try { $api_instance->testEndpointParameters($number, $double, $string, $byte, $integer, $int32, $int64, $float, $binary, $date, $date_time, $password); } catch (Exception $e) { - echo 'Exception when calling FakeApi->testEndpointParameters: ', $e->getMessage(), "\n"; + echo 'Exception when calling FakeApi->testEndpointParameters: ', $e->getMessage(), PHP_EOL; } ?> @@ -87,7 +87,7 @@ All URIs are relative to *http://petstore.swagger.io/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*FakeApi* | [**testEndpointParameters**](docs/Api/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeApi* | [**testEndpointParameters**](docs/Api/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *PetApi* | [**addPet**](docs/Api/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store *PetApi* | [**deletePet**](docs/Api/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet *PetApi* | [**findPetsByStatus**](docs/Api/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status @@ -116,6 +116,7 @@ Class | Method | HTTP request | Description - [Animal](docs/Model/Animal.md) - [AnimalFarm](docs/Model/AnimalFarm.md) - [ApiResponse](docs/Model/ApiResponse.md) + - [ArrayTest](docs/Model/ArrayTest.md) - [Cat](docs/Model/Cat.md) - [Category](docs/Model/Category.md) - [Dog](docs/Model/Dog.md) @@ -128,6 +129,7 @@ Class | Method | HTTP request | Description - [Name](docs/Model/Name.md) - [Order](docs/Model/Order.md) - [Pet](docs/Model/Pet.md) + - [ReadOnlyFirst](docs/Model/ReadOnlyFirst.md) - [SpecialModelName](docs/Model/SpecialModelName.md) - [Tag](docs/Model/Tag.md) - [User](docs/Model/User.md) @@ -136,12 +138,6 @@ Class | Method | HTTP request | Description ## Documentation For Authorization -## api_key - -- **Type**: API key -- **API key parameter name**: api_key -- **Location**: HTTP header - ## petstore_auth - **Type**: OAuth @@ -151,6 +147,12 @@ Class | Method | HTTP request | Description - **write:pets**: modify pets in your account - **read:pets**: read your pets +## api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + ## Author diff --git a/samples/client/petstore/php/SwaggerClient-php/autoload.php b/samples/client/petstore/php/SwaggerClient-php/autoload.php index 3cbe3df8a21..de411ee498a 100644 --- a/samples/client/petstore/php/SwaggerClient-php/autoload.php +++ b/samples/client/petstore/php/SwaggerClient-php/autoload.php @@ -1,4 +1,27 @@ testEndpointParameters($number, $double, $string, $byte, $integer, $int32, $int64, $float, $binary, $date, $date_time, $password) -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ### Example ```php @@ -36,7 +36,7 @@ $password = "password_example"; // string | None try { $api_instance->testEndpointParameters($number, $double, $string, $byte, $integer, $int32, $int64, $float, $binary, $date, $date_time, $password); } catch (Exception $e) { - echo 'Exception when calling FakeApi->testEndpointParameters: ', $e->getMessage(), "\n"; + echo 'Exception when calling FakeApi->testEndpointParameters: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -45,18 +45,18 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **number** | **float**| None | - **double** | **double**| None | - **string** | **string**| None | - **byte** | **string**| None | - **integer** | **int**| None | [optional] - **int32** | **int**| None | [optional] - **int64** | **int**| None | [optional] - **float** | **float**| None | [optional] - **binary** | **string**| None | [optional] - **date** | **\DateTime**| None | [optional] - **date_time** | **\DateTime**| None | [optional] - **password** | **string**| None | [optional] + **number** | **float**| None | + **double** | **double**| None | + **string** | **string**| None | + **byte** | **string**| None | + **integer** | **int**| None | [optional] + **int32** | **int**| None | [optional] + **int64** | **int**| None | [optional] + **float** | **float**| None | [optional] + **binary** | **string**| None | [optional] + **date** | **\DateTime**| None | [optional] + **date_time** | **\DateTime**| None | [optional] + **password** | **string**| None | [optional] ### Return type diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/Api/PetApi.md b/samples/client/petstore/php/SwaggerClient-php/docs/Api/PetApi.md index 6ab902730c7..d99eea4c925 100644 --- a/samples/client/petstore/php/SwaggerClient-php/docs/Api/PetApi.md +++ b/samples/client/petstore/php/SwaggerClient-php/docs/Api/PetApi.md @@ -35,7 +35,7 @@ $body = new \Swagger\Client\Model\Pet(); // \Swagger\Client\Model\Pet | Pet obje try { $api_instance->addPet($body); } catch (Exception $e) { - echo 'Exception when calling PetApi->addPet: ', $e->getMessage(), "\n"; + echo 'Exception when calling PetApi->addPet: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -44,7 +44,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**\Swagger\Client\Model\Pet**](../Model/\Swagger\Client\Model\Pet.md)| Pet object that needs to be added to the store | + **body** | [**\Swagger\Client\Model\Pet**](../Model/\Swagger\Client\Model\Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -83,7 +83,7 @@ $api_key = "api_key_example"; // string | try { $api_instance->deletePet($pet_id, $api_key); } catch (Exception $e) { - echo 'Exception when calling PetApi->deletePet: ', $e->getMessage(), "\n"; + echo 'Exception when calling PetApi->deletePet: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -92,8 +92,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet_id** | **int**| Pet id to delete | - **api_key** | **string**| | [optional] + **pet_id** | **int**| Pet id to delete | + **api_key** | **string**| | [optional] ### Return type @@ -132,7 +132,7 @@ try { $result = $api_instance->findPetsByStatus($status); print_r($result); } catch (Exception $e) { - echo 'Exception when calling PetApi->findPetsByStatus: ', $e->getMessage(), "\n"; + echo 'Exception when calling PetApi->findPetsByStatus: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -141,7 +141,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **status** | [**string[]**](../Model/string.md)| Status values that need to be considered for filter | + **status** | [**string[]**](../Model/string.md)| Status values that need to be considered for filter | ### Return type @@ -180,7 +180,7 @@ try { $result = $api_instance->findPetsByTags($tags); print_r($result); } catch (Exception $e) { - echo 'Exception when calling PetApi->findPetsByTags: ', $e->getMessage(), "\n"; + echo 'Exception when calling PetApi->findPetsByTags: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -189,7 +189,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**string[]**](../Model/string.md)| Tags to filter by | + **tags** | [**string[]**](../Model/string.md)| Tags to filter by | ### Return type @@ -230,7 +230,7 @@ try { $result = $api_instance->getPetById($pet_id); print_r($result); } catch (Exception $e) { - echo 'Exception when calling PetApi->getPetById: ', $e->getMessage(), "\n"; + echo 'Exception when calling PetApi->getPetById: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -239,7 +239,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet_id** | **int**| ID of pet to return | + **pet_id** | **int**| ID of pet to return | ### Return type @@ -277,7 +277,7 @@ $body = new \Swagger\Client\Model\Pet(); // \Swagger\Client\Model\Pet | Pet obje try { $api_instance->updatePet($body); } catch (Exception $e) { - echo 'Exception when calling PetApi->updatePet: ', $e->getMessage(), "\n"; + echo 'Exception when calling PetApi->updatePet: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -286,7 +286,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**\Swagger\Client\Model\Pet**](../Model/\Swagger\Client\Model\Pet.md)| Pet object that needs to be added to the store | + **body** | [**\Swagger\Client\Model\Pet**](../Model/\Swagger\Client\Model\Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -326,7 +326,7 @@ $status = "status_example"; // string | Updated status of the pet try { $api_instance->updatePetWithForm($pet_id, $name, $status); } catch (Exception $e) { - echo 'Exception when calling PetApi->updatePetWithForm: ', $e->getMessage(), "\n"; + echo 'Exception when calling PetApi->updatePetWithForm: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -335,9 +335,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet_id** | **int**| ID of pet that needs to be updated | - **name** | **string**| Updated name of the pet | [optional] - **status** | **string**| Updated status of the pet | [optional] + **pet_id** | **int**| ID of pet that needs to be updated | + **name** | **string**| Updated name of the pet | [optional] + **status** | **string**| Updated status of the pet | [optional] ### Return type @@ -378,7 +378,7 @@ try { $result = $api_instance->uploadFile($pet_id, $additional_metadata, $file); print_r($result); } catch (Exception $e) { - echo 'Exception when calling PetApi->uploadFile: ', $e->getMessage(), "\n"; + echo 'Exception when calling PetApi->uploadFile: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -387,9 +387,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet_id** | **int**| ID of pet to update | - **additional_metadata** | **string**| Additional data to pass to server | [optional] - **file** | **\SplFileObject**| file to upload | [optional] + **pet_id** | **int**| ID of pet to update | + **additional_metadata** | **string**| Additional data to pass to server | [optional] + **file** | **\SplFileObject**| file to upload | [optional] ### Return type diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/Api/StoreApi.md b/samples/client/petstore/php/SwaggerClient-php/docs/Api/StoreApi.md index 24cacd22b47..4ec88f083c7 100644 --- a/samples/client/petstore/php/SwaggerClient-php/docs/Api/StoreApi.md +++ b/samples/client/petstore/php/SwaggerClient-php/docs/Api/StoreApi.md @@ -28,7 +28,7 @@ $order_id = "order_id_example"; // string | ID of the order that needs to be del try { $api_instance->deleteOrder($order_id); } catch (Exception $e) { - echo 'Exception when calling StoreApi->deleteOrder: ', $e->getMessage(), "\n"; + echo 'Exception when calling StoreApi->deleteOrder: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -37,7 +37,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **order_id** | **string**| ID of the order that needs to be deleted | + **order_id** | **string**| ID of the order that needs to be deleted | ### Return type @@ -77,7 +77,7 @@ try { $result = $api_instance->getInventory(); print_r($result); } catch (Exception $e) { - echo 'Exception when calling StoreApi->getInventory: ', $e->getMessage(), "\n"; + echo 'Exception when calling StoreApi->getInventory: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -119,7 +119,7 @@ try { $result = $api_instance->getOrderById($order_id); print_r($result); } catch (Exception $e) { - echo 'Exception when calling StoreApi->getOrderById: ', $e->getMessage(), "\n"; + echo 'Exception when calling StoreApi->getOrderById: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -128,7 +128,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **order_id** | **int**| ID of pet that needs to be fetched | + **order_id** | **int**| ID of pet that needs to be fetched | ### Return type @@ -164,7 +164,7 @@ try { $result = $api_instance->placeOrder($body); print_r($result); } catch (Exception $e) { - echo 'Exception when calling StoreApi->placeOrder: ', $e->getMessage(), "\n"; + echo 'Exception when calling StoreApi->placeOrder: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -173,7 +173,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**\Swagger\Client\Model\Order**](../Model/\Swagger\Client\Model\Order.md)| order placed for purchasing the pet | + **body** | [**\Swagger\Client\Model\Order**](../Model/\Swagger\Client\Model\Order.md)| order placed for purchasing the pet | ### Return type diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/Api/UserApi.md b/samples/client/petstore/php/SwaggerClient-php/docs/Api/UserApi.md index 5737f3cdb5e..6296b872220 100644 --- a/samples/client/petstore/php/SwaggerClient-php/docs/Api/UserApi.md +++ b/samples/client/petstore/php/SwaggerClient-php/docs/Api/UserApi.md @@ -32,7 +32,7 @@ $body = new \Swagger\Client\Model\User(); // \Swagger\Client\Model\User | Create try { $api_instance->createUser($body); } catch (Exception $e) { - echo 'Exception when calling UserApi->createUser: ', $e->getMessage(), "\n"; + echo 'Exception when calling UserApi->createUser: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -41,7 +41,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**\Swagger\Client\Model\User**](../Model/\Swagger\Client\Model\User.md)| Created user object | + **body** | [**\Swagger\Client\Model\User**](../Model/\Swagger\Client\Model\User.md)| Created user object | ### Return type @@ -76,7 +76,7 @@ $body = array(new User()); // \Swagger\Client\Model\User[] | List of user object try { $api_instance->createUsersWithArrayInput($body); } catch (Exception $e) { - echo 'Exception when calling UserApi->createUsersWithArrayInput: ', $e->getMessage(), "\n"; + echo 'Exception when calling UserApi->createUsersWithArrayInput: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -85,7 +85,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**\Swagger\Client\Model\User[]**](../Model/User.md)| List of user object | + **body** | [**\Swagger\Client\Model\User[]**](../Model/User.md)| List of user object | ### Return type @@ -120,7 +120,7 @@ $body = array(new User()); // \Swagger\Client\Model\User[] | List of user object try { $api_instance->createUsersWithListInput($body); } catch (Exception $e) { - echo 'Exception when calling UserApi->createUsersWithListInput: ', $e->getMessage(), "\n"; + echo 'Exception when calling UserApi->createUsersWithListInput: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -129,7 +129,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**\Swagger\Client\Model\User[]**](../Model/User.md)| List of user object | + **body** | [**\Swagger\Client\Model\User[]**](../Model/User.md)| List of user object | ### Return type @@ -164,7 +164,7 @@ $username = "username_example"; // string | The name that needs to be deleted try { $api_instance->deleteUser($username); } catch (Exception $e) { - echo 'Exception when calling UserApi->deleteUser: ', $e->getMessage(), "\n"; + echo 'Exception when calling UserApi->deleteUser: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -173,7 +173,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **string**| The name that needs to be deleted | + **username** | **string**| The name that needs to be deleted | ### Return type @@ -203,13 +203,13 @@ Get user by user name require_once(__DIR__ . '/vendor/autoload.php'); $api_instance = new Swagger\Client\Api\UserApi(); -$username = "username_example"; // string | The name that needs to be fetched. Use user1 for testing. +$username = "username_example"; // string | The name that needs to be fetched. Use user1 for testing. try { $result = $api_instance->getUserByName($username); print_r($result); } catch (Exception $e) { - echo 'Exception when calling UserApi->getUserByName: ', $e->getMessage(), "\n"; + echo 'Exception when calling UserApi->getUserByName: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -218,7 +218,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **string**| The name that needs to be fetched. Use user1 for testing. | + **username** | **string**| The name that needs to be fetched. Use user1 for testing. | ### Return type @@ -255,7 +255,7 @@ try { $result = $api_instance->loginUser($username, $password); print_r($result); } catch (Exception $e) { - echo 'Exception when calling UserApi->loginUser: ', $e->getMessage(), "\n"; + echo 'Exception when calling UserApi->loginUser: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -264,8 +264,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **string**| The user name for login | - **password** | **string**| The password for login in clear text | + **username** | **string**| The user name for login | + **password** | **string**| The password for login in clear text | ### Return type @@ -299,7 +299,7 @@ $api_instance = new Swagger\Client\Api\UserApi(); try { $api_instance->logoutUser(); } catch (Exception $e) { - echo 'Exception when calling UserApi->logoutUser: ', $e->getMessage(), "\n"; + echo 'Exception when calling UserApi->logoutUser: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -341,7 +341,7 @@ $body = new \Swagger\Client\Model\User(); // \Swagger\Client\Model\User | Update try { $api_instance->updateUser($username, $body); } catch (Exception $e) { - echo 'Exception when calling UserApi->updateUser: ', $e->getMessage(), "\n"; + echo 'Exception when calling UserApi->updateUser: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -350,8 +350,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **string**| name that need to be deleted | - **body** | [**\Swagger\Client\Model\User**](../Model/\Swagger\Client\Model\User.md)| Updated user object | + **username** | **string**| name that need to be deleted | + **body** | [**\Swagger\Client\Model\User**](../Model/\Swagger\Client\Model\User.md)| Updated user object | ### Return type diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/Model/AdditionalPropertiesClass.md b/samples/client/petstore/php/SwaggerClient-php/docs/Model/AdditionalPropertiesClass.md new file mode 100644 index 00000000000..420ac6efe67 --- /dev/null +++ b/samples/client/petstore/php/SwaggerClient-php/docs/Model/AdditionalPropertiesClass.md @@ -0,0 +1,9 @@ +# AdditionalPropertiesClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/Model/ArrayTest.md b/samples/client/petstore/php/SwaggerClient-php/docs/Model/ArrayTest.md new file mode 100644 index 00000000000..9dcc2c97264 --- /dev/null +++ b/samples/client/petstore/php/SwaggerClient-php/docs/Model/ArrayTest.md @@ -0,0 +1,9 @@ +# ArrayTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/Model/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/php/SwaggerClient-php/docs/Model/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 00000000000..c05cee84500 --- /dev/null +++ b/samples/client/petstore/php/SwaggerClient-php/docs/Model/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,11 @@ +# MixedPropertiesAndAdditionalPropertiesClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uuid** | **string** | | [optional] +**date_time** | [**\DateTime**](\DateTime.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/Model/ReadOnlyFirst.md b/samples/client/petstore/php/SwaggerClient-php/docs/Model/ReadOnlyFirst.md new file mode 100644 index 00000000000..90662a00cf3 --- /dev/null +++ b/samples/client/petstore/php/SwaggerClient-php/docs/Model/ReadOnlyFirst.md @@ -0,0 +1,11 @@ +# ReadOnlyFirst + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **string** | | [optional] +**baz** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php index b8d5c48f552..d68bf418a00 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php @@ -9,20 +9,27 @@ * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 * @link https://github.com/swagger-api/swagger-codegen */ + /** - * Copyright 2016 SmartBear Software + * Swagger Petstore * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ /** @@ -98,7 +105,7 @@ class FakeApi /** * Operation testEndpointParameters * - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 . + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트. * * @param float $number None (required) * @param double $double None (required) @@ -126,7 +133,7 @@ class FakeApi /** * Operation testEndpointParametersWithHttpInfo * - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 . + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트. * * @param float $number None (required) * @param double $double None (required) diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php index 402d727c5bf..9cca7063a53 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php @@ -9,20 +9,27 @@ * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 * @link https://github.com/swagger-api/swagger-codegen */ + /** - * Copyright 2016 SmartBear Software + * Swagger Petstore * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php index cfc6ddba361..d19ddb6f8c5 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php @@ -9,20 +9,27 @@ * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 * @link https://github.com/swagger-api/swagger-codegen */ + /** - * Copyright 2016 SmartBear Software + * Swagger Petstore * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php index 7d3188747a5..d735c083522 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php @@ -9,20 +9,27 @@ * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 * @link https://github.com/swagger-api/swagger-codegen */ + /** - * Copyright 2016 SmartBear Software + * Swagger Petstore * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ /** @@ -435,7 +442,7 @@ class UserApi * * Get user by user name. * - * @param string $username The name that needs to be fetched. Use user1 for testing. (required) + * @param string $username The name that needs to be fetched. Use user1 for testing. (required) * * @return \Swagger\Client\Model\User * @throws \Swagger\Client\ApiException on non-2xx response @@ -452,7 +459,7 @@ class UserApi * * Get user by user name. * - * @param string $username The name that needs to be fetched. Use user1 for testing. (required) + * @param string $username The name that needs to be fetched. Use user1 for testing. (required) * * @return Array of \Swagger\Client\Model\User, HTTP status code, HTTP response headers (array of strings) * @throws \Swagger\Client\ApiException on non-2xx response diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/ApiClient.php b/samples/client/petstore/php/SwaggerClient-php/lib/ApiClient.php index 6370b9be7a5..02fb8729620 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/ApiClient.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/ApiClient.php @@ -10,21 +10,29 @@ * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 * @link https://github.com/swagger-api/swagger-codegen */ + /** - * Copyright 2016 SmartBear Software + * Swagger Petstore * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -211,7 +219,7 @@ class ApiClient // debugging for curl if ($this->config->getDebug()) { - error_log("[DEBUG] HTTP Request body ~BEGIN~\n".print_r($postData, true)."\n~END~\n", 3, $this->config->getDebugFile()); + error_log("[DEBUG] HTTP Request body ~BEGIN~".PHP_EOL.print_r($postData, true).PHP_EOL."~END~".PHP_EOL, 3, $this->config->getDebugFile()); curl_setopt($curl, CURLOPT_VERBOSE, 1); curl_setopt($curl, CURLOPT_STDERR, fopen($this->config->getDebugFile(), 'a')); @@ -231,7 +239,7 @@ class ApiClient // debug HTTP response body if ($this->config->getDebug()) { - error_log("[DEBUG] HTTP Response body ~BEGIN~\n".print_r($http_body, true)."\n~END~\n", 3, $this->config->getDebugFile()); + error_log("[DEBUG] HTTP Response body ~BEGIN~".PHP_EOL.print_r($http_body, true).PHP_EOL."~END~".PHP_EOL, 3, $this->config->getDebugFile()); } // Handle the response diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/ApiException.php b/samples/client/petstore/php/SwaggerClient-php/lib/ApiException.php index 94421bac149..48551429c7f 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/ApiException.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/ApiException.php @@ -9,21 +9,29 @@ * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 * @link https://github.com/swagger-api/swagger-codegen */ + /** - * Copyright 2016 SmartBear Software + * Swagger Petstore * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Configuration.php b/samples/client/petstore/php/SwaggerClient-php/lib/Configuration.php index 33bf0e93651..30b1b6c2dff 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Configuration.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Configuration.php @@ -11,19 +11,25 @@ */ /** - * Copyright 2016 SmartBear Software + * Swagger Petstore * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ /** @@ -513,12 +519,12 @@ class Configuration */ public static function toDebugReport() { - $report = "PHP SDK (Swagger\Client) Debug Report:\n"; - $report .= " OS: ".php_uname()."\n"; - $report .= " PHP Version: ".phpversion()."\n"; - $report .= " OpenAPI Spec Version: 1.0.0\n"; - $report .= " SDK Package Version: \n"; - $report .= " Temp Folder Path: ".self::getDefaultConfiguration()->getTempFolderPath()."\n"; + $report = "PHP SDK (Swagger\Client) Debug Report:".PHP_EOL; + $report .= " OS: ".php_uname().PHP_EOL; + $report .= " PHP Version: ".phpversion().PHP_EOL; + $report .= " OpenAPI Spec Version: 1.0.0".PHP_EOL; + $report .= " SDK Package Version: ".PHP_EOL; + $report .= " Temp Folder Path: ".self::getDefaultConfiguration()->getTempFolderPath().PHP_EOL; return $report; } diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/AdditionalPropertiesClass.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/AdditionalPropertiesClass.php new file mode 100644 index 00000000000..4b5703134c1 --- /dev/null +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/AdditionalPropertiesClass.php @@ -0,0 +1,212 @@ +container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); + } +} diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Animal.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Animal.php index 6b05974a644..33ee60a0b7a 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Animal.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Animal.php @@ -10,21 +10,29 @@ * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 * @link https://github.com/swagger-api/swagger-codegen */ + /** - * Copyright 2016 SmartBear Software + * Swagger Petstore * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/AnimalFarm.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/AnimalFarm.php index a699455bcf9..e9857f27f76 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/AnimalFarm.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/AnimalFarm.php @@ -10,21 +10,29 @@ * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 * @link https://github.com/swagger-api/swagger-codegen */ + /** - * Copyright 2016 SmartBear Software + * Swagger Petstore * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ApiResponse.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ApiResponse.php index 53ced7e8810..fc9c4c2abed 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ApiResponse.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ApiResponse.php @@ -10,21 +10,29 @@ * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 * @link https://github.com/swagger-api/swagger-codegen */ + /** - * Copyright 2016 SmartBear Software + * Swagger Petstore * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayTest.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayTest.php new file mode 100644 index 00000000000..44af1286a6d --- /dev/null +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayTest.php @@ -0,0 +1,212 @@ +container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); + } +} diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Cat.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Cat.php index 9eb4de596d8..efabd53cbbc 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Cat.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Cat.php @@ -10,21 +10,29 @@ * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 * @link https://github.com/swagger-api/swagger-codegen */ + /** - * Copyright 2016 SmartBear Software + * Swagger Petstore * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Category.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Category.php index 8e3c5e6fb5e..d9ff6aa58e2 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Category.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Category.php @@ -10,21 +10,29 @@ * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 * @link https://github.com/swagger-api/swagger-codegen */ + /** - * Copyright 2016 SmartBear Software + * Swagger Petstore * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Dog.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Dog.php index 9212a8c5d3b..081fbd4837d 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Dog.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Dog.php @@ -10,21 +10,29 @@ * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 * @link https://github.com/swagger-api/swagger-codegen */ + /** - * Copyright 2016 SmartBear Software + * Swagger Petstore * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumClass.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumClass.php index 71fb3357d14..4c67a277dde 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumClass.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumClass.php @@ -10,21 +10,29 @@ * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 * @link https://github.com/swagger-api/swagger-codegen */ + /** - * Copyright 2016 SmartBear Software + * Swagger Petstore * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumTest.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumTest.php index 77751f9c43f..673b3ce3624 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumTest.php @@ -10,21 +10,29 @@ * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 * @link https://github.com/swagger-api/swagger-codegen */ + /** - * Copyright 2016 SmartBear Software + * Swagger Petstore * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/FormatTest.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/FormatTest.php index 07148e70189..e9b8bc9cf7f 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/FormatTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/FormatTest.php @@ -10,21 +10,29 @@ * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 * @link https://github.com/swagger-api/swagger-codegen */ + /** - * Copyright 2016 SmartBear Software + * Swagger Petstore * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php new file mode 100644 index 00000000000..fd397440cfc --- /dev/null +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php @@ -0,0 +1,260 @@ + 'string', + 'date_time' => '\DateTime' + ); + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = array( + 'uuid' => 'uuid', + 'date_time' => 'dateTime' + ); + + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = array( + 'uuid' => 'setUuid', + 'date_time' => 'setDateTime' + ); + + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = array( + 'uuid' => 'getUuid', + 'date_time' => 'getDateTime' + ); + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = array(); + + /** + * Constructor + * @param mixed[] $data Associated array of property value initalizing the model + */ + public function __construct(array $data = null) + { + $this->container['uuid'] = isset($data['uuid']) ? $data['uuid'] : null; + $this->container['date_time'] = isset($data['date_time']) ? $data['date_time'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = array(); + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properteis are valid + */ + public function valid() + { + return true; + } + + + /** + * Gets uuid + * @return string + */ + public function getUuid() + { + return $this->container['uuid']; + } + + /** + * Sets uuid + * @param string $uuid + * @return $this + */ + public function setUuid($uuid) + { + $this->container['uuid'] = $uuid; + + return $this; + } + + /** + * Gets date_time + * @return \DateTime + */ + public function getDateTime() + { + return $this->container['date_time']; + } + + /** + * Sets date_time + * @param \DateTime $date_time + * @return $this + */ + public function setDateTime($date_time) + { + $this->container['date_time'] = $date_time; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); + } +} diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Model200Response.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Model200Response.php index 88a28981f29..f6d9a4e2e10 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Model200Response.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Model200Response.php @@ -10,21 +10,29 @@ * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 * @link https://github.com/swagger-api/swagger-codegen */ + /** - * Copyright 2016 SmartBear Software + * Swagger Petstore * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelReturn.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelReturn.php index d1b188ff231..f39fbd0bdef 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelReturn.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelReturn.php @@ -10,21 +10,29 @@ * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 * @link https://github.com/swagger-api/swagger-codegen */ + /** - * Copyright 2016 SmartBear Software + * Swagger Petstore * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Name.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Name.php index 294d45dffe3..32dac8410f2 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Name.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Name.php @@ -10,21 +10,29 @@ * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 * @link https://github.com/swagger-api/swagger-codegen */ + /** - * Copyright 2016 SmartBear Software + * Swagger Petstore * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Order.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Order.php index 3bd377eae71..cf5f61a9640 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Order.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Order.php @@ -10,21 +10,29 @@ * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 * @link https://github.com/swagger-api/swagger-codegen */ + /** - * Copyright 2016 SmartBear Software + * Swagger Petstore * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Pet.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Pet.php index 378c979629c..a81e9eb33f9 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Pet.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Pet.php @@ -10,21 +10,29 @@ * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 * @link https://github.com/swagger-api/swagger-codegen */ + /** - * Copyright 2016 SmartBear Software + * Swagger Petstore * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ReadOnlyFirst.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ReadOnlyFirst.php new file mode 100644 index 00000000000..22e534a51e5 --- /dev/null +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ReadOnlyFirst.php @@ -0,0 +1,260 @@ + 'string', + 'baz' => 'string' + ); + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = array( + 'bar' => 'bar', + 'baz' => 'baz' + ); + + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = array( + 'bar' => 'setBar', + 'baz' => 'setBaz' + ); + + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = array( + 'bar' => 'getBar', + 'baz' => 'getBaz' + ); + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = array(); + + /** + * Constructor + * @param mixed[] $data Associated array of property value initalizing the model + */ + public function __construct(array $data = null) + { + $this->container['bar'] = isset($data['bar']) ? $data['bar'] : null; + $this->container['baz'] = isset($data['baz']) ? $data['baz'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = array(); + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properteis are valid + */ + public function valid() + { + return true; + } + + + /** + * Gets bar + * @return string + */ + public function getBar() + { + return $this->container['bar']; + } + + /** + * Sets bar + * @param string $bar + * @return $this + */ + public function setBar($bar) + { + $this->container['bar'] = $bar; + + return $this; + } + + /** + * Gets baz + * @return string + */ + public function getBaz() + { + return $this->container['baz']; + } + + /** + * Sets baz + * @param string $baz + * @return $this + */ + public function setBaz($baz) + { + $this->container['baz'] = $baz; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); + } +} diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/SpecialModelName.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/SpecialModelName.php index 025ee4b7b3b..e7c97a5ef56 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/SpecialModelName.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/SpecialModelName.php @@ -10,21 +10,29 @@ * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 * @link https://github.com/swagger-api/swagger-codegen */ + /** - * Copyright 2016 SmartBear Software + * Swagger Petstore * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Tag.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Tag.php index 8fba6e43dd8..6a378c7f349 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Tag.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Tag.php @@ -10,21 +10,29 @@ * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 * @link https://github.com/swagger-api/swagger-codegen */ + /** - * Copyright 2016 SmartBear Software + * Swagger Petstore * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/User.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/User.php index 04b4f749437..e61af43c647 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/User.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/User.php @@ -10,21 +10,29 @@ * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 * @link https://github.com/swagger-api/swagger-codegen */ + /** - * Copyright 2016 SmartBear Software + * Swagger Petstore * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php b/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php index 19165ad7bb3..ce77aa6c3b3 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php @@ -10,21 +10,29 @@ * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 * @link https://github.com/swagger-api/swagger-codegen */ + /** - * Copyright 2016 SmartBear Software + * Swagger Petstore * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -256,7 +264,7 @@ class ObjectSerializer } else { return null; } - } elseif (in_array($class, array('integer', 'int', 'void', 'number', 'object', 'double', 'float', 'byte', 'DateTime', 'string', 'mixed', 'boolean', 'bool'))) { + } elseif (in_array($class, array('void', 'bool', 'string', 'double', 'byte', 'mixed', 'integer', 'float', 'int', 'DateTime', 'number', 'boolean', 'object'))) { settype($data, $class); return $data; } elseif ($class === '\SplFileObject') { @@ -271,7 +279,7 @@ class ObjectSerializer $byte_written = $deserialized->fwrite($data); if (Configuration::getDefaultConfiguration()->getDebug()) { - error_log("[DEBUG] Written $byte_written byte to $filename. Please move the file to a proper folder or delete the temp file after processing.\n", 3, Configuration::getDefaultConfiguration()->getDebugFile()); + error_log("[DEBUG] Written $byte_written byte to $filename. Please move the file to a proper folder or delete the temp file after processing.".PHP_EOL, 3, Configuration::getDefaultConfiguration()->getDebugFile()); } return $deserialized; diff --git a/samples/client/petstore/php/SwaggerClient-php/test/Model/AdditionalPropertiesClassTest.php b/samples/client/petstore/php/SwaggerClient-php/test/Model/AdditionalPropertiesClassTest.php new file mode 100644 index 00000000000..d5150f44b8d --- /dev/null +++ b/samples/client/petstore/php/SwaggerClient-php/test/Model/AdditionalPropertiesClassTest.php @@ -0,0 +1,72 @@ + - { - type: 'oauth2', - in: 'header', - key: 'Authorization', - value: "Bearer #{access_token}" - }, 'api_key' => { type: 'api_key', @@ -171,6 +187,13 @@ module Petstore key: 'api_key', value: api_key_with_prefix('api_key') }, + 'petstore_auth' => + { + type: 'oauth2', + in: 'header', + key: 'Authorization', + value: "Bearer #{access_token}" + }, } end end diff --git a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb new file mode 100644 index 00000000000..6426f058398 --- /dev/null +++ b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb @@ -0,0 +1,188 @@ +=begin +Swagger Petstore + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +OpenAPI spec version: 1.0.0 +Contact: apiteam@swagger.io +Generated by: https://github.com/swagger-api/swagger-codegen.git + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +=end + +require 'date' + +module Petstore + + class AdditionalPropertiesClass + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + } + end + + # Attribute type mapping. + def self.swagger_types + { + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properies with the reasons + def list_invalid_properties + invalid_properties = Array.new + return 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? + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /^Array<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /^(true|t|yes|y|1)$/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = Petstore.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map{ |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/samples/client/petstore/ruby/lib/petstore/models/animal.rb b/samples/client/petstore/ruby/lib/petstore/models/animal.rb index 60edb0004a7..a47ea8d19de 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/animal.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/animal.rb @@ -7,21 +7,30 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -License: Apache 2.0 -http://www.apache.org/licenses/LICENSE-2.0.html +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at -Terms of Service: http://swagger.io/terms/ +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. =end require 'date' module Petstore + class Animal attr_accessor :class_name attr_accessor :color + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -68,10 +77,8 @@ module Petstore # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? - if @class_name.nil? - return false - end - + return false if @class_name.nil? + return true end # Checks equality by comparing each attribute. @@ -200,4 +207,5 @@ module Petstore end end + end diff --git a/samples/client/petstore/ruby/lib/petstore/models/animal_farm.rb b/samples/client/petstore/ruby/lib/petstore/models/animal_farm.rb index 3328854e56b..8daae9c91c1 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/animal_farm.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/animal_farm.rb @@ -7,17 +7,26 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -License: Apache 2.0 -http://www.apache.org/licenses/LICENSE-2.0.html +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at -Terms of Service: http://swagger.io/terms/ +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. =end require 'date' module Petstore + class AnimalFarm + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -50,6 +59,7 @@ module Petstore # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + return true end # Checks equality by comparing each attribute. @@ -176,4 +186,5 @@ module Petstore end end + end diff --git a/samples/client/petstore/ruby/lib/petstore/models/api_response.rb b/samples/client/petstore/ruby/lib/petstore/models/api_response.rb index 9bc6c7b7ae7..25ad09ca813 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/api_response.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/api_response.rb @@ -7,16 +7,24 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -License: Apache 2.0 -http://www.apache.org/licenses/LICENSE-2.0.html +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at -Terms of Service: http://swagger.io/terms/ +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. =end require 'date' module Petstore + class ApiResponse attr_accessor :code @@ -24,6 +32,7 @@ module Petstore attr_accessor :message + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -74,6 +83,7 @@ module Petstore # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + return true end # Checks equality by comparing each attribute. @@ -203,4 +213,5 @@ module Petstore end end + end diff --git a/samples/client/petstore/ruby/lib/petstore/models/array_test.rb b/samples/client/petstore/ruby/lib/petstore/models/array_test.rb new file mode 100644 index 00000000000..35d498fc9af --- /dev/null +++ b/samples/client/petstore/ruby/lib/petstore/models/array_test.rb @@ -0,0 +1,188 @@ +=begin +Swagger Petstore + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +OpenAPI spec version: 1.0.0 +Contact: apiteam@swagger.io +Generated by: https://github.com/swagger-api/swagger-codegen.git + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +=end + +require 'date' + +module Petstore + + class ArrayTest + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + } + end + + # Attribute type mapping. + def self.swagger_types + { + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properies with the reasons + def list_invalid_properties + invalid_properties = Array.new + return 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? + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /^Array<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /^(true|t|yes|y|1)$/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = Petstore.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map{ |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/samples/client/petstore/ruby/lib/petstore/models/cat.rb b/samples/client/petstore/ruby/lib/petstore/models/cat.rb index 58f9bca969e..e4ca7f92fc0 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/cat.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/cat.rb @@ -7,16 +7,24 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -License: Apache 2.0 -http://www.apache.org/licenses/LICENSE-2.0.html +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at -Terms of Service: http://swagger.io/terms/ +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. =end require 'date' module Petstore + class Cat attr_accessor :class_name @@ -24,6 +32,7 @@ module Petstore attr_accessor :declawed + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -76,10 +85,8 @@ module Petstore # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? - if @class_name.nil? - return false - end - + return false if @class_name.nil? + return true end # Checks equality by comparing each attribute. @@ -209,4 +216,5 @@ module Petstore end end + end diff --git a/samples/client/petstore/ruby/lib/petstore/models/category.rb b/samples/client/petstore/ruby/lib/petstore/models/category.rb index 0a0679c8e0a..e7c09fcc514 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/category.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/category.rb @@ -7,21 +7,30 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -License: Apache 2.0 -http://www.apache.org/licenses/LICENSE-2.0.html +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at -Terms of Service: http://swagger.io/terms/ +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. =end require 'date' module Petstore + class Category attr_accessor :id attr_accessor :name + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -66,6 +75,7 @@ module Petstore # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + return true end # Checks equality by comparing each attribute. @@ -194,4 +204,5 @@ module Petstore end end + end diff --git a/samples/client/petstore/ruby/lib/petstore/models/dog.rb b/samples/client/petstore/ruby/lib/petstore/models/dog.rb index 78738dfb323..ed335a91429 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/dog.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/dog.rb @@ -7,16 +7,24 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -License: Apache 2.0 -http://www.apache.org/licenses/LICENSE-2.0.html +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at -Terms of Service: http://swagger.io/terms/ +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. =end require 'date' module Petstore + class Dog attr_accessor :class_name @@ -24,6 +32,7 @@ module Petstore attr_accessor :breed + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -76,10 +85,8 @@ module Petstore # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? - if @class_name.nil? - return false - end - + return false if @class_name.nil? + return true end # Checks equality by comparing each attribute. @@ -209,4 +216,5 @@ module Petstore end end + end diff --git a/samples/client/petstore/ruby/lib/petstore/models/enum_class.rb b/samples/client/petstore/ruby/lib/petstore/models/enum_class.rb index 8f9781813e9..b5046df8f31 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/enum_class.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/enum_class.rb @@ -1,16 +1,23 @@ =begin Swagger Petstore -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -License: Apache 2.0 -http://www.apache.org/licenses/LICENSE-2.0.html +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at -Terms of Service: http://swagger.io/terms/ +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. =end @@ -18,9 +25,10 @@ require 'date' module Petstore class EnumClass - - ABC = "_ab\"c".freeze + + ABC = "_abc".freeze EFG = "-efg".freeze - XYZ = "(xy'z)".freeze + XYZ = "(xyz)".freeze end + end diff --git a/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb b/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb index 31a75aebb8b..8f1c4c8bec0 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb @@ -7,16 +7,24 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -License: Apache 2.0 -http://www.apache.org/licenses/LICENSE-2.0.html +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at -Terms of Service: http://swagger.io/terms/ +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. =end require 'date' module Petstore + class EnumTest attr_accessor :enum_string @@ -24,6 +32,28 @@ module Petstore attr_accessor :enum_number + 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 { @@ -74,26 +104,21 @@ module Petstore # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? - allowed_values = ["UPPER", "lower"] - if @enum_string && !allowed_values.include?(@enum_string) - return false - end - allowed_values = ["1", "-1"] - if @enum_integer && !allowed_values.include?(@enum_integer) - return false - end - allowed_values = ["1.1", "-1.2"] - if @enum_number && !allowed_values.include?(@enum_number) - return false - end + enum_string_validator = EnumAttributeValidator.new('String', ["UPPER", "lower"]) + return false unless enum_string_validator.valid?(@enum_string) + enum_integer_validator = EnumAttributeValidator.new('Integer', ["1", "-1"]) + return false unless enum_integer_validator.valid?(@enum_integer) + enum_number_validator = EnumAttributeValidator.new('Float', ["1.1", "-1.2"]) + return false unless enum_number_validator.valid?(@enum_number) + return true end # Custom attribute writer method checking allowed values (enum). # @param [Object] enum_string Object to be assigned def enum_string=(enum_string) - allowed_values = ["UPPER", "lower"] - if enum_string && !allowed_values.include?(enum_string) - fail ArgumentError, "invalid value for 'enum_string', must be one of #{allowed_values}." + validator = EnumAttributeValidator.new('String', ["UPPER", "lower"]) + unless validator.valid?(enum_string) + fail ArgumentError, "invalid value for 'enum_string', must be one of #{validator.allowable_values}." end @enum_string = enum_string end @@ -101,9 +126,9 @@ module Petstore # Custom attribute writer method checking allowed values (enum). # @param [Object] enum_integer Object to be assigned def enum_integer=(enum_integer) - allowed_values = ["1", "-1"] - if enum_integer && !allowed_values.include?(enum_integer) - fail ArgumentError, "invalid value for 'enum_integer', must be one of #{allowed_values}." + validator = EnumAttributeValidator.new('Integer', ["1", "-1"]) + unless validator.valid?(enum_integer) + fail ArgumentError, "invalid value for 'enum_integer', must be one of #{validator.allowable_values}." end @enum_integer = enum_integer end @@ -111,9 +136,9 @@ module Petstore # Custom attribute writer method checking allowed values (enum). # @param [Object] enum_number Object to be assigned def enum_number=(enum_number) - allowed_values = ["1.1", "-1.2"] - if enum_number && !allowed_values.include?(enum_number) - fail ArgumentError, "invalid value for 'enum_number', must be one of #{allowed_values}." + validator = EnumAttributeValidator.new('Float', ["1.1", "-1.2"]) + unless validator.valid?(enum_number) + fail ArgumentError, "invalid value for 'enum_number', must be one of #{validator.allowable_values}." end @enum_number = enum_number end @@ -245,4 +270,5 @@ module Petstore end end + end diff --git a/samples/client/petstore/ruby/lib/petstore/models/format_test.rb b/samples/client/petstore/ruby/lib/petstore/models/format_test.rb index bd6a02d4a73..668dab29fd7 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/format_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/format_test.rb @@ -7,16 +7,24 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -License: Apache 2.0 -http://www.apache.org/licenses/LICENSE-2.0.html +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at -Terms of Service: http://swagger.io/terms/ +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. =end require 'date' module Petstore + class FormatTest attr_accessor :integer @@ -44,6 +52,7 @@ module Petstore attr_accessor :password + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -154,74 +163,24 @@ module Petstore # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? - if @integer > 100.0 - return false - end - - if @integer < 10.0 - return false - end - - if @int32 > 200.0 - return false - end - - if @int32 < 20.0 - return false - end - - if @number.nil? - return false - end - - if @number > 543.2 - return false - end - - if @number < 32.1 - return false - end - - if @float > 987.6 - return false - end - - if @float < 54.3 - return false - end - - if @double > 123.4 - return false - end - - if @double < 67.8 - return false - end - - if @string !~ Regexp.new(/[a-z]/i) - return false - end - - if @byte.nil? - return false - end - - if @date.nil? - return false - end - - if @password.nil? - return false - end - - if @password.to_s.length > 64 - return false - end - - if @password.to_s.length < 10 - return false - end - + return false if @integer > 100.0 + return false if @integer < 10.0 + return false if @int32 > 200.0 + return false if @int32 < 20.0 + return false if @number.nil? + return false if @number > 543.2 + return false if @number < 32.1 + return false if @float > 987.6 + return false if @float < 54.3 + return false if @double > 123.4 + return false if @double < 67.8 + return false if @string !~ Regexp.new(/[a-z]/i) + return false if @byte.nil? + return false if @date.nil? + return false if @password.nil? + return false if @password.to_s.length > 64 + return false if @password.to_s.length < 10 + return true end # Custom attribute writer method with validation @@ -483,4 +442,5 @@ module Petstore end end + end diff --git a/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb b/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb new file mode 100644 index 00000000000..8208fc64638 --- /dev/null +++ b/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb @@ -0,0 +1,206 @@ +=begin +Swagger Petstore + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +OpenAPI spec version: 1.0.0 +Contact: apiteam@swagger.io +Generated by: https://github.com/swagger-api/swagger-codegen.git + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +=end + +require 'date' + +module Petstore + + class MixedPropertiesAndAdditionalPropertiesClass + attr_accessor :uuid + + attr_accessor :date_time + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'uuid' => :'uuid', + :'date_time' => :'dateTime' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'uuid' => :'String', + :'date_time' => :'DateTime' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + + if attributes.has_key?(:'uuid') + self.uuid = attributes[:'uuid'] + end + + if attributes.has_key?(:'dateTime') + self.date_time = attributes[:'dateTime'] + end + + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properies with the reasons + def list_invalid_properties + invalid_properties = Array.new + return 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? + 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 && + uuid == o.uuid && + date_time == o.date_time + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [uuid, date_time].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /^Array<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /^(true|t|yes|y|1)$/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = Petstore.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map{ |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/samples/client/petstore/ruby/lib/petstore/models/model_200_response.rb b/samples/client/petstore/ruby/lib/petstore/models/model_200_response.rb index 15675e5dd22..5e293ef4c61 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/model_200_response.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/model_200_response.rb @@ -7,10 +7,17 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -License: Apache 2.0 -http://www.apache.org/licenses/LICENSE-2.0.html +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at -Terms of Service: http://swagger.io/terms/ +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. =end @@ -21,6 +28,7 @@ module Petstore class Model200Response attr_accessor :name + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -59,6 +67,7 @@ module Petstore # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + return true end # Checks equality by comparing each attribute. @@ -186,4 +195,5 @@ module Petstore end end + end diff --git a/samples/client/petstore/ruby/lib/petstore/models/model_return.rb b/samples/client/petstore/ruby/lib/petstore/models/model_return.rb index 06150419de3..7bda1eea5e6 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/model_return.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/model_return.rb @@ -7,10 +7,17 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -License: Apache 2.0 -http://www.apache.org/licenses/LICENSE-2.0.html +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at -Terms of Service: http://swagger.io/terms/ +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. =end @@ -21,6 +28,7 @@ module Petstore class ModelReturn attr_accessor :_return + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -59,6 +67,7 @@ module Petstore # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + return true end # Checks equality by comparing each attribute. @@ -186,4 +195,5 @@ module Petstore end end + end diff --git a/samples/client/petstore/ruby/lib/petstore/models/name.rb b/samples/client/petstore/ruby/lib/petstore/models/name.rb index 01d3910b948..94247c1ed2f 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/name.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/name.rb @@ -7,10 +7,17 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -License: Apache 2.0 -http://www.apache.org/licenses/LICENSE-2.0.html +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at -Terms of Service: http://swagger.io/terms/ +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. =end @@ -27,6 +34,7 @@ module Petstore attr_accessor :_123_number + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -83,10 +91,8 @@ module Petstore # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? - if @name.nil? - return false - end - + return false if @name.nil? + return true end # Checks equality by comparing each attribute. @@ -217,4 +223,5 @@ module Petstore end end + end diff --git a/samples/client/petstore/ruby/lib/petstore/models/order.rb b/samples/client/petstore/ruby/lib/petstore/models/order.rb index 4aefb422eb6..87931c88d1d 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/order.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/order.rb @@ -7,16 +7,24 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -License: Apache 2.0 -http://www.apache.org/licenses/LICENSE-2.0.html +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at -Terms of Service: http://swagger.io/terms/ +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. =end require 'date' module Petstore + class Order attr_accessor :id @@ -31,6 +39,28 @@ module Petstore attr_accessor :complete + 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 { @@ -101,18 +131,17 @@ module Petstore # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? - allowed_values = ["placed", "approved", "delivered"] - if @status && !allowed_values.include?(@status) - return false - end + status_validator = EnumAttributeValidator.new('String', ["placed", "approved", "delivered"]) + return false unless status_validator.valid?(@status) + return true end # Custom attribute writer method checking allowed values (enum). # @param [Object] status Object to be assigned def status=(status) - allowed_values = ["placed", "approved", "delivered"] - if status && !allowed_values.include?(status) - fail ArgumentError, "invalid value for 'status', must be one of #{allowed_values}." + validator = EnumAttributeValidator.new('String', ["placed", "approved", "delivered"]) + unless validator.valid?(status) + fail ArgumentError, "invalid value for 'status', must be one of #{validator.allowable_values}." end @status = status end @@ -247,4 +276,5 @@ module Petstore end end + end diff --git a/samples/client/petstore/ruby/lib/petstore/models/pet.rb b/samples/client/petstore/ruby/lib/petstore/models/pet.rb index b2432b09e5e..f499ba759db 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/pet.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/pet.rb @@ -7,16 +7,24 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -License: Apache 2.0 -http://www.apache.org/licenses/LICENSE-2.0.html +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at -Terms of Service: http://swagger.io/terms/ +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. =end require 'date' module Petstore + class Pet attr_accessor :id @@ -31,6 +39,28 @@ module Petstore # pet status in the store attr_accessor :status + 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 { @@ -103,26 +133,19 @@ module Petstore # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? - if @name.nil? - return false - end - - if @photo_urls.nil? - return false - end - - allowed_values = ["available", "pending", "sold"] - if @status && !allowed_values.include?(@status) - return false - end + return false if @name.nil? + return false if @photo_urls.nil? + status_validator = EnumAttributeValidator.new('String', ["available", "pending", "sold"]) + return false unless status_validator.valid?(@status) + return true end # Custom attribute writer method checking allowed values (enum). # @param [Object] status Object to be assigned def status=(status) - allowed_values = ["available", "pending", "sold"] - if status && !allowed_values.include?(status) - fail ArgumentError, "invalid value for 'status', must be one of #{allowed_values}." + validator = EnumAttributeValidator.new('String', ["available", "pending", "sold"]) + unless validator.valid?(status) + fail ArgumentError, "invalid value for 'status', must be one of #{validator.allowable_values}." end @status = status end @@ -257,4 +280,5 @@ module Petstore end end + end diff --git a/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb b/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb new file mode 100644 index 00000000000..4f8b79f225e --- /dev/null +++ b/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb @@ -0,0 +1,206 @@ +=begin +Swagger Petstore + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +OpenAPI spec version: 1.0.0 +Contact: apiteam@swagger.io +Generated by: https://github.com/swagger-api/swagger-codegen.git + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +=end + +require 'date' + +module Petstore + + class ReadOnlyFirst + attr_accessor :bar + + attr_accessor :baz + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'bar' => :'bar', + :'baz' => :'baz' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'bar' => :'String', + :'baz' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + + if attributes.has_key?(:'bar') + self.bar = attributes[:'bar'] + end + + if attributes.has_key?(:'baz') + self.baz = attributes[:'baz'] + end + + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properies with the reasons + def list_invalid_properties + invalid_properties = Array.new + return 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? + 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 && + bar == o.bar && + baz == o.baz + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [bar, baz].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /^Array<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /^(true|t|yes|y|1)$/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = Petstore.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map{ |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb b/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb index caf84588f22..8726b4bb23f 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb @@ -7,19 +7,28 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -License: Apache 2.0 -http://www.apache.org/licenses/LICENSE-2.0.html +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at -Terms of Service: http://swagger.io/terms/ +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. =end require 'date' module Petstore + class SpecialModelName attr_accessor :special_property_name + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -58,6 +67,7 @@ module Petstore # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + return true end # Checks equality by comparing each attribute. @@ -185,4 +195,5 @@ module Petstore end end + end diff --git a/samples/client/petstore/ruby/lib/petstore/models/tag.rb b/samples/client/petstore/ruby/lib/petstore/models/tag.rb index b47fc2f86e9..72583dfb24c 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/tag.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/tag.rb @@ -7,21 +7,30 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -License: Apache 2.0 -http://www.apache.org/licenses/LICENSE-2.0.html +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at -Terms of Service: http://swagger.io/terms/ +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. =end require 'date' module Petstore + class Tag attr_accessor :id attr_accessor :name + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -66,6 +75,7 @@ module Petstore # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + return true end # Checks equality by comparing each attribute. @@ -194,4 +204,5 @@ module Petstore end end + end diff --git a/samples/client/petstore/ruby/lib/petstore/models/user.rb b/samples/client/petstore/ruby/lib/petstore/models/user.rb index da720b1f559..d92a6dfdf13 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/user.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/user.rb @@ -7,16 +7,24 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -License: Apache 2.0 -http://www.apache.org/licenses/LICENSE-2.0.html +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at -Terms of Service: http://swagger.io/terms/ +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. =end require 'date' module Petstore + class User attr_accessor :id @@ -35,6 +43,7 @@ module Petstore # User Status attr_accessor :user_status + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -115,6 +124,7 @@ module Petstore # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + return true end # Checks equality by comparing each attribute. @@ -249,4 +259,5 @@ module Petstore end end + end diff --git a/samples/client/petstore/ruby/lib/petstore/version.rb b/samples/client/petstore/ruby/lib/petstore/version.rb index e5c868d3d09..58d992d9c27 100644 --- a/samples/client/petstore/ruby/lib/petstore/version.rb +++ b/samples/client/petstore/ruby/lib/petstore/version.rb @@ -7,10 +7,17 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -License: Apache 2.0 -http://www.apache.org/licenses/LICENSE-2.0.html +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at -Terms of Service: http://swagger.io/terms/ +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. =end diff --git a/samples/client/petstore/ruby/petstore.gemspec b/samples/client/petstore/ruby/petstore.gemspec index 66258d1ff5c..f52a27ba00f 100644 --- a/samples/client/petstore/ruby/petstore.gemspec +++ b/samples/client/petstore/ruby/petstore.gemspec @@ -1,4 +1,28 @@ # -*- encoding: utf-8 -*- +# +=begin +Swagger Petstore + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +OpenAPI spec version: 1.0.0 +Contact: apiteam@swagger.io +Generated by: https://github.com/swagger-api/swagger-codegen.git + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +=end + $:.push File.expand_path("../lib", __FILE__) require "petstore/version" diff --git a/samples/client/petstore/ruby/spec/.spec_helper.rb b/samples/client/petstore/ruby/spec/.spec_helper.rb new file mode 100644 index 00000000000..50702c439b7 --- /dev/null +++ b/samples/client/petstore/ruby/spec/.spec_helper.rb @@ -0,0 +1,71 @@ +require 'rubygems' +require 'bundler/setup' +require 'petstore' +require 'vcr' +require 'typhoeus' +require 'json' +require 'yaml' +require 'rspec' + +RSpec.configure do |config| + # some (optional) config here + config.expect_with :rspec do |c| + c.syntax = :should + end + config.mock_with :rspec do |c| + c.syntax = :should + end +end + + +WebMock.allow_net_connect! if defined? WebMock + +def help + puts "\nOh noes! You gotta stuff your swagger credentials in ~/.swagger.yml like so:\n\n" + puts "api_key: '12345abcdefg'" + puts "username: 'fumanchu'" + puts "password: 'kalamazoo'\n\n" + exit +end + +# no longer reading credentials (not used) from file (20150413) +# Parse ~/.swagger.yml for user credentials +#begin +# CREDENTIALS = YAML::load_file(File.join(ENV['HOME'], ".swagger.yml")).symbolize_keys +#rescue +# help +#end + +API_CLIENT = Petstore::ApiClient.new(Petstore::Configuration.new) + +def random_id + rand(1000000) + 20000 +end + +# create a random pet, return its id +def prepare_pet(pet_api) + pet_id = random_id + category = Petstore::Category.new('id' => 20002, 'name' => 'category test') + tag = Petstore::Tag.new('id' => 30002, 'name' => 'tag test') + pet = Petstore::Pet.new('id' => pet_id, 'name' => "RUBY UNIT TESTING", 'photo_urls' => 'photo url', + 'category' => category, 'tags' => [tag], 'status' => 'pending') + pet_api.add_pet(pet) + return pet_id +end + +# create a random order, return its id +def prepare_store(store_api) + order_id = 5 + order = Petstore::Order.new("id" => order_id, + "petId" => 123, + "quantity" => 789, + "shipDate" => "2015-04-06T23:42:01.678Z", + "status" => "placed", + "complete" => false) + store_api.place_order(order) + return order_id +end + +# A random string to tack onto stuff to ensure we're not seeing +# data from a previous test run +RAND = ("a".."z").to_a.sample(8).join diff --git a/samples/client/petstore/ruby/spec/models/additional_properties_class_spec.rb b/samples/client/petstore/ruby/spec/models/additional_properties_class_spec.rb new file mode 100644 index 00000000000..edf0371b127 --- /dev/null +++ b/samples/client/petstore/ruby/spec/models/additional_properties_class_spec.rb @@ -0,0 +1,40 @@ +=begin +Swagger Petstore + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +OpenAPI spec version: 1.0.0 +Contact: apiteam@swagger.io +Generated by: https://github.com/swagger-api/swagger-codegen.git + +License: Apache 2.0 +http://www.apache.org/licenses/LICENSE-2.0.html + +Terms of Service: http://swagger.io/terms/ + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::AdditionalPropertiesClass +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'AdditionalPropertiesClass' do + before do + # run before each test + @instance = Petstore::AdditionalPropertiesClass.new + end + + after do + # run after each test + end + + describe 'test an instance of AdditionalPropertiesClass' do + it 'should create an instact of AdditionalPropertiesClass' do + expect(@instance).to be_instance_of(Petstore::AdditionalPropertiesClass) + end + end +end + diff --git a/samples/client/petstore/ruby/spec/models/animal_farm_spec.rb b/samples/client/petstore/ruby/spec/models/animal_farm_spec.rb index 016b86fd8af..1535c7cb4ec 100644 --- a/samples/client/petstore/ruby/spec/models/animal_farm_spec.rb +++ b/samples/client/petstore/ruby/spec/models/animal_farm_spec.rb @@ -1,7 +1,7 @@ =begin Swagger Petstore -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io diff --git a/samples/client/petstore/ruby/spec/models/animal_spec.rb b/samples/client/petstore/ruby/spec/models/animal_spec.rb index 3f98b0f7b84..5c4f8dc0e69 100644 --- a/samples/client/petstore/ruby/spec/models/animal_spec.rb +++ b/samples/client/petstore/ruby/spec/models/animal_spec.rb @@ -1,7 +1,7 @@ =begin Swagger Petstore -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io @@ -42,5 +42,11 @@ describe 'Animal' do end end + describe 'test attribute "color"' 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/api_response_spec.rb b/samples/client/petstore/ruby/spec/models/api_response_spec.rb index 67b0cbe1a03..18ab87bf551 100644 --- a/samples/client/petstore/ruby/spec/models/api_response_spec.rb +++ b/samples/client/petstore/ruby/spec/models/api_response_spec.rb @@ -1,7 +1,7 @@ =begin Swagger Petstore -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io diff --git a/samples/client/petstore/ruby/spec/models/array_test_spec.rb b/samples/client/petstore/ruby/spec/models/array_test_spec.rb new file mode 100644 index 00000000000..b0b84f6a4f6 --- /dev/null +++ b/samples/client/petstore/ruby/spec/models/array_test_spec.rb @@ -0,0 +1,47 @@ +=begin +Swagger Petstore + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +OpenAPI spec version: 1.0.0 +Contact: apiteam@swagger.io +Generated by: https://github.com/swagger-api/swagger-codegen.git + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::ArrayTest +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'ArrayTest' do + before do + # run before each test + @instance = Petstore::ArrayTest.new + end + + after do + # run after each test + end + + describe 'test an instance of ArrayTest' do + it 'should create an instact of ArrayTest' do + expect(@instance).to be_instance_of(Petstore::ArrayTest) + end + end +end + diff --git a/samples/client/petstore/ruby/spec/models/cat_spec.rb b/samples/client/petstore/ruby/spec/models/cat_spec.rb index 97ae668ea3b..86d600213b3 100644 --- a/samples/client/petstore/ruby/spec/models/cat_spec.rb +++ b/samples/client/petstore/ruby/spec/models/cat_spec.rb @@ -1,7 +1,7 @@ =begin Swagger Petstore -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io @@ -42,6 +42,12 @@ describe 'Cat' do end end + describe 'test attribute "color"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + describe 'test attribute "declawed"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers diff --git a/samples/client/petstore/ruby/spec/models/category_spec.rb b/samples/client/petstore/ruby/spec/models/category_spec.rb index 1481358afdc..021de250efc 100644 --- a/samples/client/petstore/ruby/spec/models/category_spec.rb +++ b/samples/client/petstore/ruby/spec/models/category_spec.rb @@ -1,7 +1,7 @@ =begin Swagger Petstore -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io diff --git a/samples/client/petstore/ruby/spec/models/dog_spec.rb b/samples/client/petstore/ruby/spec/models/dog_spec.rb index e3eb4be12fc..10a5b831f25 100644 --- a/samples/client/petstore/ruby/spec/models/dog_spec.rb +++ b/samples/client/petstore/ruby/spec/models/dog_spec.rb @@ -1,7 +1,7 @@ =begin Swagger Petstore -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io @@ -42,6 +42,12 @@ describe 'Dog' do end end + describe 'test attribute "color"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + describe 'test attribute "breed"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers diff --git a/samples/client/petstore/ruby/spec/models/enum_class_spec.rb b/samples/client/petstore/ruby/spec/models/enum_class_spec.rb index b8610d74a1b..02fe0a113fe 100644 --- a/samples/client/petstore/ruby/spec/models/enum_class_spec.rb +++ b/samples/client/petstore/ruby/spec/models/enum_class_spec.rb @@ -1,7 +1,7 @@ =begin Swagger Petstore -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io diff --git a/samples/client/petstore/ruby/spec/models/enum_test_spec.rb b/samples/client/petstore/ruby/spec/models/enum_test_spec.rb index 91941d8a50d..f85c15564f1 100644 --- a/samples/client/petstore/ruby/spec/models/enum_test_spec.rb +++ b/samples/client/petstore/ruby/spec/models/enum_test_spec.rb @@ -1,7 +1,7 @@ =begin Swagger Petstore -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io @@ -38,19 +38,28 @@ describe 'EnumTest' do end describe 'test attribute "enum_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', ["UPPER", "lower"]) + validator.allowable_values.each do |value| + expect { @instance.enum_string = value }.not_to raise_error + end end end describe 'test attribute "enum_integer"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + validator = Petstore::EnumTest::EnumAttributeValidator.new('Integer', ["1", "-1"]) + validator.allowable_values.each do |value| + expect { @instance.enum_integer = value }.not_to raise_error + end end end describe 'test attribute "enum_number"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + validator = Petstore::EnumTest::EnumAttributeValidator.new('Float', ["1.1", "-1.2"]) + validator.allowable_values.each do |value| + expect { @instance.enum_number = value }.not_to raise_error + end end end diff --git a/samples/client/petstore/ruby/spec/models/format_test_spec.rb b/samples/client/petstore/ruby/spec/models/format_test_spec.rb index e7a81fe537c..fd6cf6c0381 100644 --- a/samples/client/petstore/ruby/spec/models/format_test_spec.rb +++ b/samples/client/petstore/ruby/spec/models/format_test_spec.rb @@ -1,7 +1,7 @@ =begin Swagger Petstore -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io diff --git a/samples/client/petstore/ruby/spec/models/mixed_properties_and_additional_properties_class_spec.rb b/samples/client/petstore/ruby/spec/models/mixed_properties_and_additional_properties_class_spec.rb new file mode 100644 index 00000000000..f1f9c33d78f --- /dev/null +++ b/samples/client/petstore/ruby/spec/models/mixed_properties_and_additional_properties_class_spec.rb @@ -0,0 +1,52 @@ +=begin +Swagger Petstore + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +OpenAPI spec version: 1.0.0 +Contact: apiteam@swagger.io +Generated by: https://github.com/swagger-api/swagger-codegen.git + +License: Apache 2.0 +http://www.apache.org/licenses/LICENSE-2.0.html + +Terms of Service: http://swagger.io/terms/ + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::MixedPropertiesAndAdditionalPropertiesClass +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'MixedPropertiesAndAdditionalPropertiesClass' do + before do + # run before each test + @instance = Petstore::MixedPropertiesAndAdditionalPropertiesClass.new + end + + after do + # run after each test + end + + describe 'test an instance of MixedPropertiesAndAdditionalPropertiesClass' do + it 'should create an instact of MixedPropertiesAndAdditionalPropertiesClass' do + expect(@instance).to be_instance_of(Petstore::MixedPropertiesAndAdditionalPropertiesClass) + end + end + describe 'test attribute "uuid"' 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 + +end + diff --git a/samples/client/petstore/ruby/spec/models/model_200_response_spec.rb b/samples/client/petstore/ruby/spec/models/model_200_response_spec.rb index 8b8879105d0..b986604e1ef 100644 --- a/samples/client/petstore/ruby/spec/models/model_200_response_spec.rb +++ b/samples/client/petstore/ruby/spec/models/model_200_response_spec.rb @@ -1,7 +1,7 @@ =begin Swagger Petstore -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io diff --git a/samples/client/petstore/ruby/spec/models/model_return_spec.rb b/samples/client/petstore/ruby/spec/models/model_return_spec.rb index 5a80c97542b..d21f4f1ed3e 100644 --- a/samples/client/petstore/ruby/spec/models/model_return_spec.rb +++ b/samples/client/petstore/ruby/spec/models/model_return_spec.rb @@ -1,7 +1,7 @@ =begin Swagger Petstore -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io diff --git a/samples/client/petstore/ruby/spec/models/name_spec.rb b/samples/client/petstore/ruby/spec/models/name_spec.rb index 03a9c69ece1..5ad2a851827 100644 --- a/samples/client/petstore/ruby/spec/models/name_spec.rb +++ b/samples/client/petstore/ruby/spec/models/name_spec.rb @@ -1,7 +1,7 @@ =begin Swagger Petstore -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io @@ -54,5 +54,11 @@ describe 'Name' do end end + describe 'test attribute "_123_number"' 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/order_spec.rb b/samples/client/petstore/ruby/spec/models/order_spec.rb index 73bd5c082fd..008d226ce6e 100644 --- a/samples/client/petstore/ruby/spec/models/order_spec.rb +++ b/samples/client/petstore/ruby/spec/models/order_spec.rb @@ -1,7 +1,7 @@ =begin Swagger Petstore -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io @@ -62,7 +62,10 @@ describe 'Order' do describe 'test attribute "status"' 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', ["placed", "approved", "delivered"]) + validator.allowable_values.each do |value| + expect { @instance.status = value }.not_to raise_error + end end end diff --git a/samples/client/petstore/ruby/spec/models/pet_spec.rb b/samples/client/petstore/ruby/spec/models/pet_spec.rb index 9911ced1366..72780cf80c9 100644 --- a/samples/client/petstore/ruby/spec/models/pet_spec.rb +++ b/samples/client/petstore/ruby/spec/models/pet_spec.rb @@ -1,7 +1,7 @@ =begin Swagger Petstore -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io @@ -68,7 +68,10 @@ describe 'Pet' do describe 'test attribute "status"' 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', ["available", "pending", "sold"]) + validator.allowable_values.each do |value| + expect { @instance.status = value }.not_to raise_error + end end end diff --git a/samples/client/petstore/ruby/spec/models/read_only_first_spec.rb b/samples/client/petstore/ruby/spec/models/read_only_first_spec.rb new file mode 100644 index 00000000000..ab631729310 --- /dev/null +++ b/samples/client/petstore/ruby/spec/models/read_only_first_spec.rb @@ -0,0 +1,52 @@ +=begin +Swagger Petstore + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +OpenAPI spec version: 1.0.0 +Contact: apiteam@swagger.io +Generated by: https://github.com/swagger-api/swagger-codegen.git + +License: Apache 2.0 +http://www.apache.org/licenses/LICENSE-2.0.html + +Terms of Service: http://swagger.io/terms/ + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::ReadOnlyFirst +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'ReadOnlyFirst' do + before do + # run before each test + @instance = Petstore::ReadOnlyFirst.new + end + + after do + # run after each test + end + + describe 'test an instance of ReadOnlyFirst' do + it 'should create an instact of ReadOnlyFirst' do + expect(@instance).to be_instance_of(Petstore::ReadOnlyFirst) + end + end + describe 'test attribute "bar"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "baz"' 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/special_model_name_spec.rb b/samples/client/petstore/ruby/spec/models/special_model_name_spec.rb index cd93568e8f9..5b10f4c8f9f 100644 --- a/samples/client/petstore/ruby/spec/models/special_model_name_spec.rb +++ b/samples/client/petstore/ruby/spec/models/special_model_name_spec.rb @@ -1,7 +1,7 @@ =begin Swagger Petstore -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io diff --git a/samples/client/petstore/ruby/spec/models/tag_spec.rb b/samples/client/petstore/ruby/spec/models/tag_spec.rb index 68b77e026b1..c6a5a954b7e 100644 --- a/samples/client/petstore/ruby/spec/models/tag_spec.rb +++ b/samples/client/petstore/ruby/spec/models/tag_spec.rb @@ -1,7 +1,7 @@ =begin Swagger Petstore -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io diff --git a/samples/client/petstore/ruby/spec/models/user_spec.rb b/samples/client/petstore/ruby/spec/models/user_spec.rb index fc510605b5c..ae780d5d656 100644 --- a/samples/client/petstore/ruby/spec/models/user_spec.rb +++ b/samples/client/petstore/ruby/spec/models/user_spec.rb @@ -1,7 +1,7 @@ =begin Swagger Petstore -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io diff --git a/samples/client/petstore/swift/Cartfile b/samples/client/petstore/swift/default/Cartfile similarity index 100% rename from samples/client/petstore/swift/Cartfile rename to samples/client/petstore/swift/default/Cartfile diff --git a/samples/client/petstore/swift/PetstoreClient.podspec b/samples/client/petstore/swift/default/PetstoreClient.podspec similarity index 100% rename from samples/client/petstore/swift/PetstoreClient.podspec rename to samples/client/petstore/swift/default/PetstoreClient.podspec diff --git a/samples/client/petstore/swift-promisekit/PetstoreClient/Classes/Swaggers/APIHelper.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/APIHelper.swift similarity index 100% rename from samples/client/petstore/swift-promisekit/PetstoreClient/Classes/Swaggers/APIHelper.swift rename to samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/APIHelper.swift diff --git a/samples/client/petstore/swift-promisekit/PetstoreClient/Classes/Swaggers/APIs.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/APIs.swift similarity index 100% rename from samples/client/petstore/swift-promisekit/PetstoreClient/Classes/Swaggers/APIs.swift rename to samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/APIs.swift diff --git a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift similarity index 100% rename from samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift rename to samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift diff --git a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift similarity index 100% rename from samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift rename to samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift diff --git a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift similarity index 100% rename from samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift rename to samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift diff --git a/samples/client/petstore/swift-promisekit/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift similarity index 100% rename from samples/client/petstore/swift-promisekit/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift rename to samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift diff --git a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Extensions.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/Extensions.swift similarity index 100% rename from samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Extensions.swift rename to samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/Extensions.swift diff --git a/samples/client/petstore/swift-promisekit/PetstoreClient/Classes/Swaggers/Models.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/Models.swift similarity index 100% rename from samples/client/petstore/swift-promisekit/PetstoreClient/Classes/Swaggers/Models.swift rename to samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/Models.swift diff --git a/samples/client/petstore/swift-promisekit/PetstoreClient/Classes/Swaggers/Models/Category.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/Models/Category.swift similarity index 100% rename from samples/client/petstore/swift-promisekit/PetstoreClient/Classes/Swaggers/Models/Category.swift rename to samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/Models/Category.swift diff --git a/samples/client/petstore/swift-promisekit/PetstoreClient/Classes/Swaggers/Models/Order.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/Models/Order.swift similarity index 100% rename from samples/client/petstore/swift-promisekit/PetstoreClient/Classes/Swaggers/Models/Order.swift rename to samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/Models/Order.swift diff --git a/samples/client/petstore/swift-promisekit/PetstoreClient/Classes/Swaggers/Models/Pet.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/Models/Pet.swift similarity index 100% rename from samples/client/petstore/swift-promisekit/PetstoreClient/Classes/Swaggers/Models/Pet.swift rename to samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/Models/Pet.swift diff --git a/samples/client/petstore/swift-promisekit/PetstoreClient/Classes/Swaggers/Models/Tag.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/Models/Tag.swift similarity index 100% rename from samples/client/petstore/swift-promisekit/PetstoreClient/Classes/Swaggers/Models/Tag.swift rename to samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/Models/Tag.swift diff --git a/samples/client/petstore/swift-promisekit/PetstoreClient/Classes/Swaggers/Models/User.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/Models/User.swift similarity index 100% rename from samples/client/petstore/swift-promisekit/PetstoreClient/Classes/Swaggers/Models/User.swift rename to samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/Models/User.swift diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Podfile b/samples/client/petstore/swift/default/SwaggerClientTests/Podfile similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Podfile rename to samples/client/petstore/swift/default/SwaggerClientTests/Podfile diff --git a/samples/client/petstore/swift/SwaggerClientTests/Podfile.lock b/samples/client/petstore/swift/default/SwaggerClientTests/Podfile.lock similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/Podfile.lock rename to samples/client/petstore/swift/default/SwaggerClientTests/Podfile.lock diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Alamofire/LICENSE b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/LICENSE similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Alamofire/LICENSE rename to samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/LICENSE diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Alamofire/README.md b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/README.md similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Alamofire/README.md rename to samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/README.md diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift rename to samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Alamofire/Source/Download.swift b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/Download.swift similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Alamofire/Source/Download.swift rename to samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/Download.swift diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Alamofire/Source/Error.swift b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/Error.swift similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Alamofire/Source/Error.swift rename to samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/Error.swift diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Alamofire/Source/Manager.swift b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/Manager.swift similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Alamofire/Source/Manager.swift rename to samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/Manager.swift diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift rename to samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift rename to samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Alamofire/Source/Request.swift b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/Request.swift similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Alamofire/Source/Request.swift rename to samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/Request.swift diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Alamofire/Source/Response.swift b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/Response.swift similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Alamofire/Source/Response.swift rename to samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/Response.swift diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift rename to samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Alamofire/Source/Result.swift b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/Result.swift similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Alamofire/Source/Result.swift rename to samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/Result.swift diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift rename to samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Alamofire/Source/Stream.swift b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/Stream.swift similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Alamofire/Source/Stream.swift rename to samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/Stream.swift diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Alamofire/Source/Upload.swift b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/Upload.swift similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Alamofire/Source/Upload.swift rename to samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/Upload.swift diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift rename to samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json rename to samples/client/petstore/swift/default/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Manifest.lock b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Manifest.lock similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/Pods/Manifest.lock rename to samples/client/petstore/swift/default/SwaggerClientTests/Pods/Manifest.lock diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj rename to samples/client/petstore/swift/default/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-dummy.m b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-dummy.m similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-dummy.m rename to samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-dummy.m diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch rename to samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h rename to samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.modulemap b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.modulemap similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.modulemap rename to samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.modulemap diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig rename to samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Info.plist b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Info.plist similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Info.plist rename to samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Info.plist diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/Info.plist b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/Info.plist similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/Info.plist rename to samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/Info.plist diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-dummy.m b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-dummy.m similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-dummy.m rename to samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-dummy.m diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-prefix.pch b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-prefix.pch similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-prefix.pch rename to samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-prefix.pch diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h rename to samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.modulemap b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.modulemap similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.modulemap rename to samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.modulemap diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig rename to samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Info.plist b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Info.plist similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Info.plist rename to samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Info.plist diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.markdown b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.markdown similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.markdown rename to samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.markdown diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.plist b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.plist similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.plist rename to samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.plist diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-dummy.m b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-dummy.m similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-dummy.m rename to samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-dummy.m diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh rename to samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh rename to samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h rename to samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig rename to samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.modulemap b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.modulemap similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.modulemap rename to samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.modulemap diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig rename to samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Info.plist b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Info.plist similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Info.plist rename to samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Info.plist diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-acknowledgements.markdown b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-acknowledgements.markdown similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-acknowledgements.markdown rename to samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-acknowledgements.markdown diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-acknowledgements.plist b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-acknowledgements.plist similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-acknowledgements.plist rename to samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-acknowledgements.plist diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-dummy.m b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-dummy.m similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-dummy.m rename to samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-dummy.m diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh rename to samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh rename to samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h rename to samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig rename to samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap rename to samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig rename to samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj rename to samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme b/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme rename to samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata b/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata rename to samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/SwaggerClient/AppDelegate.swift b/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/AppDelegate.swift similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/SwaggerClient/AppDelegate.swift rename to samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/AppDelegate.swift diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json b/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json rename to samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard b/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard rename to samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard b/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard rename to samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/SwaggerClient/Info.plist b/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/Info.plist similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/SwaggerClient/Info.plist rename to samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/Info.plist diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/SwaggerClient/ViewController.swift b/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/ViewController.swift similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/SwaggerClient/ViewController.swift rename to samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/ViewController.swift diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/SwaggerClientTests/Info.plist b/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClientTests/Info.plist similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/SwaggerClientTests/Info.plist rename to samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClientTests/Info.plist diff --git a/samples/client/petstore/swift/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift b/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift rename to samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift diff --git a/samples/client/petstore/swift/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift b/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift rename to samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift diff --git a/samples/client/petstore/swift/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift b/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift rename to samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift diff --git a/samples/client/petstore/swift/SwaggerClientTests/pom.xml b/samples/client/petstore/swift/default/SwaggerClientTests/pom.xml similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/pom.xml rename to samples/client/petstore/swift/default/SwaggerClientTests/pom.xml diff --git a/samples/client/petstore/swift-promisekit/git_push.sh b/samples/client/petstore/swift/default/git_push.sh similarity index 100% rename from samples/client/petstore/swift-promisekit/git_push.sh rename to samples/client/petstore/swift/default/git_push.sh diff --git a/samples/client/petstore/swift-promisekit/.gitignore b/samples/client/petstore/swift/promisekit/.gitignore similarity index 100% rename from samples/client/petstore/swift-promisekit/.gitignore rename to samples/client/petstore/swift/promisekit/.gitignore diff --git a/samples/client/petstore/swift/promisekit/.swagger-codegen-ignore b/samples/client/petstore/swift/promisekit/.swagger-codegen-ignore new file mode 100644 index 00000000000..19d3377182e --- /dev/null +++ b/samples/client/petstore/swift/promisekit/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# 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 Swagger Codgen 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 +# Thsi 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/swift-promisekit/Cartfile b/samples/client/petstore/swift/promisekit/Cartfile similarity index 100% rename from samples/client/petstore/swift-promisekit/Cartfile rename to samples/client/petstore/swift/promisekit/Cartfile diff --git a/samples/client/petstore/swift-promisekit/PetstoreClient.podspec b/samples/client/petstore/swift/promisekit/PetstoreClient.podspec similarity index 100% rename from samples/client/petstore/swift-promisekit/PetstoreClient.podspec rename to samples/client/petstore/swift/promisekit/PetstoreClient.podspec diff --git a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/APIHelper.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/APIHelper.swift similarity index 100% rename from samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/APIHelper.swift rename to samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/APIHelper.swift diff --git a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/APIs.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/APIs.swift similarity index 100% rename from samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/APIs.swift rename to samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/APIs.swift diff --git a/samples/client/petstore/swift-promisekit/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift similarity index 94% rename from samples/client/petstore/swift-promisekit/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift rename to samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift index 27000da5417..c7e5a6402b5 100644 --- a/samples/client/petstore/swift-promisekit/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift +++ b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift @@ -160,13 +160,13 @@ public class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - examples: [{contentType=application/json, example={ + - examples: [{example={ "name" : "Puma", "type" : "Dog", "color" : "Black", "gender" : "Female", "breed" : "Mixed" -}}] +}, contentType=application/json}] - parameter status: (query) Status values that need to be considered for filter (optional, default to available) @@ -226,20 +226,20 @@ public class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - examples: [{contentType=application/json, example=[ { - "photoUrls" : [ "aeiou" ], - "name" : "doggie", + - examples: [{example=[ { + "tags" : [ { + "id" : 123456789, + "name" : "aeiou" + } ], "id" : 123456789, "category" : { - "name" : "aeiou", - "id" : 123456789 + "id" : 123456789, + "name" : "aeiou" }, - "tags" : [ { - "name" : "aeiou", - "id" : 123456789 - } ], - "status" : "aeiou" -} ]}, {contentType=application/xml, example= + "status" : "aeiou", + "name" : "doggie", + "photoUrls" : [ "aeiou" ] +} ], contentType=application/json}, {example= 123456 doggie @@ -248,21 +248,21 @@ public class PetAPI: APIBase { string -}] - - examples: [{contentType=application/json, example=[ { - "photoUrls" : [ "aeiou" ], - "name" : "doggie", +, contentType=application/xml}] + - examples: [{example=[ { + "tags" : [ { + "id" : 123456789, + "name" : "aeiou" + } ], "id" : 123456789, "category" : { - "name" : "aeiou", - "id" : 123456789 + "id" : 123456789, + "name" : "aeiou" }, - "tags" : [ { - "name" : "aeiou", - "id" : 123456789 - } ], - "status" : "aeiou" -} ]}, {contentType=application/xml, example= + "status" : "aeiou", + "name" : "doggie", + "photoUrls" : [ "aeiou" ] +} ], contentType=application/json}, {example= 123456 doggie @@ -271,7 +271,7 @@ public class PetAPI: APIBase { string -}] +, contentType=application/xml}] - parameter tags: (query) Tags to filter by (optional) @@ -328,26 +328,26 @@ public class PetAPI: APIBase { Find pet by ID - GET /pet/{petId} - Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - - OAuth: - - type: oauth2 - - name: petstore_auth - API Key: - type: apiKey api_key - name: api_key - - examples: [{contentType=application/json, example={ - "photoUrls" : [ "aeiou" ], - "name" : "doggie", + - OAuth: + - type: oauth2 + - name: petstore_auth + - examples: [{example={ + "tags" : [ { + "id" : 123456789, + "name" : "aeiou" + } ], "id" : 123456789, "category" : { - "name" : "aeiou", - "id" : 123456789 + "id" : 123456789, + "name" : "aeiou" }, - "tags" : [ { - "name" : "aeiou", - "id" : 123456789 - } ], - "status" : "aeiou" -}}, {contentType=application/xml, example= + "status" : "aeiou", + "name" : "doggie", + "photoUrls" : [ "aeiou" ] +}, contentType=application/json}, {example= 123456 doggie @@ -356,21 +356,21 @@ public class PetAPI: APIBase { string -}] - - examples: [{contentType=application/json, example={ - "photoUrls" : [ "aeiou" ], - "name" : "doggie", +, contentType=application/xml}] + - examples: [{example={ + "tags" : [ { + "id" : 123456789, + "name" : "aeiou" + } ], "id" : 123456789, "category" : { - "name" : "aeiou", - "id" : 123456789 + "id" : 123456789, + "name" : "aeiou" }, - "tags" : [ { - "name" : "aeiou", - "id" : 123456789 - } ], - "status" : "aeiou" -}}, {contentType=application/xml, example= + "status" : "aeiou", + "name" : "doggie", + "photoUrls" : [ "aeiou" ] +}, contentType=application/json}, {example= 123456 doggie @@ -379,7 +379,7 @@ public class PetAPI: APIBase { string -}] +, contentType=application/xml}] - parameter petId: (path) ID of pet that needs to be fetched diff --git a/samples/client/petstore/swift-promisekit/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift similarity index 89% rename from samples/client/petstore/swift-promisekit/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift rename to samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift index da40486b292..be7d36b91f3 100644 --- a/samples/client/petstore/swift-promisekit/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift @@ -101,12 +101,12 @@ public class StoreAPI: APIBase { - API Key: - type: apiKey api_key - name: api_key - - examples: [{contentType=application/json, example={ + - examples: [{example={ "key" : 123 -}}, {contentType=application/xml, example=not implemented io.swagger.models.properties.MapProperty@d1e580af}] - - examples: [{contentType=application/json, example={ +}, contentType=application/json}, {example=not implemented io.swagger.models.properties.MapProperty@d1e580af, contentType=application/xml}] + - examples: [{example={ "key" : 123 -}}, {contentType=application/xml, example=not implemented io.swagger.models.properties.MapProperty@d1e580af}] +}, contentType=application/json}, {example=not implemented io.swagger.models.properties.MapProperty@d1e580af, contentType=application/xml}] - returns: RequestBuilder<[String:Int32]> */ @@ -159,36 +159,36 @@ public class StoreAPI: APIBase { Find purchase order by ID - GET /store/order/{orderId} - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - - examples: [{contentType=application/json, example={ - "petId" : 123456789, - "quantity" : 123, + - examples: [{example={ "id" : 123456789, - "shipDate" : "2000-01-23T04:56:07.000+0000", + "petId" : 123456789, "complete" : true, - "status" : "aeiou" -}}, {contentType=application/xml, example= + "status" : "aeiou", + "quantity" : 123, + "shipDate" : "2000-01-23T04:56:07.000+0000" +}, contentType=application/json}, {example= 123456 123456 0 2000-01-23T04:56:07.000Z string true -}] - - examples: [{contentType=application/json, example={ - "petId" : 123456789, - "quantity" : 123, +, contentType=application/xml}] + - examples: [{example={ "id" : 123456789, - "shipDate" : "2000-01-23T04:56:07.000+0000", + "petId" : 123456789, "complete" : true, - "status" : "aeiou" -}}, {contentType=application/xml, example= + "status" : "aeiou", + "quantity" : 123, + "shipDate" : "2000-01-23T04:56:07.000+0000" +}, contentType=application/json}, {example= 123456 123456 0 2000-01-23T04:56:07.000Z string true -}] +, contentType=application/xml}] - parameter orderId: (path) ID of pet that needs to be fetched @@ -244,36 +244,36 @@ public class StoreAPI: APIBase { Place an order for a pet - POST /store/order - - - examples: [{contentType=application/json, example={ - "petId" : 123456789, - "quantity" : 123, + - examples: [{example={ "id" : 123456789, - "shipDate" : "2000-01-23T04:56:07.000+0000", + "petId" : 123456789, "complete" : true, - "status" : "aeiou" -}}, {contentType=application/xml, example= + "status" : "aeiou", + "quantity" : 123, + "shipDate" : "2000-01-23T04:56:07.000+0000" +}, contentType=application/json}, {example= 123456 123456 0 2000-01-23T04:56:07.000Z string true -}] - - examples: [{contentType=application/json, example={ - "petId" : 123456789, - "quantity" : 123, +, contentType=application/xml}] + - examples: [{example={ "id" : 123456789, - "shipDate" : "2000-01-23T04:56:07.000+0000", + "petId" : 123456789, "complete" : true, - "status" : "aeiou" -}}, {contentType=application/xml, example= + "status" : "aeiou", + "quantity" : 123, + "shipDate" : "2000-01-23T04:56:07.000+0000" +}, contentType=application/json}, {example= 123456 123456 0 2000-01-23T04:56:07.000Z string true -}] +, contentType=application/xml}] - parameter body: (body) order placed for purchasing the pet (optional) diff --git a/samples/client/petstore/swift-promisekit/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift similarity index 96% rename from samples/client/petstore/swift-promisekit/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift rename to samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift index 98afec0c80a..1b5ada9da67 100644 --- a/samples/client/petstore/swift-promisekit/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift +++ b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift @@ -253,16 +253,16 @@ public class UserAPI: APIBase { Get user by user name - GET /user/{username} - - - examples: [{contentType=application/json, example={ - "firstName" : "aeiou", - "lastName" : "aeiou", - "password" : "aeiou", - "userStatus" : 123, - "phone" : "aeiou", + - examples: [{example={ "id" : 123456789, + "lastName" : "aeiou", + "phone" : "aeiou", + "username" : "aeiou", "email" : "aeiou", - "username" : "aeiou" -}}, {contentType=application/xml, example= + "userStatus" : 123, + "firstName" : "aeiou", + "password" : "aeiou" +}, contentType=application/json}, {example= 123456 string string @@ -271,17 +271,17 @@ public class UserAPI: APIBase { string string 0 -}] - - examples: [{contentType=application/json, example={ - "firstName" : "aeiou", - "lastName" : "aeiou", - "password" : "aeiou", - "userStatus" : 123, - "phone" : "aeiou", +, contentType=application/xml}] + - examples: [{example={ "id" : 123456789, + "lastName" : "aeiou", + "phone" : "aeiou", + "username" : "aeiou", "email" : "aeiou", - "username" : "aeiou" -}}, {contentType=application/xml, example= + "userStatus" : 123, + "firstName" : "aeiou", + "password" : "aeiou" +}, contentType=application/json}, {example= 123456 string string @@ -290,7 +290,7 @@ public class UserAPI: APIBase { string string 0 -}] +, contentType=application/xml}] - parameter username: (path) The name that needs to be fetched. Use user1 for testing. @@ -348,8 +348,8 @@ public class UserAPI: APIBase { Logs user into the system - GET /user/login - - - examples: [{contentType=application/json, example="aeiou"}, {contentType=application/xml, example=string}] - - examples: [{contentType=application/json, example="aeiou"}, {contentType=application/xml, example=string}] + - examples: [{example="aeiou", contentType=application/json}, {example=string, contentType=application/xml}] + - examples: [{example="aeiou", contentType=application/json}, {example=string, contentType=application/xml}] - parameter username: (query) The user name for login (optional) - parameter password: (query) The password for login in clear text (optional) diff --git a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift similarity index 100% rename from samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift rename to samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift diff --git a/samples/client/petstore/swift-promisekit/PetstoreClient/Classes/Swaggers/Extensions.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/Extensions.swift similarity index 100% rename from samples/client/petstore/swift-promisekit/PetstoreClient/Classes/Swaggers/Extensions.swift rename to samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/Extensions.swift diff --git a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/Models.swift similarity index 100% rename from samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models.swift rename to samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/Models.swift diff --git a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/Category.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/Models/Category.swift similarity index 100% rename from samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/Category.swift rename to samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/Models/Category.swift diff --git a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/Order.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/Models/Order.swift similarity index 100% rename from samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/Order.swift rename to samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/Models/Order.swift diff --git a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/Pet.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/Models/Pet.swift similarity index 100% rename from samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/Pet.swift rename to samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/Models/Pet.swift diff --git a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/Tag.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/Models/Tag.swift similarity index 100% rename from samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/Tag.swift rename to samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/Models/Tag.swift diff --git a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/User.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/Models/User.swift similarity index 100% rename from samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/User.swift rename to samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/Models/User.swift diff --git a/samples/client/petstore/swift/SwaggerClientTests/Podfile b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Podfile similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/Podfile rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Podfile diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Podfile.lock b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Podfile.lock similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Podfile.lock rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Podfile.lock diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Alamofire/LICENSE b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/LICENSE similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/Pods/Alamofire/LICENSE rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/LICENSE diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Alamofire/README.md b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/README.md similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/Pods/Alamofire/README.md rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/README.md diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Alamofire/Source/Download.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Download.swift similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/Pods/Alamofire/Source/Download.swift rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Download.swift diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Alamofire/Source/Error.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Error.swift similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/Pods/Alamofire/Source/Error.swift rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Error.swift diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Alamofire/Source/Manager.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Manager.swift similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/Pods/Alamofire/Source/Manager.swift rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Manager.swift diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Alamofire/Source/Request.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Request.swift similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/Pods/Alamofire/Source/Request.swift rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Request.swift diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Alamofire/Source/Response.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Response.swift similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/Pods/Alamofire/Source/Response.swift rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Response.swift diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Alamofire/Source/Result.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Result.swift similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/Pods/Alamofire/Source/Result.swift rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Result.swift diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Alamofire/Source/Stream.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Stream.swift similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/Pods/Alamofire/Source/Stream.swift rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Stream.swift diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Alamofire/Source/Upload.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Upload.swift similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/Pods/Alamofire/Source/Upload.swift rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Upload.swift diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Manifest.lock b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Manifest.lock similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Manifest.lock rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Manifest.lock diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/README.markdown b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/README.markdown similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/README.markdown rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/README.markdown diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/Sources/OMGFormURLEncode.h b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/Sources/OMGFormURLEncode.h similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/Sources/OMGFormURLEncode.h rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/Sources/OMGFormURLEncode.h diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/Sources/OMGFormURLEncode.m b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/Sources/OMGFormURLEncode.m similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/Sources/OMGFormURLEncode.m rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/Sources/OMGFormURLEncode.m diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/Sources/OMGHTTPURLRQ.h b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/Sources/OMGHTTPURLRQ.h similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/Sources/OMGHTTPURLRQ.h rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/Sources/OMGHTTPURLRQ.h diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/Sources/OMGHTTPURLRQ.m b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/Sources/OMGHTTPURLRQ.m similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/Sources/OMGHTTPURLRQ.m rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/Sources/OMGHTTPURLRQ.m diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/Sources/OMGUserAgent.h b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/Sources/OMGUserAgent.h similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/Sources/OMGUserAgent.h rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/Sources/OMGUserAgent.h diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/Sources/OMGUserAgent.m b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/Sources/OMGUserAgent.m similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/Sources/OMGUserAgent.m rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/Sources/OMGUserAgent.m diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/Foundation/NSNotificationCenter+AnyPromise.h b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/Foundation/NSNotificationCenter+AnyPromise.h similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/Foundation/NSNotificationCenter+AnyPromise.h rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/Foundation/NSNotificationCenter+AnyPromise.h diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/Foundation/NSNotificationCenter+AnyPromise.m b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/Foundation/NSNotificationCenter+AnyPromise.m similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/Foundation/NSNotificationCenter+AnyPromise.m rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/Foundation/NSNotificationCenter+AnyPromise.m diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/Foundation/NSNotificationCenter+Promise.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/Foundation/NSNotificationCenter+Promise.swift similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/Foundation/NSNotificationCenter+Promise.swift rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/Foundation/NSNotificationCenter+Promise.swift diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/Foundation/NSObject+Promise.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/Foundation/NSObject+Promise.swift similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/Foundation/NSObject+Promise.swift rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/Foundation/NSObject+Promise.swift diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/Foundation/NSURLConnection+AnyPromise.h b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/Foundation/NSURLConnection+AnyPromise.h similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/Foundation/NSURLConnection+AnyPromise.h rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/Foundation/NSURLConnection+AnyPromise.h diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/Foundation/NSURLConnection+AnyPromise.m b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/Foundation/NSURLConnection+AnyPromise.m similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/Foundation/NSURLConnection+AnyPromise.m rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/Foundation/NSURLConnection+AnyPromise.m diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/Foundation/NSURLConnection+Promise.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/Foundation/NSURLConnection+Promise.swift similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/Foundation/NSURLConnection+Promise.swift rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/Foundation/NSURLConnection+Promise.swift diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/Foundation/NSURLSession+Promise.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/Foundation/NSURLSession+Promise.swift similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/Foundation/NSURLSession+Promise.swift rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/Foundation/NSURLSession+Promise.swift diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/Foundation/afterlife.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/Foundation/afterlife.swift similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/Foundation/afterlife.swift rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/Foundation/afterlife.swift diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/QuartzCore/CALayer+AnyPromise.h b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/QuartzCore/CALayer+AnyPromise.h similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/QuartzCore/CALayer+AnyPromise.h rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/QuartzCore/CALayer+AnyPromise.h diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/QuartzCore/CALayer+AnyPromise.m b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/QuartzCore/CALayer+AnyPromise.m similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/QuartzCore/CALayer+AnyPromise.m rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/QuartzCore/CALayer+AnyPromise.m diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/PMKAlertController.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/PMKAlertController.swift similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/PMKAlertController.swift rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/PMKAlertController.swift diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/UIActionSheet+AnyPromise.h b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/UIActionSheet+AnyPromise.h similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/UIActionSheet+AnyPromise.h rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/UIActionSheet+AnyPromise.h diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/UIActionSheet+AnyPromise.m b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/UIActionSheet+AnyPromise.m similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/UIActionSheet+AnyPromise.m rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/UIActionSheet+AnyPromise.m diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/UIActionSheet+Promise.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/UIActionSheet+Promise.swift similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/UIActionSheet+Promise.swift rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/UIActionSheet+Promise.swift diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/UIAlertView+AnyPromise.h b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/UIAlertView+AnyPromise.h similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/UIAlertView+AnyPromise.h rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/UIAlertView+AnyPromise.h diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/UIAlertView+AnyPromise.m b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/UIAlertView+AnyPromise.m similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/UIAlertView+AnyPromise.m rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/UIAlertView+AnyPromise.m diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/UIAlertView+Promise.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/UIAlertView+Promise.swift similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/UIAlertView+Promise.swift rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/UIAlertView+Promise.swift diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/UIView+AnyPromise.h b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/UIView+AnyPromise.h similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/UIView+AnyPromise.h rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/UIView+AnyPromise.h diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/UIView+AnyPromise.m b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/UIView+AnyPromise.m similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/UIView+AnyPromise.m rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/UIView+AnyPromise.m diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/UIView+Promise.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/UIView+Promise.swift similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/UIView+Promise.swift rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/UIView+Promise.swift diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/UIViewController+AnyPromise.h b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/UIViewController+AnyPromise.h similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/UIViewController+AnyPromise.h rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/UIViewController+AnyPromise.h diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/UIViewController+AnyPromise.m b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/UIViewController+AnyPromise.m similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/UIViewController+AnyPromise.m rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/UIViewController+AnyPromise.m diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/UIViewController+Promise.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/UIViewController+Promise.swift similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/UIViewController+Promise.swift rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/UIViewController+Promise.swift diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/README.markdown b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/README.markdown similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/README.markdown rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/README.markdown diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise+Private.h b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise+Private.h similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise+Private.h rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise+Private.h diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.h b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.h similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.h rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.h diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.m b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.m similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.m rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.m diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.swift similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.swift rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.swift diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Error.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Error.swift similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Error.swift rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Error.swift diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/NSError+Cancellation.h b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/NSError+Cancellation.h similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/NSError+Cancellation.h rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/NSError+Cancellation.h diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/NSMethodSignatureForBlock.m b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/NSMethodSignatureForBlock.m similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/NSMethodSignatureForBlock.m rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/NSMethodSignatureForBlock.m diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/PMK.modulemap b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/PMK.modulemap similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/PMK.modulemap rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/PMK.modulemap diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/PMKCallVariadicBlock.m b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/PMKCallVariadicBlock.m similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/PMKCallVariadicBlock.m rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/PMKCallVariadicBlock.m diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Promise+Properties.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Promise+Properties.swift similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Promise+Properties.swift rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Promise+Properties.swift diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Promise.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Promise.swift similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Promise.swift rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Promise.swift diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/PromiseKit.h b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/PromiseKit.h similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/PromiseKit.h rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/PromiseKit.h diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/State.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/State.swift similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/State.swift rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/State.swift diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/URLDataPromise.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/URLDataPromise.swift similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/URLDataPromise.swift rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/URLDataPromise.swift diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Umbrella.h b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Umbrella.h similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Umbrella.h rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Umbrella.h diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/after.m b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/after.m similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/after.m rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/after.m diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/after.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/after.swift similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/after.swift rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/after.swift diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/dispatch_promise.m b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/dispatch_promise.m similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/dispatch_promise.m rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/dispatch_promise.m diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/dispatch_promise.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/dispatch_promise.swift similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/dispatch_promise.swift rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/dispatch_promise.swift diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/hang.m b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/hang.m similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/hang.m rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/hang.m diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/join.m b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/join.m similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/join.m rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/join.m diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/join.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/join.swift similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/join.swift rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/join.swift diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/race.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/race.swift similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/race.swift rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/race.swift diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/when.m b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/when.m similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/when.m rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/when.m diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/when.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/when.swift similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/when.swift rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/when.swift diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-dummy.m b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-dummy.m similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-dummy.m rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-dummy.m diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.modulemap b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.modulemap similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.modulemap rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.modulemap diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/Alamofire/Info.plist b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Info.plist similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/Alamofire/Info.plist rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Info.plist diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/OMGHTTPURLRQ/Info.plist b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/OMGHTTPURLRQ/Info.plist similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/OMGHTTPURLRQ/Info.plist rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/OMGHTTPURLRQ/Info.plist diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/OMGHTTPURLRQ/OMGHTTPURLRQ-dummy.m b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/OMGHTTPURLRQ/OMGHTTPURLRQ-dummy.m similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/OMGHTTPURLRQ/OMGHTTPURLRQ-dummy.m rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/OMGHTTPURLRQ/OMGHTTPURLRQ-dummy.m diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/OMGHTTPURLRQ/OMGHTTPURLRQ-prefix.pch b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/OMGHTTPURLRQ/OMGHTTPURLRQ-prefix.pch similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/OMGHTTPURLRQ/OMGHTTPURLRQ-prefix.pch rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/OMGHTTPURLRQ/OMGHTTPURLRQ-prefix.pch diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/OMGHTTPURLRQ/OMGHTTPURLRQ-umbrella.h b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/OMGHTTPURLRQ/OMGHTTPURLRQ-umbrella.h similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/OMGHTTPURLRQ/OMGHTTPURLRQ-umbrella.h rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/OMGHTTPURLRQ/OMGHTTPURLRQ-umbrella.h diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/OMGHTTPURLRQ/OMGHTTPURLRQ.modulemap b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/OMGHTTPURLRQ/OMGHTTPURLRQ.modulemap similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/OMGHTTPURLRQ/OMGHTTPURLRQ.modulemap rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/OMGHTTPURLRQ/OMGHTTPURLRQ.modulemap diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/OMGHTTPURLRQ/OMGHTTPURLRQ.xcconfig b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/OMGHTTPURLRQ/OMGHTTPURLRQ.xcconfig similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/OMGHTTPURLRQ/OMGHTTPURLRQ.xcconfig rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/OMGHTTPURLRQ/OMGHTTPURLRQ.xcconfig diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/Info.plist b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/Info.plist similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/Info.plist rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/Info.plist diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-dummy.m b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-dummy.m similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-dummy.m rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-dummy.m diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-prefix.pch b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-prefix.pch similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-prefix.pch rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-prefix.pch diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.modulemap b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.modulemap similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.modulemap rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.modulemap diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Info.plist b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Info.plist similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Info.plist rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Info.plist diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.markdown b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.markdown similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.markdown rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.markdown diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.plist b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.plist similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.plist rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.plist diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-dummy.m b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-dummy.m similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-dummy.m rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-dummy.m diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.modulemap b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.modulemap similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.modulemap rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.modulemap diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Info.plist b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Info.plist similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Info.plist rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Info.plist diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-acknowledgements.markdown b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-acknowledgements.markdown similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-acknowledgements.markdown rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-acknowledgements.markdown diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-acknowledgements.plist b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-acknowledgements.plist similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-acknowledgements.plist rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-acknowledgements.plist diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-dummy.m b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-dummy.m similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-dummy.m rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-dummy.m diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/Info.plist b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/Info.plist similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/Info.plist rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/Info.plist diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit-dummy.m b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit-dummy.m similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit-dummy.m rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit-dummy.m diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit-prefix.pch b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit-prefix.pch similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit-prefix.pch rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit-prefix.pch diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit.modulemap b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit.modulemap similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit.modulemap rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit.modulemap diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit.xcconfig b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit.xcconfig similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit.xcconfig rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit.xcconfig diff --git a/samples/client/petstore/swift/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj diff --git a/samples/client/petstore/swift/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme b/samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme diff --git a/samples/client/petstore/swift/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata b/samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata diff --git a/samples/client/petstore/swift/SwaggerClientTests/SwaggerClient/AppDelegate.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/AppDelegate.swift similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/SwaggerClient/AppDelegate.swift rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/AppDelegate.swift diff --git a/samples/client/petstore/swift/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json b/samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/samples/client/petstore/swift/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard b/samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard diff --git a/samples/client/petstore/swift/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard b/samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard diff --git a/samples/client/petstore/swift/SwaggerClientTests/SwaggerClient/Info.plist b/samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/Info.plist similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/SwaggerClient/Info.plist rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/Info.plist diff --git a/samples/client/petstore/swift/SwaggerClientTests/SwaggerClient/ViewController.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/ViewController.swift similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/SwaggerClient/ViewController.swift rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/ViewController.swift diff --git a/samples/client/petstore/swift/SwaggerClientTests/SwaggerClientTests/Info.plist b/samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClientTests/Info.plist similarity index 100% rename from samples/client/petstore/swift/SwaggerClientTests/SwaggerClientTests/Info.plist rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClientTests/Info.plist diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/pom.xml b/samples/client/petstore/swift/promisekit/SwaggerClientTests/pom.xml similarity index 100% rename from samples/client/petstore/swift-promisekit/SwaggerClientTests/pom.xml rename to samples/client/petstore/swift/promisekit/SwaggerClientTests/pom.xml diff --git a/samples/client/petstore/swift/git_push.sh b/samples/client/petstore/swift/promisekit/git_push.sh similarity index 100% rename from samples/client/petstore/swift/git_push.sh rename to samples/client/petstore/swift/promisekit/git_push.sh diff --git a/samples/client/petstore/typescript-fetch/tests/default/package.json b/samples/client/petstore/typescript-fetch/tests/default/package.json index 07a38691ae1..3bab3bdb789 100644 --- a/samples/client/petstore/typescript-fetch/tests/default/package.json +++ b/samples/client/petstore/typescript-fetch/tests/default/package.json @@ -6,7 +6,7 @@ "devDependencies": { "browserify": "^13.0.1", "ts-loader": "^0.8.2", - "tsify": "^0.15.5", + "tsify": "^0.16.0", "typescript": "^1.8.10", "typings": "^0.8.1", "webpack": "^1.13.0" diff --git a/samples/client/petstore/typescript-fetch/tests/default/run_tests_via_webpack.html b/samples/client/petstore/typescript-fetch/tests/default/run_tests_via_webpack.html index 625c8859422..ace737c7ccd 100644 --- a/samples/client/petstore/typescript-fetch/tests/default/run_tests_via_webpack.html +++ b/samples/client/petstore/typescript-fetch/tests/default/run_tests_via_webpack.html @@ -15,8 +15,8 @@ }); - - + +