diff --git a/bin/flaskConnexion-python2.sh b/bin/flaskConnexion-python2.sh index 579e6d94be2..ce6aea3454d 100755 --- a/bin/flaskConnexion-python2.sh +++ b/bin/flaskConnexion-python2.sh @@ -27,7 +27,7 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" #ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l python-flask -o samples/server/petstore/flaskConnexion-python2 -DsupportPython2=true" -ags="$@ generate -t modules/swagger-codegen/src/main/resources/flaskConnexion -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l python-flask -o samples/server/petstore/flaskConnexion-python2 -c bin/supportPython2.json" +ags="$@ generate -t modules/swagger-codegen/src/main/resources/flaskConnexion -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l python-flask -o samples/server/petstore/flaskConnexion-python2 -c bin/supportPython2.json -D service" rm -rf samples/server/petstore/flaskConnexion-python2/* -java $JAVA_OPTS -Dservice -jar $executable $ags +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/flaskConnexion.sh b/bin/flaskConnexion.sh index c09c83b2daa..9bec96aaecc 100755 --- a/bin/flaskConnexion.sh +++ b/bin/flaskConnexion.sh @@ -26,7 +26,7 @@ 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/flaskConnexion -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l python-flask -o samples/server/petstore/flaskConnexion " +ags="$@ generate -t modules/swagger-codegen/src/main/resources/flaskConnexion -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l python-flask -o samples/server/petstore/flaskConnexion -Dservice" rm -rf samples/server/petstore/flaskConnexion/* -java $JAVA_OPTS -Dservice -jar $executable $ags +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/go-petstore-server.sh b/bin/go-petstore-server.sh index 2099d5acbf0..287027a714e 100755 --- a/bin/go-petstore-server.sh +++ b/bin/go-petstore-server.sh @@ -27,6 +27,6 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ generate -t modules/swagger-codegen/src/main/resources/go-server -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l go-server -o samples/server/petstore/go-api-server -DpackageName=petstoreserver --additional-properties hideGenerationTimestamp=true" +ags="$@ generate -t modules/swagger-codegen/src/main/resources/go-server -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l go-server -o samples/server/petstore/go-api-server -DpackageName=petstoreserver --additional-properties hideGenerationTimestamp=true -Dservice" -java $JAVA_OPTS -Dservice -jar $executable $ags +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/javascript-es6-petstore.sh b/bin/javascript-es6-petstore.sh index 1844aeca0bb..a68f2c5b5ca 100755 --- a/bin/javascript-es6-petstore.sh +++ b/bin/javascript-es6-petstore.sh @@ -26,7 +26,7 @@ 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/Javascript \ +ags="$@ generate -t modules/swagger-codegen/src/main/resources/Javascript/es6 \ -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l javascript \ -o samples/client/petstore/javascript-es6 \ --additional-properties useEs6=true" diff --git a/bin/javascript-petstore.sh b/bin/javascript-petstore.sh index 2eb26210e0a..ca961c2484d 100755 --- a/bin/javascript-petstore.sh +++ b/bin/javascript-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/Javascript -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l javascript -o samples/client/petstore/javascript" +ags="$@ generate -t modules/swagger-codegen/src/main/resources/Javascript -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l javascript -o samples/client/petstore/javascript -DappName=PetstoreClient" -java -DappName=PetstoreClient $JAVA_OPTS -jar $executable $ags +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/javascript-promise-es6-petstore.sh b/bin/javascript-promise-es6-petstore.sh index 177c3f5d89a..e88788ddde5 100755 --- a/bin/javascript-promise-es6-petstore.sh +++ b/bin/javascript-promise-es6-petstore.sh @@ -26,7 +26,7 @@ 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/Javascript \ +ags="$@ generate -t modules/swagger-codegen/src/main/resources/Javascript/es6 \ -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l javascript \ -o samples/client/petstore/javascript-promise-es6 \ --additional-properties useEs6=true \ diff --git a/bin/javascript-promise-petstore.sh b/bin/javascript-promise-petstore.sh index fac0f221424..40ba5a6c137 100755 --- a/bin/javascript-promise-petstore.sh +++ b/bin/javascript-promise-petstore.sh @@ -26,9 +26,12 @@ 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/Javascript \ --i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l javascript \ +ags="$@ generate \ +-t modules/swagger-codegen/src/main/resources/Javascript \ +-i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml \ +-l javascript \ -o samples/client/petstore/javascript-promise \ ---additional-properties usePromises=true" +--additional-properties usePromises=true \ +-DappName=PetstoreClient" -java -DappName=PetstoreClient $JAVA_OPTS -jar $executable $ags +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/nodejs-petstore-google-cloud-functions.sh b/bin/nodejs-petstore-google-cloud-functions.sh index f5df577b481..21a1f49ba38 100755 --- a/bin/nodejs-petstore-google-cloud-functions.sh +++ b/bin/nodejs-petstore-google-cloud-functions.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 -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l nodejs-server --additional-properties=googleCloudFunctions=true -o samples/server/petstore/nodejs-google-cloud-functions" +ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l nodejs-server --additional-properties=googleCloudFunctions=true -o samples/server/petstore/nodejs-google-cloud-functions -Dservice" -java $JAVA_OPTS -Dservice -jar $executable $ags +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/nodejs-petstore-server.sh b/bin/nodejs-petstore-server.sh index 2d9994f49e5..4abd112408a 100755 --- a/bin/nodejs-petstore-server.sh +++ b/bin/nodejs-petstore-server.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/nodejs -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l nodejs-server -o samples/server/petstore/nodejs" +ags="$@ generate -t modules/swagger-codegen/src/main/resources/nodejs -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l nodejs-server -o samples/server/petstore/nodejs -Dservice" -java $JAVA_OPTS -Dservice -jar $executable $ags +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/objc-petstore-coredata.sh b/bin/objc-petstore-coredata.sh index 8487adfc42b..8fcb5883e6c 100755 --- a/bin/objc-petstore-coredata.sh +++ b/bin/objc-petstore-coredata.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 -DapiDocs=false,modelDocs=false -o samples/client/petstore/objc/core-data --additional-properties coreData=true" +ags="$@ generate -t modules/swagger-codegen/src/main/resources/objc -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l objc -D apiDocs=false -D modelDocs=false -o samples/client/petstore/objc/core-data --additional-properties coreData=true -D appName=PetstoreClient" -java -DappName=PetstoreClient $JAVA_OPTS -jar $executable $ags +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/objc-petstore.sh b/bin/objc-petstore.sh index 71480ff1595..c2bd2f0b228 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/default" +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/default -D appName=PetstoreClient" -java -DappName=PetstoreClient $JAVA_OPTS -jar $executable $ags +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/security/javascript-petstore.sh b/bin/security/javascript-petstore.sh index 7b1443afce4..bab9781ca34 100755 --- a/bin/security/javascript-petstore.sh +++ b/bin/security/javascript-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/Javascript -i modules/swagger-codegen/src/test/resources/2_0/petstore-security-test.yaml -l javascript -o samples/client/petstore-security-test/javascript" +ags="$@ generate -t modules/swagger-codegen/src/main/resources/Javascript -i modules/swagger-codegen/src/test/resources/2_0/petstore-security-test.yaml -l javascript -o samples/client/petstore-security-test/javascript -DappName=PetstoreClient" -java -DappName=PetstoreClient $JAVA_OPTS -jar $executable $ags +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/windows/javascript-petstore.bat b/bin/windows/javascript-petstore.bat index da6ae295a1c..4e5e5530f74 100755 --- a/bin/windows/javascript-petstore.bat +++ b/bin/windows/javascript-petstore.bat @@ -5,6 +5,6 @@ If Not Exist %executable% ( ) REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -l javascript -o samples\client\petstore\javascript +set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -l javascript -o samples\client\petstore\javascript -DappName=PetstoreClient -java -DappName=PetstoreClient %JAVA_OPTS% -jar %executable% %ags% +java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/javascript-promise-petstore.bat b/bin/windows/javascript-promise-petstore.bat index 4179e43d1d8..f8bb90bc719 100755 --- a/bin/windows/javascript-promise-petstore.bat +++ b/bin/windows/javascript-promise-petstore.bat @@ -5,6 +5,6 @@ If Not Exist %executable% ( ) REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -l javascript -o samples\client\petstore\javascript-promise --additional-properties usePromises=true +set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -l javascript -o samples\client\petstore\javascript-promise --additional-properties usePromises=true -DappName=PetstoreClient -java -DappName=PetstoreClient %JAVA_OPTS% -jar %executable% %ags% +java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/objc-petstore.bat b/bin/windows/objc-petstore.bat index 0af6b315ee4..c2c8a127f84 100755 --- a/bin/windows/objc-petstore.bat +++ b/bin/windows/objc-petstore.bat @@ -5,6 +5,6 @@ If Not Exist %executable% ( ) REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore.yaml -l objc -o samples\client\petstore\objc\default +set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore.yaml -l objc -o samples\client\petstore\objc\default -DappName=PetstoreClient -java %JAVA_OPTS% -DappName=PetstoreClient -jar %executable% %ags% +java %JAVA_OPTS% -jar %executable% %ags% diff --git a/modules/swagger-codegen-cli/src/main/java/io/swagger/codegen/cmd/Generate.java b/modules/swagger-codegen-cli/src/main/java/io/swagger/codegen/cmd/Generate.java index 4f0d1b7d6e7..3358499fea2 100644 --- a/modules/swagger-codegen-cli/src/main/java/io/swagger/codegen/cmd/Generate.java +++ b/modules/swagger-codegen-cli/src/main/java/io/swagger/codegen/cmd/Generate.java @@ -12,6 +12,9 @@ import org.slf4j.LoggerFactory; import static io.swagger.codegen.config.CodegenConfiguratorUtils.*; import static org.apache.commons.lang3.StringUtils.isNotEmpty; +import java.util.ArrayList; +import java.util.List; + /** * User: lanwen * Date: 24.03.15 @@ -48,8 +51,8 @@ public class Generate implements Runnable { private String auth; @Option(name = {"-D"}, title = "system properties", description = "sets specified system properties in " + - "the format of name=value,name=value") - private String systemProperties; + "the format of name=value,name=value (or multiple options, each with name=value)") + private List systemProperties = new ArrayList<>(); @Option(name = {"-c", "--config"}, title = "configuration file", description = "Path to json configuration file. " + "File content should be in a json format {\"optionKey\":\"optionValue\", \"optionKey1\":\"optionValue1\"...} " + @@ -229,7 +232,7 @@ public class Generate implements Runnable { configurator.setRemoveOperationIdPrefix(removeOperationIdPrefix); } - applySystemPropertiesKvp(systemProperties, configurator); + applySystemPropertiesKvpList(systemProperties, configurator); applyInstantiationTypesKvp(instantiationTypes, configurator); applyImportMappingsKvp(importMappings, configurator); applyTypeMappingsKvp(typeMappings, configurator); diff --git a/modules/swagger-codegen-cli/src/test/java/io/swagger/codegen/cmd/GenerateTest.java b/modules/swagger-codegen-cli/src/test/java/io/swagger/codegen/cmd/GenerateTest.java index 36a560b776d..37a4ecbaf3d 100644 --- a/modules/swagger-codegen-cli/src/test/java/io/swagger/codegen/cmd/GenerateTest.java +++ b/modules/swagger-codegen-cli/src/test/java/io/swagger/codegen/cmd/GenerateTest.java @@ -114,6 +114,15 @@ public class GenerateTest { times = 1; }}; + setupAndRunGenericTest("-Dhello=world,foo=bar"); + + new FullVerifications() {{ + configurator.addSystemProperty("hello", "world"); + times = 1; + configurator.addSystemProperty("foo", "bar"); + times = 1; + }}; + setupAndRunGenericTest("-D", "hello=world,key=,foo=bar"); new FullVerifications() {{ @@ -121,8 +130,41 @@ public class GenerateTest { times = 1; configurator.addSystemProperty("foo", "bar"); times = 1; - configurator.addSystemProperty("key", anyString); - times = 0; + configurator.addSystemProperty("key", ""); + times = 1; + }}; + + setupAndRunGenericTest("-D", "hello=world,key,foo=bar"); + + new FullVerifications() {{ + configurator.addSystemProperty("hello", "world"); + times = 1; + configurator.addSystemProperty("foo", "bar"); + times = 1; + configurator.addSystemProperty("key", ""); + times = 1; + }}; + + setupAndRunGenericTest("-D", "hello=world", "-D", "key", "-D", "foo=bar"); + + new FullVerifications() {{ + configurator.addSystemProperty("hello", "world"); + times = 1; + configurator.addSystemProperty("foo", "bar"); + times = 1; + configurator.addSystemProperty("key", ""); + times = 1; + }}; + + setupAndRunGenericTest("-Dhello=world", "-Dkey", "-Dfoo=bar"); + + new FullVerifications() {{ + configurator.addSystemProperty("hello", "world"); + times = 1; + configurator.addSystemProperty("foo", "bar"); + times = 1; + configurator.addSystemProperty("key", ""); + times = 1; }}; } @@ -183,8 +225,8 @@ public class GenerateTest { times = 1; configurator.addInstantiationType("foo", "bar"); times = 1; - configurator.addInstantiationType("key", anyString); - times = 0; + configurator.addInstantiationType("key", ""); + times = 1; }}; } @@ -197,8 +239,8 @@ public class GenerateTest { times = 1; configurator.addTypeMapping("foo", "bar"); times = 1; - configurator.addTypeMapping("key", anyString); - times = 0; + configurator.addTypeMapping("key", ""); + times = 1; }}; } @@ -211,8 +253,8 @@ public class GenerateTest { times = 1; configurator.addAdditionalProperty("foo", "bar"); times = 1; - configurator.addAdditionalProperty("key", anyString); - times = 0; + configurator.addAdditionalProperty("key", ""); + times = 1; }}; } @@ -241,8 +283,8 @@ public class GenerateTest { times = 1; configurator.addImportMapping("foo", "bar"); times = 1; - configurator.addImportMapping("key", anyString); - times = 0; + configurator.addImportMapping("key", ""); + times = 1; }}; } diff --git a/modules/swagger-codegen-cli/src/test/java/io/swagger/codegen/cmd/utils/OptionUtilsTest.java b/modules/swagger-codegen-cli/src/test/java/io/swagger/codegen/cmd/utils/OptionUtilsTest.java index db88cdcdb9d..ec26a84be9d 100644 --- a/modules/swagger-codegen-cli/src/test/java/io/swagger/codegen/cmd/utils/OptionUtilsTest.java +++ b/modules/swagger-codegen-cli/src/test/java/io/swagger/codegen/cmd/utils/OptionUtilsTest.java @@ -2,12 +2,12 @@ package io.swagger.codegen.cmd.utils; import io.swagger.codegen.utils.OptionUtils; import org.apache.commons.lang3.tuple.Pair; -import org.junit.Test; +import org.testng.annotations.Test; -import java.util.ArrayList; -import java.util.Arrays; +import java.util.Collections; import java.util.List; +import static java.util.Arrays.asList; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertNotNull; @@ -16,39 +16,40 @@ public class OptionUtilsTest { @Test public void splitCommaSeparatedList() throws Exception { - doCommaSeparatedListTest("a,b,c", Arrays.asList("a", "b", "c")); - doCommaSeparatedListTest("a,,c", Arrays.asList("a", "c")); - doCommaSeparatedListTest("", new ArrayList()); - doCommaSeparatedListTest(null, new ArrayList()); + doCommaSeparatedListTest("a,b,c", asList("a", "b", "c")); + doCommaSeparatedListTest("a,,c", asList("a", "c")); + doCommaSeparatedListTest("", emptyList()); + doCommaSeparatedListTest(null, emptyList()); } @Test public void testParseCommaSeparatedTuples() throws Exception { - doTupleListTest("a=1,b=2,c=3", Arrays.asList(Pair.of("a", "1"), Pair.of("b", "2"), Pair.of("c", "3"))); - doTupleListTest("a=1,,c=3", Arrays.asList(Pair.of("a", "1"), Pair.of("c", "3"))); - doTupleListTest("a=1,xyz,c=3", Arrays.asList(Pair.of("a", "1"), Pair.of("c", "3"))); - doTupleListTest("a=1,=,c=3", Arrays.asList(Pair.of("a", "1"), Pair.of("c", "3"))); - doTupleListTest("", new ArrayList>()); - doTupleListTest(null, new ArrayList>()); + doTupleListTest("a=1,b=2,c=3", asList(Pair.of("a", "1"), Pair.of("b", "2"), Pair.of("c", "3"))); + doTupleListTest("xyz", asList(Pair.of("xyz", ""))); + doTupleListTest("a=1,,c=3", asList(Pair.of("a", "1"), Pair.of("c", "3"))); + doTupleListTest("a=1,xyz=,c=3", asList(Pair.of("a", "1"), Pair.of("xyz", ""), Pair.of("c", "3"))); + doTupleListTest("a=1,xyz,c=3", asList(Pair.of("a", "1"), Pair.of("xyz", ""), Pair.of("c", "3"))); + doTupleListTest("a=1,=,c=3", asList(Pair.of("a", "1"), Pair.of("c", "3"))); + doTupleListTest("", emptyPairList()); + doTupleListTest(null, emptyPairList()); } - + private static void doTupleListTest(String input, List> expectedResults) { final List> result = OptionUtils.parseCommaSeparatedTuples(input); assertNotNull(result); - assertEquals(result.size(), expectedResults.size()); - for (int i = 0; i < expectedResults.size(); i++) { - final Pair actualPair = result.get(i); - final Pair expected = expectedResults.get(i); - assertEquals(actualPair, expected); - } + assertEquals(result, expectedResults); } private static void doCommaSeparatedListTest(String csvStr, List expectedResults) { final List result = OptionUtils.splitCommaSeparatedList(csvStr); assertNotNull(result); - assertEquals(result.size(), expectedResults.size()); - for (int i = 0; i < expectedResults.size(); i++) { - assertEquals(result.get(i), expectedResults.get(i)); - } + assertEquals(result, expectedResults); + } + private static List> emptyPairList() { + return Collections.emptyList(); + } + + private static List emptyList() { + return Collections.emptyList(); } } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/config/CodegenConfiguratorUtils.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/config/CodegenConfiguratorUtils.java index 90a96837797..af6d53c62ea 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/config/CodegenConfiguratorUtils.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/config/CodegenConfiguratorUtils.java @@ -16,6 +16,12 @@ import java.util.*; */ public final class CodegenConfiguratorUtils { + public static void applySystemPropertiesKvpList(List systemProperties, CodegenConfigurator configurator) { + for(String propString : systemProperties) { + applySystemPropertiesKvp(propString, configurator); + } + } + public static void applySystemPropertiesKvp(String systemProperties, CodegenConfigurator configurator) { final Map map = createMapFromKeyValuePairs(systemProperties); for (Map.Entry entry : map.entrySet()) { @@ -81,6 +87,4 @@ public final class CodegenConfiguratorUtils { return result; } - - } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/FlaskConnexionCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/FlaskConnexionCodegen.java index cf4b7a5b5c8..bf1d638bc5e 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/FlaskConnexionCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/FlaskConnexionCodegen.java @@ -433,6 +433,10 @@ public class FlaskConnexionCodegen extends DefaultCodegen implements CodegenConf @Override public String toParamName(String name) { + // don't do name =removeNonNameElementToCamelCase(name); // this breaks connexion, which does not modify param names before sending them + if (reservedWords.contains(name)) { + return escapeReservedWord(name); + } // Param name is already sanitized in swagger spec processing return name; } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavascriptClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavascriptClientCodegen.java index 854f0838925..88d8ef0e550 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavascriptClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavascriptClientCodegen.java @@ -105,7 +105,8 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo modelTestTemplateFiles.put("model_test.mustache", ".js"); apiTemplateFiles.put("api.mustache", ".js"); apiTestTemplateFiles.put("api_test.mustache", ".js"); - embeddedTemplateDir = templateDir = "Javascript"; + // subfolder Javascript/es6 + embeddedTemplateDir = templateDir = "Javascript" + File.separator + "es6"; apiPackage = "api"; modelPackage = "model"; modelDocTemplateFiles.put("model_doc.mustache", ".md"); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/Swift3Codegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/Swift3Codegen.java index 1002b2e14c5..4461fc4ea01 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/Swift3Codegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/Swift3Codegen.java @@ -235,6 +235,7 @@ public class Swift3Codegen extends DefaultCodegen implements CodegenConfig { supportingFiles.add(new SupportingFile("APIHelper.mustache", sourceFolder, "APIHelper.swift")); supportingFiles.add(new SupportingFile("AlamofireImplementations.mustache", sourceFolder, "AlamofireImplementations.swift")); + supportingFiles.add(new SupportingFile("Configuration.mustache", sourceFolder, "Configuration.swift")); supportingFiles.add(new SupportingFile("Extensions.mustache", sourceFolder, "Extensions.swift")); supportingFiles.add(new SupportingFile("Models.mustache", sourceFolder, "Models.swift")); supportingFiles.add(new SupportingFile("APIs.mustache", sourceFolder, "APIs.swift")); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/TypeScriptAngular2ClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/TypeScriptAngular2ClientCodegen.java index 8ad64c74c28..cdbb378152c 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/TypeScriptAngular2ClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/TypeScriptAngular2ClientCodegen.java @@ -29,14 +29,11 @@ public class TypeScriptAngular2ClientCodegen extends AbstractTypeScriptClientCod public static final String NPM_VERSION = "npmVersion"; public static final String NPM_REPOSITORY = "npmRepository"; public static final String SNAPSHOT = "snapshot"; - public static final String USE_OPAQUE_TOKEN = "useOpaqueToken"; - public static final String INJECTION_TOKEN = "injectionToken"; public static final String WITH_INTERFACES = "withInterfaces"; protected String npmName = null; protected String npmVersion = "1.0.0"; protected String npmRepository = null; - protected String injectionToken = "InjectionToken"; public TypeScriptAngular2ClientCodegen() { super(); @@ -55,7 +52,6 @@ public class TypeScriptAngular2ClientCodegen extends AbstractTypeScriptClientCod this.cliOptions.add(new CliOption(NPM_VERSION, "The version of your npm package")); this.cliOptions.add(new CliOption(NPM_REPOSITORY, "Use this property to set an url your private npmRepo in the package.json")); this.cliOptions.add(new CliOption(SNAPSHOT, "When setting this property to true the version will be suffixed with -SNAPSHOT.yyyyMMddHHmm", BooleanProperty.TYPE).defaultValue(Boolean.FALSE.toString())); - this.cliOptions.add(new CliOption(USE_OPAQUE_TOKEN, "When setting this property to true, OpaqueToken is used instead of InjectionToken", BooleanProperty.TYPE).defaultValue(Boolean.FALSE.toString())); this.cliOptions.add(new CliOption(WITH_INTERFACES, "Setting this property to true will generate interfaces next to the default class implementations.", BooleanProperty.TYPE).defaultValue(Boolean.FALSE.toString())); } @@ -92,11 +88,6 @@ public class TypeScriptAngular2ClientCodegen extends AbstractTypeScriptClientCod addNpmPackageGeneration(); } - if(additionalProperties.containsKey(USE_OPAQUE_TOKEN) && Boolean.valueOf(additionalProperties.get(USE_OPAQUE_TOKEN).toString())) { - this.setOpaqueToken(); - } - additionalProperties.put(INJECTION_TOKEN, this.injectionToken); - if(additionalProperties.containsKey(WITH_INTERFACES)) { boolean withInterfaces = Boolean.parseBoolean(additionalProperties.get(WITH_INTERFACES).toString()); if (withInterfaces) { @@ -338,7 +329,4 @@ public class TypeScriptAngular2ClientCodegen extends AbstractTypeScriptClientCod return camelize(name); } - public void setOpaqueToken() { - this.injectionToken = "OpaqueToken"; - } } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/utils/OptionUtils.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/utils/OptionUtils.java index 27322b4554f..01dd03732b2 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/utils/OptionUtils.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/utils/OptionUtils.java @@ -2,28 +2,29 @@ package io.swagger.codegen.utils; import org.apache.commons.lang3.tuple.Pair; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import joptsimple.internal.Strings; import static org.apache.commons.lang3.StringUtils.isNotEmpty; public class OptionUtils { - public static List> parseCommaSeparatedTuples(String input) { + public static List> parseCommaSeparatedTuples(final String input) { - List> results = new ArrayList>(); + final List> results = new ArrayList>(); final List tuples = splitCommaSeparatedList(input); for (String tuple : tuples) { int ix = tuple.indexOf('='); - if (ix > 0 && ix < tuple.length() - 1) { + if (ix > 0 && ix <= tuple.length() - 1) { final Pair pair = Pair.of(tuple.substring(0, ix), tuple.substring(ix + 1)); results.add(pair); + } else if (ix < 0){ + final Pair pair = Pair.of(tuple, ""); + results.add(pair); } } - //Strings.isNullOrEmpty(input) + return results; } diff --git a/modules/swagger-codegen/src/main/resources/Javascript-es6/.babelrc.mustache b/modules/swagger-codegen/src/main/resources/Javascript/es6/.babelrc.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/Javascript-es6/.babelrc.mustache rename to modules/swagger-codegen/src/main/resources/Javascript/es6/.babelrc.mustache diff --git a/modules/swagger-codegen/src/main/resources/Javascript-es6/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/Javascript/es6/ApiClient.mustache similarity index 97% rename from modules/swagger-codegen/src/main/resources/Javascript-es6/ApiClient.mustache rename to modules/swagger-codegen/src/main/resources/Javascript/es6/ApiClient.mustache index 22cd56bd12c..17e9000179d 100644 --- a/modules/swagger-codegen/src/main/resources/Javascript-es6/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/Javascript/es6/ApiClient.mustache @@ -347,7 +347,7 @@ export default class ApiClient { data = response.text; } - return exports.convertToType(data, returnType); + return ApiClient.convertToType(data, returnType); } {{#emitJSDoc}}{{^usePromises}}/** @@ -449,7 +449,7 @@ export default class ApiClient { } {{#usePromises}}return new Promise((resolve, reject) => { - request.end(function(error, response) { + request.end((error, response) => { if (error) { reject(error); } else { @@ -521,7 +521,7 @@ export default class ApiClient { case 'String': return String(data); case 'Date': - return this.parseDate(String(data)); + return ApiClient.parseDate(String(data)); case 'Blob': return data; default: @@ -536,7 +536,7 @@ export default class ApiClient { var itemType = type[0]; return data.map((item) => { - return exports.convertToType(item, itemType); + return ApiClient.convertToType(item, itemType); }); } else if (typeof type === 'object') { // for plain object type like: {'String': 'Integer'} @@ -552,8 +552,8 @@ export default class ApiClient { var result = {}; for (var k in data) { if (data.hasOwnProperty(k)) { - var key = exports.convertToType(k, keyType); - var value = exports.convertToType(data[k], valueType); + var key = ApiClient.convertToType(k, keyType); + var value = ApiClient.convertToType(data[k], valueType); result[key] = value; } } @@ -575,12 +575,12 @@ export default class ApiClient { if (Array.isArray(data)) { for (var i = 0; i < data.length; i++) { if (data.hasOwnProperty(i)) - obj[i] = exports.convertToType(data[i], itemType); + obj[i] = ApiClient.convertToType(data[i], itemType); } } else { for (var k in data) { if (data.hasOwnProperty(k)) - obj[k] = exports.convertToType(data[k], itemType); + obj[k] = ApiClient.convertToType(data[k], itemType); } } }; diff --git a/modules/swagger-codegen/src/main/resources/Javascript-es6/README.mustache b/modules/swagger-codegen/src/main/resources/Javascript/es6/README.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/Javascript-es6/README.mustache rename to modules/swagger-codegen/src/main/resources/Javascript/es6/README.mustache diff --git a/modules/swagger-codegen/src/main/resources/Javascript-es6/api.mustache b/modules/swagger-codegen/src/main/resources/Javascript/es6/api.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/Javascript-es6/api.mustache rename to modules/swagger-codegen/src/main/resources/Javascript/es6/api.mustache diff --git a/modules/swagger-codegen/src/main/resources/Javascript-es6/api_doc.mustache b/modules/swagger-codegen/src/main/resources/Javascript/es6/api_doc.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/Javascript-es6/api_doc.mustache rename to modules/swagger-codegen/src/main/resources/Javascript/es6/api_doc.mustache diff --git a/modules/swagger-codegen/src/main/resources/Javascript-es6/api_test.mustache b/modules/swagger-codegen/src/main/resources/Javascript/es6/api_test.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/Javascript-es6/api_test.mustache rename to modules/swagger-codegen/src/main/resources/Javascript/es6/api_test.mustache diff --git a/modules/swagger-codegen/src/main/resources/Javascript-es6/enumClass.mustache b/modules/swagger-codegen/src/main/resources/Javascript/es6/enumClass.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/Javascript-es6/enumClass.mustache rename to modules/swagger-codegen/src/main/resources/Javascript/es6/enumClass.mustache diff --git a/modules/swagger-codegen/src/main/resources/Javascript-es6/git_push.sh.mustache b/modules/swagger-codegen/src/main/resources/Javascript/es6/git_push.sh.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/Javascript-es6/git_push.sh.mustache rename to modules/swagger-codegen/src/main/resources/Javascript/es6/git_push.sh.mustache diff --git a/modules/swagger-codegen/src/main/resources/Javascript-es6/gitignore.mustache b/modules/swagger-codegen/src/main/resources/Javascript/es6/gitignore.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/Javascript-es6/gitignore.mustache rename to modules/swagger-codegen/src/main/resources/Javascript/es6/gitignore.mustache diff --git a/modules/swagger-codegen/src/main/resources/Javascript-es6/index.mustache b/modules/swagger-codegen/src/main/resources/Javascript/es6/index.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/Javascript-es6/index.mustache rename to modules/swagger-codegen/src/main/resources/Javascript/es6/index.mustache diff --git a/modules/swagger-codegen/src/main/resources/Javascript-es6/licenseInfo.mustache b/modules/swagger-codegen/src/main/resources/Javascript/es6/licenseInfo.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/Javascript-es6/licenseInfo.mustache rename to modules/swagger-codegen/src/main/resources/Javascript/es6/licenseInfo.mustache diff --git a/modules/swagger-codegen/src/main/resources/Javascript-es6/mocha.opts b/modules/swagger-codegen/src/main/resources/Javascript/es6/mocha.opts similarity index 100% rename from modules/swagger-codegen/src/main/resources/Javascript-es6/mocha.opts rename to modules/swagger-codegen/src/main/resources/Javascript/es6/mocha.opts diff --git a/modules/swagger-codegen/src/main/resources/Javascript-es6/model.mustache b/modules/swagger-codegen/src/main/resources/Javascript/es6/model.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/Javascript-es6/model.mustache rename to modules/swagger-codegen/src/main/resources/Javascript/es6/model.mustache diff --git a/modules/swagger-codegen/src/main/resources/Javascript-es6/model_doc.mustache b/modules/swagger-codegen/src/main/resources/Javascript/es6/model_doc.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/Javascript-es6/model_doc.mustache rename to modules/swagger-codegen/src/main/resources/Javascript/es6/model_doc.mustache diff --git a/modules/swagger-codegen/src/main/resources/Javascript-es6/model_test.mustache b/modules/swagger-codegen/src/main/resources/Javascript/es6/model_test.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/Javascript-es6/model_test.mustache rename to modules/swagger-codegen/src/main/resources/Javascript/es6/model_test.mustache diff --git a/modules/swagger-codegen/src/main/resources/Javascript-es6/package.mustache b/modules/swagger-codegen/src/main/resources/Javascript/es6/package.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/Javascript-es6/package.mustache rename to modules/swagger-codegen/src/main/resources/Javascript/es6/package.mustache diff --git a/modules/swagger-codegen/src/main/resources/Javascript-es6/partial_model_enum_class.mustache b/modules/swagger-codegen/src/main/resources/Javascript/es6/partial_model_enum_class.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/Javascript-es6/partial_model_enum_class.mustache rename to modules/swagger-codegen/src/main/resources/Javascript/es6/partial_model_enum_class.mustache diff --git a/modules/swagger-codegen/src/main/resources/Javascript-es6/partial_model_generic.mustache b/modules/swagger-codegen/src/main/resources/Javascript/es6/partial_model_generic.mustache similarity index 97% rename from modules/swagger-codegen/src/main/resources/Javascript-es6/partial_model_generic.mustache rename to modules/swagger-codegen/src/main/resources/Javascript/es6/partial_model_generic.mustache index 7fbfebecf13..5ba893a4542 100644 --- a/modules/swagger-codegen/src/main/resources/Javascript-es6/partial_model_generic.mustache +++ b/modules/swagger-codegen/src/main/resources/Javascript/es6/partial_model_generic.mustache @@ -20,7 +20,7 @@ export default class {{classname}} { constructor({{#vendorExtensions.x-all-required}}{{name}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-all-required}}) { {{#parent}}{{^parentModel}}{{#vendorExtensions.x-isArray}} this = new Array(); - Object.setPrototypeOf(this, exports);{{/vendorExtensions.x-isArray}}{{/parentModel}}{{/parent}} + Object.setPrototypeOf(this, {{classname}});{{/vendorExtensions.x-isArray}}{{/parentModel}}{{/parent}} {{#useInheritance}} {{#parentModel}}{{classname}}.call(this{{#vendorExtensions.x-all-required}}, {{name}}{{/vendorExtensions.x-all-required}});{{/parentModel}} @@ -41,7 +41,7 @@ export default class {{classname}} { */{{/emitJSDoc}} static constructFromObject(data, obj) { if (data){{! TODO: support polymorphism: discriminator property on data determines class to instantiate.}} { - obj = obj || new exports(); + obj = obj || new {{classname}}(); {{#parent}}{{^parentModel}}ApiClient.constructFromObject(data, obj, '{{vendorExtensions.x-itemType}}');{{/parentModel}} {{/parent}} diff --git a/modules/swagger-codegen/src/main/resources/Javascript-es6/partial_model_inner_enum.mustache b/modules/swagger-codegen/src/main/resources/Javascript/es6/partial_model_inner_enum.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/Javascript-es6/partial_model_inner_enum.mustache rename to modules/swagger-codegen/src/main/resources/Javascript/es6/partial_model_inner_enum.mustache diff --git a/modules/swagger-codegen/src/main/resources/Javascript-es6/travis.yml b/modules/swagger-codegen/src/main/resources/Javascript/es6/travis.yml similarity index 100% rename from modules/swagger-codegen/src/main/resources/Javascript-es6/travis.yml rename to modules/swagger-codegen/src/main/resources/Javascript/es6/travis.yml diff --git a/modules/swagger-codegen/src/main/resources/cpprest/model-source.mustache b/modules/swagger-codegen/src/main/resources/cpprest/model-source.mustache index 33a35a908a2..1830651b368 100644 --- a/modules/swagger-codegen/src/main/resources/cpprest/model-source.mustache +++ b/modules/swagger-codegen/src/main/resources/cpprest/model-source.mustache @@ -9,11 +9,26 @@ namespace {{this}} { {{classname}}::{{classname}}() { - {{#vars}}{{^isInherited}}{{#isNotContainer}}{{#isPrimitiveType}}m_{{name}} = {{{defaultValue}}}; - {{/isPrimitiveType}}{{^isPrimitiveType}}{{#isString}}m_{{name}} = {{{defaultValue}}}; - {{/isString}}{{#isDateTime}}m_{{name}} = {{{defaultValue}}}; - {{/isDateTime}}{{/isPrimitiveType}}{{/isNotContainer}}{{^required}}m_{{name}}IsSet = false; - {{/required}}{{/isInherited}}{{/vars}} + {{#vars}} + {{^isInherited}} + {{#isNotContainer}} + {{#isPrimitiveType}} + m_{{name}} = {{{defaultValue}}}; + {{/isPrimitiveType}} + {{^isPrimitiveType}} + {{#isString}} + m_{{name}} = {{{defaultValue}}}; + {{/isString}} + {{#isDateTime}} + m_{{name}} = {{{defaultValue}}}; + {{/isDateTime}} + {{/isPrimitiveType}} + {{/isNotContainer}} + {{^required}} + m_{{name}}IsSet = false; + {{/required}} + {{/isInherited}} + {{/vars}} } {{classname}}::~{{classname}}() @@ -27,59 +42,108 @@ void {{classname}}::validate() web::json::value {{classname}}::toJson() const { - {{#parent}}web::json::value val = this->{{{parent}}}::toJson(); {{/parent}} - {{^parent}}web::json::value val = web::json::value::object();{{/parent}} + {{#parent}} + web::json::value val = this->{{{parent}}}::toJson(); + {{/parent}} + {{^parent}} + web::json::value val = web::json::value::object(); + {{/parent}} - {{#vars}}{{^isInherited}}{{#isPrimitiveType}}{{^isListContainer}}{{^required}}if(m_{{name}}IsSet) + {{#vars}} + {{^isInherited}} + {{#isPrimitiveType}} + {{^isListContainer}} + {{^required}} + if(m_{{name}}IsSet) { val[U("{{baseName}}")] = ModelBase::toJson(m_{{name}}); } - {{/required}}{{#required}}val[U("{{baseName}}")] = ModelBase::toJson(m_{{name}}); - {{/required}}{{/isListContainer}}{{/isPrimitiveType}}{{#isListContainer}}{ + {{/required}} + {{#required}} + val[U("{{baseName}}")] = ModelBase::toJson(m_{{name}}); + {{/required}} + {{/isListContainer}} + {{/isPrimitiveType}} + {{#isListContainer}} + { std::vector jsonArray; for( auto& item : m_{{name}} ) { jsonArray.push_back(ModelBase::toJson(item)); } - {{#required}}val[U("{{baseName}}")] = web::json::value::array(jsonArray); - {{/required}}{{^required}} + {{#required}} + val[U("{{baseName}}")] = web::json::value::array(jsonArray); + {{/required}} + {{^required}} if(jsonArray.size() > 0) { val[U("{{baseName}}")] = web::json::value::array(jsonArray); } {{/required}} } - {{/isListContainer}}{{^isListContainer}}{{^isPrimitiveType}}{{^required}}if(m_{{name}}IsSet) + {{/isListContainer}} + {{^isListContainer}} + {{^isPrimitiveType}} + {{^required}} + if(m_{{name}}IsSet) { val[U("{{baseName}}")] = ModelBase::toJson(m_{{name}}); } - {{/required}}{{#required}}val[U("{{baseName}}")] = ModelBase::toJson(m_{{name}}); - {{/required}}{{/isPrimitiveType}}{{/isListContainer}}{{/isInherited}}{{/vars}} + {{/required}} + {{#required}} + val[U("{{baseName}}")] = ModelBase::toJson(m_{{name}}); + {{/required}} + {{/isPrimitiveType}} + {{/isListContainer}} + {{/isInherited}} + {{/vars}} return val; } void {{classname}}::fromJson(web::json::value& val) { - {{#parent}}this->{{{parent}}}::fromJson(val); {{/parent}} + {{#parent}} + this->{{{parent}}}::fromJson(val); - {{#vars}}{{^isInherited}}{{#isPrimitiveType}}{{^isListContainer}}{{^required}}if(val.has_field(U("{{baseName}}"))) + {{/parent}} + {{#vars}} + {{^isInherited}} + {{#isPrimitiveType}} + {{^isListContainer}} + {{^required}} + if(val.has_field(U("{{baseName}}"))) { {{setter}}(ModelBase::{{baseType}}FromJson(val[U("{{baseName}}")])); } - {{/required}}{{#required}}{{setter}}(ModelBase::{{baseType}}FromJson(val[U("{{baseName}}")])); - {{/required}}{{/isListContainer}}{{/isPrimitiveType}}{{#isListContainer}}{ + {{/required}} + {{#required}} + {{setter}}(ModelBase::{{baseType}}FromJson(val[U("{{baseName}}")])); + {{/required}} + {{/isListContainer}} + {{/isPrimitiveType}} + {{#isListContainer}} + { m_{{name}}.clear(); std::vector jsonArray; - {{^required}}if(val.has_field(U("{{baseName}}"))) + {{^required}} + if(val.has_field(U("{{baseName}}"))) { {{/required}} for( auto& item : val[U("{{baseName}}")].as_array() ) { - {{#isPrimitiveType}}m_{{name}}.push_back(ModelBase::{{items.baseType}}FromJson(item)); - {{/isPrimitiveType}}{{^isPrimitiveType}}{{#items.isString}}m_{{name}}.push_back(ModelBase::stringFromJson(item)); - {{/items.isString}}{{^items.isString}}{{#items.isDateTime}}m_{{name}}.push_back(ModelBase::dateFromJson(item)); - {{/items.isDateTime}}{{^items.isDateTime}} + {{#isPrimitiveType}} + m_{{name}}.push_back(ModelBase::{{items.baseType}}FromJson(item)); + {{/isPrimitiveType}} + {{^isPrimitiveType}} + {{#items.isString}} + m_{{name}}.push_back(ModelBase::stringFromJson(item)); + {{/items.isString}} + {{^items.isString}} + {{#items.isDateTime}} + m_{{name}}.push_back(ModelBase::dateFromJson(item)); + {{/items.isDateTime}} + {{^items.isDateTime}} if(item.is_null()) { m_{{name}}.push_back( {{{items.datatype}}}(nullptr) ); @@ -90,31 +154,63 @@ void {{classname}}::fromJson(web::json::value& val) newItem->fromJson(item); m_{{name}}.push_back( newItem ); } - {{/items.isDateTime}}{{/items.isString}}{{/isPrimitiveType}} + {{/items.isDateTime}} + {{/items.isString}} + {{/isPrimitiveType}} } {{^required}} } {{/required}} } - {{/isListContainer}}{{^isListContainer}}{{^isPrimitiveType}}{{^required}}if(val.has_field(U("{{baseName}}"))) + {{/isListContainer}} + {{^isListContainer}} + {{^isPrimitiveType}} + {{^required}} + if(val.has_field(U("{{baseName}}"))) { - {{#isString}}{{setter}}(ModelBase::stringFromJson(val[U("{{baseName}}")])); - {{/isString}}{{^isString}}{{#isDateTime}}{{setter}}(ModelBase::dateFromJson(val[U("{{baseName}}")])); - {{/isDateTime}}{{^isDateTime}}if(!val[U("{{baseName}}")].is_null()) + {{#isString}} + {{setter}}(ModelBase::stringFromJson(val[U("{{baseName}}")])); + {{/isString}} + {{^isString}} + {{#isDateTime}} + {{setter}}(ModelBase::dateFromJson(val[U("{{baseName}}")])); + {{/isDateTime}} + {{^isDateTime}} + if(!val[U("{{baseName}}")].is_null()) { {{{datatype}}} newItem({{{defaultValue}}}); newItem->fromJson(val[U("{{baseName}}")]); {{setter}}( newItem ); } - {{/isDateTime}}{{/isString}} + {{/isDateTime}} + {{/isString}} } - {{/required}}{{#required}}{{#isString}}{{setter}}(ModelBase::stringFromJson(val[U("{{baseName}}")])); - {{/isString}}{{^isString}}{{#isDateTime}}{{setter}}(ModelBase::dateFromJson(val[U("{{baseName}}")])); - {{/isDateTime}}{{^isDateTime}}{{#vendorExtensions.x-codegen-file}}{{setter}}(ModelBase::fileFromJson(val[U("{{baseName}}")])); - {{/vendorExtensions.x-codegen-file}}{{^vendorExtensions.x-codegen-file}}{{{datatype}}} new{{name}}({{{defaultValue}}}); + {{/required}} + {{#required}} + {{#isString}} + {{setter}}(ModelBase::stringFromJson(val[U("{{baseName}}")])); + {{/isString}} + {{^isString}} + {{#isDateTime}} + {{setter}} + (ModelBase::dateFromJson(val[U("{{baseName}}")])); + {{/isDateTime}} + {{^isDateTime}} + {{#vendorExtensions.x-codegen-file}} + {{setter}}(ModelBase::fileFromJson(val[U("{{baseName}}")])); + {{/vendorExtensions.x-codegen-file}} + {{^vendorExtensions.x-codegen-file}} + {{{datatype}}} new{{name}}({{{defaultValue}}}); new{{name}}->fromJson(val[U("{{baseName}}")]); {{setter}}( new{{name}} ); - {{/vendorExtensions.x-codegen-file}}{{/isDateTime}}{{/isString}}{{/required}}{{/isPrimitiveType}}{{/isListContainer}}{{/isInherited}}{{/vars}} + {{/vendorExtensions.x-codegen-file}} + {{/isDateTime}} + {{/isString}} + {{/required}} + {{/isPrimitiveType}} + {{/isListContainer}} + {{/isInherited}} + {{/vars}} } void {{classname}}::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const @@ -125,12 +221,22 @@ void {{classname}}::toMultipart(std::shared_ptr multipart, co namePrefix += U("."); } - {{#vars}}{{#isPrimitiveType}}{{^isListContainer}}{{^required}}if(m_{{name}}IsSet) + {{#vars}} + {{#isPrimitiveType}} + {{^isListContainer}} + {{^required}} + if(m_{{name}}IsSet) { multipart->add(ModelBase::toHttpContent(namePrefix + U("{{baseName}}"), m_{{name}})); } - {{/required}}{{#required}}multipart->add(ModelBase::toHttpContent(namePrefix + U("{{baseName}}"), m_{{name}})); - {{/required}}{{/isListContainer}}{{/isPrimitiveType}}{{#isListContainer}}{ + {{/required}} + {{#required}} + multipart->add(ModelBase::toHttpContent(namePrefix + U("{{baseName}}"), m_{{name}})); + {{/required}} + {{/isListContainer}} + {{/isPrimitiveType}} + {{#isListContainer}} + { std::vector jsonArray; for( auto& item : m_{{name}} ) { @@ -144,7 +250,11 @@ void {{classname}}::toMultipart(std::shared_ptr multipart, co } {{/required}} } - {{/isListContainer}}{{^isListContainer}}{{^isPrimitiveType}}{{^required}}if(m_{{name}}IsSet) + {{/isListContainer}} + {{^isListContainer}} + {{^isPrimitiveType}} + {{^required}} + if(m_{{name}}IsSet) { {{#isString}}multipart->add(ModelBase::toHttpContent(namePrefix + U("{{baseName}}"), m_{{name}})); {{/isString}}{{^isString}}{{#isDateTime}}multipart->add(ModelBase::toHttpContent(namePrefix + U("{{baseName}}"), m_{{name}})); @@ -154,11 +264,28 @@ void {{classname}}::toMultipart(std::shared_ptr multipart, co } {{/isDateTime}}{{/isString}} } - {{/required}}{{#required}}{{#isString}}multipart->add(ModelBase::toHttpContent(namePrefix + U("{{baseName}}"), m_{{name}})); - {{/isString}}{{^isString}}{{#isDateTime}}multipart->add(ModelBase::toHttpContent(namePrefix + U("{{baseName}}"), m_{{name}})); - {{/isDateTime}}{{^isDateTime}}{{#vendorExtensions.x-codegen-file}}multipart->add(ModelBase::toHttpContent(namePrefix + U("{{baseName}}"), m_{{name}})); - {{/vendorExtensions.x-codegen-file}}{{^vendorExtensions.x-codegen-file}}m_{{name}}->toMultipart(multipart, U("{{baseName}}.")); - {{/vendorExtensions.x-codegen-file}}{{/isDateTime}}{{/isString}}{{/required}}{{/isPrimitiveType}}{{/isListContainer}}{{/vars}} + {{/required}} + {{#required}} + {{#isString}} + multipart->add(ModelBase::toHttpContent(namePrefix + U("{{baseName}}"), m_{{name}})); + {{/isString}} + {{^isString}} + {{#isDateTime}} + multipart->add(ModelBase::toHttpContent(namePrefix + U("{{baseName}}"), m_{{name}})); + {{/isDateTime}} + {{^isDateTime}} + {{#vendorExtensions.x-codegen-file}} + multipart->add(ModelBase::toHttpContent(namePrefix + U("{{baseName}}"), m_{{name}})); + {{/vendorExtensions.x-codegen-file}} + {{^vendorExtensions.x-codegen-file}} + m_{{name}}->toMultipart(multipart, U("{{baseName}}.")); + {{/vendorExtensions.x-codegen-file}} + {{/isDateTime}} + {{/isString}} + {{/required}} + {{/isPrimitiveType}} + {{/isListContainer}} + {{/vars}} } void {{classname}}::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) @@ -169,24 +296,43 @@ void {{classname}}::fromMultiPart(std::shared_ptr multipart, namePrefix += U("."); } - {{#vars}}{{#isPrimitiveType}}{{^isListContainer}}{{^required}}if(multipart->hasContent(U("{{baseName}}"))) + {{#vars}} + {{#isPrimitiveType}} + {{^isListContainer}} + {{^required}} + if(multipart->hasContent(U("{{baseName}}"))) { {{setter}}(ModelBase::{{baseType}}FromHttpContent(multipart->getContent(U("{{baseName}}")))); } - {{/required}}{{#required}}{{setter}}(ModelBase::{{baseType}}FromHttpContent(multipart->getContent(U("{{baseName}}")))); - {{/required}}{{/isListContainer}}{{/isPrimitiveType}}{{#isListContainer}}{ + {{/required}} + {{#required}} + {{setter}}(ModelBase::{{baseType}}FromHttpContent(multipart->getContent(U("{{baseName}}")))); + {{/required}} + {{/isListContainer}} + {{/isPrimitiveType}} + {{#isListContainer}} + { m_{{name}}.clear(); - {{^required}}if(multipart->hasContent(U("{{baseName}}"))) + {{^required}} + if(multipart->hasContent(U("{{baseName}}"))) { {{/required}} web::json::value jsonArray = web::json::value::parse(ModelBase::stringFromHttpContent(multipart->getContent(U("{{baseName}}")))); for( auto& item : jsonArray.as_array() ) { - {{#isPrimitiveType}}m_{{name}}.push_back(ModelBase::{{items.baseType}}FromJson(item)); - {{/isPrimitiveType}}{{^isPrimitiveType}}{{#items.isString}}m_{{name}}.push_back(ModelBase::stringFromJson(item)); - {{/items.isString}}{{^items.isString}}{{#items.isDateTime}}m_{{name}}.push_back(ModelBase::dateFromJson(item)); - {{/items.isDateTime}}{{^items.isDateTime}} + {{#isPrimitiveType}} + m_{{name}}.push_back(ModelBase::{{items.baseType}}FromJson(item)); + {{/isPrimitiveType}} + {{^isPrimitiveType}} + {{#items.isString}} + m_{{name}}.push_back(ModelBase::stringFromJson(item)); + {{/items.isString}} + {{^items.isString}} + {{#items.isDateTime}} + m_{{name}}.push_back(ModelBase::dateFromJson(item)); + {{/items.isDateTime}} + {{^items.isDateTime}} if(item.is_null()) { m_{{name}}.push_back( {{{items.datatype}}}(nullptr) ); @@ -197,60 +343,99 @@ void {{classname}}::fromMultiPart(std::shared_ptr multipart, newItem->fromJson(item); m_{{name}}.push_back( newItem ); } - {{/items.isDateTime}}{{/items.isString}}{{/isPrimitiveType}} + {{/items.isDateTime}} + {{/items.isString}} + {{/isPrimitiveType}} } {{^required}} } {{/required}} } - {{/isListContainer}}{{^isListContainer}}{{^isPrimitiveType}}{{^required}}if(multipart->hasContent(U("{{baseName}}"))) + {{/isListContainer}} + {{^isListContainer}} + {{^isPrimitiveType}} + {{^required}} + if(multipart->hasContent(U("{{baseName}}"))) { - {{#isString}}{{setter}}(ModelBase::stringFromHttpContent(multipart->getContent(U("{{baseName}}")))); - {{/isString}}{{^isString}}{{#isDateTime}}{{setter}}(ModelBase::dateFromHttpContent(multipart->getContent(U("{{baseName}}")))); - {{/isDateTime}}{{^isDateTime}}if(multipart->hasContent(U("{{baseName}}"))) + {{#isString}} + {{setter}}(ModelBase::stringFromHttpContent(multipart->getContent(U("{{baseName}}")))); + {{/isString}} + {{^isString}} + {{#isDateTime}} + {{setter}}(ModelBase::dateFromHttpContent(multipart->getContent(U("{{baseName}}")))); + {{/isDateTime}} + {{^isDateTime}} + if(multipart->hasContent(U("{{baseName}}"))) { {{{datatype}}} newItem({{{defaultValue}}}); newItem->fromMultiPart(multipart, U("{{baseName}}.")); {{setter}}( newItem ); } - {{/isDateTime}}{{/isString}} + {{/isDateTime}} + {{/isString}} } - {{/required}}{{#required}}{{#isString}}{{setter}}(ModelBase::stringFromHttpContent(multipart->getContent(U("{{baseName}}")))); - {{/isString}}{{^isString}}{{#isDateTime}}{{setter}}(ModelBase::dateFromHttpContent(multipart->getContent(U("{{baseName}}")))); - {{/isDateTime}}{{^isDateTime}}{{#vendorExtensions.x-codegen-file}}{{setter}}(multipart->getContent(U("{{baseName}}"))); - {{/vendorExtensions.x-codegen-file}}{{^vendorExtensions.x-codegen-file}}{{{datatype}}} new{{name}}({{{defaultValue}}}); + {{/required}} + {{#required}} + {{#isString}} + {{setter}}(ModelBase::stringFromHttpContent(multipart->getContent(U("{{baseName}}")))); + {{/isString}} + {{^isString}} + {{#isDateTime}} + {{setter}}(ModelBase::dateFromHttpContent(multipart->getContent(U("{{baseName}}")))); + {{/isDateTime}} + {{^isDateTime}} + {{#vendorExtensions.x-codegen-file}} + {{setter}}(multipart->getContent(U("{{baseName}}"))); + {{/vendorExtensions.x-codegen-file}} + {{^vendorExtensions.x-codegen-file}} + {{{datatype}}} new{{name}}({{{defaultValue}}}); new{{name}}->fromMultiPart(multipart, U("{{baseName}}.")); {{setter}}( new{{name}} ); - {{/vendorExtensions.x-codegen-file}}{{/isDateTime}}{{/isString}}{{/required}}{{/isPrimitiveType}}{{/isListContainer}}{{/vars}} + {{/vendorExtensions.x-codegen-file}} + {{/isDateTime}} + {{/isString}} + {{/required}} + {{/isPrimitiveType}} + {{/isListContainer}} + {{/vars}} } - -{{#vars}}{{^isInherited}}{{^isNotContainer}}{{{datatype}}}& {{classname}}::{{getter}}() +{{#vars}} +{{^isInherited}} +{{^isNotContainer}} +{{{datatype}}}& {{classname}}::{{getter}}() { return m_{{name}}; } -{{/isNotContainer}}{{#isNotContainer}}{{{datatype}}} {{classname}}::{{getter}}() const + +{{/isNotContainer}} +{{#isNotContainer}} +{{{datatype}}} {{classname}}::{{getter}}() const { return m_{{name}}; } + void {{classname}}::{{setter}}({{{datatype}}} value) { m_{{name}} = value; {{^required}}m_{{name}}IsSet = true;{{/required}} } + {{/isNotContainer}} -{{^required}}bool {{classname}}::{{baseName}}IsSet() const +{{^required}} +bool {{classname}}::{{baseName}}IsSet() const { return m_{{name}}IsSet; } + void {{classname}}::unset{{name}}() { m_{{name}}IsSet = false; } + {{/required}} {{/isInherited}} {{/vars}} - {{#modelNamespaceDeclarations}} } {{/modelNamespaceDeclarations}} diff --git a/modules/swagger-codegen/src/main/resources/swift3/Configuration.mustache b/modules/swagger-codegen/src/main/resources/swift3/Configuration.mustache new file mode 100644 index 00000000000..c03a10b930c --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/swift3/Configuration.mustache @@ -0,0 +1,15 @@ +// Configuration.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + +open class Configuration { + + // This value is used to configure the date formatter that is used to serialize dates into JSON format. + // You must set it prior to encoding any dates, and it will only be read once. + open static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" + +} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/swift3/Extensions.mustache b/modules/swagger-codegen/src/main/resources/swift3/Extensions.mustache index df8d6b5581a..e6a33fee0fc 100644 --- a/modules/swagger-codegen/src/main/resources/swift3/Extensions.mustache +++ b/modules/swagger-codegen/src/main/resources/swift3/Extensions.mustache @@ -68,7 +68,7 @@ extension Data: JSONEncodable { private let dateFormatter: DateFormatter = { let fmt = DateFormatter() - fmt.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" + fmt.dateFormat = Configuration.dateFormat fmt.locale = Locale(identifier: "en_US_POSIX") return fmt }() diff --git a/modules/swagger-codegen/src/main/resources/typescript-angular2/api.service.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular2/api.service.mustache index 2e12a1bed2f..b752c11542b 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-angular2/api.service.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-angular2/api.service.mustache @@ -164,7 +164,7 @@ export class {{classname}} { // to determine the Content-Type header let consumes: string[] = [ {{#consumes}} - '{{{mediaType}}}'{{#hasMore}}, {{/hasMore}} + '{{{mediaType}}}'{{#hasMore}},{{/hasMore}} {{/consumes}} ]; let canConsumeForm = this.canConsumeForm(consumes); @@ -182,7 +182,7 @@ export class {{classname}} { // to determine the Accept header let produces: string[] = [ {{#produces}} - '{{{mediaType}}}'{{#hasMore}}, {{/hasMore}} + '{{{mediaType}}}'{{#hasMore}},{{/hasMore}} {{/produces}} ]; diff --git a/modules/swagger-codegen/src/main/resources/typescript-angular2/variables.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular2/variables.mustache index f5cdcf76e94..29b7e5b1d71 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-angular2/variables.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-angular2/variables.mustache @@ -1,9 +1,9 @@ -import { {{{injectionToken}}} } from '@angular/core'; +import { OpaqueToken } from '@angular/core'; -export const BASE_PATH = new {{{injectionToken}}}('basePath'); +export const BASE_PATH = new OpaqueToken('basePath'); export const COLLECTION_FORMATS = { 'csv': ',', 'tsv': ' ', 'ssv': ' ', 'pipes': '|' -} \ No newline at end of file +} diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/TypeScriptAngular2ClientOptionsProvider.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/TypeScriptAngular2ClientOptionsProvider.java index f7d430c1f4c..fd5961b99bd 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/TypeScriptAngular2ClientOptionsProvider.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/TypeScriptAngular2ClientOptionsProvider.java @@ -36,7 +36,6 @@ public class TypeScriptAngular2ClientOptionsProvider implements OptionsProvider .put(TypeScriptAngular2ClientCodegen.WITH_INTERFACES, Boolean.FALSE.toString()) .put(TypeScriptAngular2ClientCodegen.NPM_REPOSITORY, NPM_REPOSITORY) .put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE) - .put(TypeScriptAngular2ClientCodegen.USE_OPAQUE_TOKEN, Boolean.FALSE.toString()) .build(); } diff --git a/samples/client/petstore-security-test/javascript/src/ApiClient.js b/samples/client/petstore-security-test/javascript/src/ApiClient.js index 4557fa86df5..b7eb8adcbdc 100644 --- a/samples/client/petstore-security-test/javascript/src/ApiClient.js +++ b/samples/client/petstore-security-test/javascript/src/ApiClient.js @@ -173,12 +173,15 @@ * @returns {Boolean} true if param represents a file. */ exports.prototype.isFileParam = function(param) { - // fs.ReadStream in Node.js (but not in runtime like browserify) - if (typeof window === 'undefined' && - typeof require === 'function' && - require('fs') && - param instanceof require('fs').ReadStream) { - return true; + // fs.ReadStream in Node.js and Electron (but not in runtime like browserify) + if (typeof require === 'function') { + var fs; + try { + fs = require('fs'); + } catch (err) {} + if (fs && fs.ReadStream && param instanceof fs.ReadStream) { + return true; + } } // Buffer in Node.js if (typeof Buffer === 'function' && param instanceof Buffer) { diff --git a/samples/client/petstore/cpprest/model/ApiResponse.cpp b/samples/client/petstore/cpprest/model/ApiResponse.cpp index d7aea45f956..255660cf02b 100644 --- a/samples/client/petstore/cpprest/model/ApiResponse.cpp +++ b/samples/client/petstore/cpprest/model/ApiResponse.cpp @@ -27,7 +27,6 @@ ApiResponse::ApiResponse() m_TypeIsSet = false; m_Message = U(""); m_MessageIsSet = false; - } ApiResponse::~ApiResponse() @@ -41,7 +40,6 @@ void ApiResponse::validate() web::json::value ApiResponse::toJson() const { - web::json::value val = web::json::value::object(); if(m_CodeIsSet) @@ -56,15 +54,12 @@ web::json::value ApiResponse::toJson() const { val[U("message")] = ModelBase::toJson(m_Message); } - return val; } void ApiResponse::fromJson(web::json::value& val) { - - if(val.has_field(U("code"))) { setCode(ModelBase::int32_tFromJson(val[U("code")])); @@ -72,14 +67,11 @@ void ApiResponse::fromJson(web::json::value& val) if(val.has_field(U("type"))) { setType(ModelBase::stringFromJson(val[U("type")])); - } if(val.has_field(U("message"))) { setMessage(ModelBase::stringFromJson(val[U("message")])); - } - } void ApiResponse::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const @@ -104,7 +96,6 @@ void ApiResponse::toMultipart(std::shared_ptr multipart, cons multipart->add(ModelBase::toHttpContent(namePrefix + U("message"), m_Message)); } - } void ApiResponse::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) @@ -122,64 +113,71 @@ void ApiResponse::fromMultiPart(std::shared_ptr multipart, co if(multipart->hasContent(U("type"))) { setType(ModelBase::stringFromHttpContent(multipart->getContent(U("type")))); - } if(multipart->hasContent(U("message"))) { setMessage(ModelBase::stringFromHttpContent(multipart->getContent(U("message")))); - } - } - int32_t ApiResponse::getCode() const { return m_Code; } + void ApiResponse::setCode(int32_t value) { m_Code = value; m_CodeIsSet = true; } + bool ApiResponse::codeIsSet() const { return m_CodeIsSet; } + void ApiResponse::unsetCode() { m_CodeIsSet = false; } + utility::string_t ApiResponse::getType() const { return m_Type; } + void ApiResponse::setType(utility::string_t value) { m_Type = value; m_TypeIsSet = true; } + bool ApiResponse::typeIsSet() const { return m_TypeIsSet; } + void ApiResponse::unsetType() { m_TypeIsSet = false; } + utility::string_t ApiResponse::getMessage() const { return m_Message; } + void ApiResponse::setMessage(utility::string_t value) { m_Message = value; m_MessageIsSet = true; } + bool ApiResponse::messageIsSet() const { return m_MessageIsSet; } + void ApiResponse::unsetMessage() { m_MessageIsSet = false; diff --git a/samples/client/petstore/cpprest/model/Category.cpp b/samples/client/petstore/cpprest/model/Category.cpp index 57777c42271..19e14171b7a 100644 --- a/samples/client/petstore/cpprest/model/Category.cpp +++ b/samples/client/petstore/cpprest/model/Category.cpp @@ -25,7 +25,6 @@ Category::Category() m_IdIsSet = false; m_Name = U(""); m_NameIsSet = false; - } Category::~Category() @@ -39,7 +38,6 @@ void Category::validate() web::json::value Category::toJson() const { - web::json::value val = web::json::value::object(); if(m_IdIsSet) @@ -50,15 +48,12 @@ web::json::value Category::toJson() const { val[U("name")] = ModelBase::toJson(m_Name); } - return val; } void Category::fromJson(web::json::value& val) { - - if(val.has_field(U("id"))) { setId(ModelBase::int64_tFromJson(val[U("id")])); @@ -66,9 +61,7 @@ void Category::fromJson(web::json::value& val) if(val.has_field(U("name"))) { setName(ModelBase::stringFromJson(val[U("name")])); - } - } void Category::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const @@ -88,7 +81,6 @@ void Category::toMultipart(std::shared_ptr multipart, const u multipart->add(ModelBase::toHttpContent(namePrefix + U("name"), m_Name)); } - } void Category::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) @@ -106,42 +98,46 @@ void Category::fromMultiPart(std::shared_ptr multipart, const if(multipart->hasContent(U("name"))) { setName(ModelBase::stringFromHttpContent(multipart->getContent(U("name")))); - } - } - int64_t Category::getId() const { return m_Id; } + void Category::setId(int64_t value) { m_Id = value; m_IdIsSet = true; } + bool Category::idIsSet() const { return m_IdIsSet; } + void Category::unsetId() { m_IdIsSet = false; } + utility::string_t Category::getName() const { return m_Name; } + void Category::setName(utility::string_t value) { m_Name = value; m_NameIsSet = true; } + bool Category::nameIsSet() const { return m_NameIsSet; } + void Category::unsetName() { m_NameIsSet = false; diff --git a/samples/client/petstore/cpprest/model/Order.cpp b/samples/client/petstore/cpprest/model/Order.cpp index a64b12f3683..f9ed1375ece 100644 --- a/samples/client/petstore/cpprest/model/Order.cpp +++ b/samples/client/petstore/cpprest/model/Order.cpp @@ -33,7 +33,6 @@ Order::Order() m_StatusIsSet = false; m_Complete = false; m_CompleteIsSet = false; - } Order::~Order() @@ -47,7 +46,6 @@ void Order::validate() web::json::value Order::toJson() const { - web::json::value val = web::json::value::object(); if(m_IdIsSet) @@ -74,15 +72,12 @@ web::json::value Order::toJson() const { val[U("complete")] = ModelBase::toJson(m_Complete); } - return val; } void Order::fromJson(web::json::value& val) { - - if(val.has_field(U("id"))) { setId(ModelBase::int64_tFromJson(val[U("id")])); @@ -98,18 +93,15 @@ void Order::fromJson(web::json::value& val) if(val.has_field(U("shipDate"))) { setShipDate(ModelBase::dateFromJson(val[U("shipDate")])); - } if(val.has_field(U("status"))) { setStatus(ModelBase::stringFromJson(val[U("status")])); - } if(val.has_field(U("complete"))) { setComplete(ModelBase::boolFromJson(val[U("complete")])); } - } void Order::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const @@ -146,7 +138,6 @@ void Order::toMultipart(std::shared_ptr multipart, const util { multipart->add(ModelBase::toHttpContent(namePrefix + U("complete"), m_Complete)); } - } void Order::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) @@ -172,119 +163,138 @@ void Order::fromMultiPart(std::shared_ptr multipart, const ut if(multipart->hasContent(U("shipDate"))) { setShipDate(ModelBase::dateFromHttpContent(multipart->getContent(U("shipDate")))); - } if(multipart->hasContent(U("status"))) { setStatus(ModelBase::stringFromHttpContent(multipart->getContent(U("status")))); - } if(multipart->hasContent(U("complete"))) { setComplete(ModelBase::boolFromHttpContent(multipart->getContent(U("complete")))); } - } - int64_t Order::getId() const { return m_Id; } + void Order::setId(int64_t value) { m_Id = value; m_IdIsSet = true; } + bool Order::idIsSet() const { return m_IdIsSet; } + void Order::unsetId() { m_IdIsSet = false; } + int64_t Order::getPetId() const { return m_PetId; } + void Order::setPetId(int64_t value) { m_PetId = value; m_PetIdIsSet = true; } + bool Order::petIdIsSet() const { return m_PetIdIsSet; } + void Order::unsetPetId() { m_PetIdIsSet = false; } + int32_t Order::getQuantity() const { return m_Quantity; } + void Order::setQuantity(int32_t value) { m_Quantity = value; m_QuantityIsSet = true; } + bool Order::quantityIsSet() const { return m_QuantityIsSet; } + void Order::unsetQuantity() { m_QuantityIsSet = false; } + utility::datetime Order::getShipDate() const { return m_ShipDate; } + void Order::setShipDate(utility::datetime value) { m_ShipDate = value; m_ShipDateIsSet = true; } + bool Order::shipDateIsSet() const { return m_ShipDateIsSet; } + void Order::unsetShipDate() { m_ShipDateIsSet = false; } + utility::string_t Order::getStatus() const { return m_Status; } + void Order::setStatus(utility::string_t value) { m_Status = value; m_StatusIsSet = true; } + bool Order::statusIsSet() const { return m_StatusIsSet; } + void Order::unsetStatus() { m_StatusIsSet = false; } + bool Order::getComplete() const { return m_Complete; } + void Order::setComplete(bool value) { m_Complete = value; m_CompleteIsSet = true; } + bool Order::completeIsSet() const { return m_CompleteIsSet; } + void Order::unsetComplete() { m_CompleteIsSet = false; diff --git a/samples/client/petstore/cpprest/model/Pet.cpp b/samples/client/petstore/cpprest/model/Pet.cpp index 6414c9bb35c..a59a8da759e 100644 --- a/samples/client/petstore/cpprest/model/Pet.cpp +++ b/samples/client/petstore/cpprest/model/Pet.cpp @@ -28,7 +28,6 @@ Pet::Pet() m_TagsIsSet = false; m_Status = U(""); m_StatusIsSet = false; - } Pet::~Pet() @@ -42,7 +41,6 @@ void Pet::validate() web::json::value Pet::toJson() const { - web::json::value val = web::json::value::object(); if(m_IdIsSet) @@ -61,14 +59,13 @@ web::json::value Pet::toJson() const jsonArray.push_back(ModelBase::toJson(item)); } val[U("photoUrls")] = web::json::value::array(jsonArray); - } + } { std::vector jsonArray; for( auto& item : m_Tags ) { jsonArray.push_back(ModelBase::toJson(item)); } - if(jsonArray.size() > 0) { val[U("tags")] = web::json::value::array(jsonArray); @@ -78,15 +75,12 @@ web::json::value Pet::toJson() const { val[U("status")] = ModelBase::toJson(m_Status); } - return val; } void Pet::fromJson(web::json::value& val) { - - if(val.has_field(U("id"))) { setId(ModelBase::int64_tFromJson(val[U("id")])); @@ -99,16 +93,14 @@ void Pet::fromJson(web::json::value& val) newItem->fromJson(val[U("category")]); setCategory( newItem ); } - } setName(ModelBase::stringFromJson(val[U("name")])); { m_PhotoUrls.clear(); std::vector jsonArray; - for( auto& item : val[U("photoUrls")].as_array() ) + for( auto& item : val[U("photoUrls")].as_array() ) { m_PhotoUrls.push_back(ModelBase::stringFromJson(item)); - } } { @@ -118,7 +110,6 @@ void Pet::fromJson(web::json::value& val) { for( auto& item : val[U("tags")].as_array() ) { - if(item.is_null()) { m_Tags.push_back( std::shared_ptr(nullptr) ); @@ -129,16 +120,13 @@ void Pet::fromJson(web::json::value& val) newItem->fromJson(item); m_Tags.push_back( newItem ); } - } } } if(val.has_field(U("status"))) { setStatus(ModelBase::stringFromJson(val[U("status")])); - } - } void Pet::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const @@ -187,7 +175,6 @@ void Pet::toMultipart(std::shared_ptr multipart, const utilit multipart->add(ModelBase::toHttpContent(namePrefix + U("status"), m_Status)); } - } void Pet::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) @@ -210,17 +197,15 @@ void Pet::fromMultiPart(std::shared_ptr multipart, const util newItem->fromMultiPart(multipart, U("category.")); setCategory( newItem ); } - } setName(ModelBase::stringFromHttpContent(multipart->getContent(U("name")))); { m_PhotoUrls.clear(); - + web::json::value jsonArray = web::json::value::parse(ModelBase::stringFromHttpContent(multipart->getContent(U("photoUrls")))); for( auto& item : jsonArray.as_array() ) { m_PhotoUrls.push_back(ModelBase::stringFromJson(item)); - } } { @@ -231,7 +216,6 @@ void Pet::fromMultiPart(std::shared_ptr multipart, const util web::json::value jsonArray = web::json::value::parse(ModelBase::stringFromHttpContent(multipart->getContent(U("tags")))); for( auto& item : jsonArray.as_array() ) { - if(item.is_null()) { m_Tags.push_back( std::shared_ptr(nullptr) ); @@ -242,91 +226,104 @@ void Pet::fromMultiPart(std::shared_ptr multipart, const util newItem->fromJson(item); m_Tags.push_back( newItem ); } - } } } if(multipart->hasContent(U("status"))) { setStatus(ModelBase::stringFromHttpContent(multipart->getContent(U("status")))); - } - } - int64_t Pet::getId() const { return m_Id; } + void Pet::setId(int64_t value) { m_Id = value; m_IdIsSet = true; } + bool Pet::idIsSet() const { return m_IdIsSet; } + void Pet::unsetId() { m_IdIsSet = false; } + std::shared_ptr Pet::getCategory() const { return m_Category; } + void Pet::setCategory(std::shared_ptr value) { m_Category = value; m_CategoryIsSet = true; } + bool Pet::categoryIsSet() const { return m_CategoryIsSet; } + void Pet::unsetCategory() { m_CategoryIsSet = false; } + utility::string_t Pet::getName() const { return m_Name; } + void Pet::setName(utility::string_t value) { m_Name = value; } + std::vector& Pet::getPhotoUrls() { return m_PhotoUrls; } + std::vector>& Pet::getTags() { return m_Tags; } + bool Pet::tagsIsSet() const { return m_TagsIsSet; } + void Pet::unsetTags() { m_TagsIsSet = false; } + utility::string_t Pet::getStatus() const { return m_Status; } + void Pet::setStatus(utility::string_t value) { m_Status = value; m_StatusIsSet = true; } + bool Pet::statusIsSet() const { return m_StatusIsSet; } + void Pet::unsetStatus() { m_StatusIsSet = false; diff --git a/samples/client/petstore/cpprest/model/Tag.cpp b/samples/client/petstore/cpprest/model/Tag.cpp index 8c77f0a4b4a..0b3220e5110 100644 --- a/samples/client/petstore/cpprest/model/Tag.cpp +++ b/samples/client/petstore/cpprest/model/Tag.cpp @@ -25,7 +25,6 @@ Tag::Tag() m_IdIsSet = false; m_Name = U(""); m_NameIsSet = false; - } Tag::~Tag() @@ -39,7 +38,6 @@ void Tag::validate() web::json::value Tag::toJson() const { - web::json::value val = web::json::value::object(); if(m_IdIsSet) @@ -50,15 +48,12 @@ web::json::value Tag::toJson() const { val[U("name")] = ModelBase::toJson(m_Name); } - return val; } void Tag::fromJson(web::json::value& val) { - - if(val.has_field(U("id"))) { setId(ModelBase::int64_tFromJson(val[U("id")])); @@ -66,9 +61,7 @@ void Tag::fromJson(web::json::value& val) if(val.has_field(U("name"))) { setName(ModelBase::stringFromJson(val[U("name")])); - } - } void Tag::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const @@ -88,7 +81,6 @@ void Tag::toMultipart(std::shared_ptr multipart, const utilit multipart->add(ModelBase::toHttpContent(namePrefix + U("name"), m_Name)); } - } void Tag::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) @@ -106,42 +98,46 @@ void Tag::fromMultiPart(std::shared_ptr multipart, const util if(multipart->hasContent(U("name"))) { setName(ModelBase::stringFromHttpContent(multipart->getContent(U("name")))); - } - } - int64_t Tag::getId() const { return m_Id; } + void Tag::setId(int64_t value) { m_Id = value; m_IdIsSet = true; } + bool Tag::idIsSet() const { return m_IdIsSet; } + void Tag::unsetId() { m_IdIsSet = false; } + utility::string_t Tag::getName() const { return m_Name; } + void Tag::setName(utility::string_t value) { m_Name = value; m_NameIsSet = true; } + bool Tag::nameIsSet() const { return m_NameIsSet; } + void Tag::unsetName() { m_NameIsSet = false; diff --git a/samples/client/petstore/cpprest/model/User.cpp b/samples/client/petstore/cpprest/model/User.cpp index c03ba1ada72..bf40c4741bd 100644 --- a/samples/client/petstore/cpprest/model/User.cpp +++ b/samples/client/petstore/cpprest/model/User.cpp @@ -37,7 +37,6 @@ User::User() m_PhoneIsSet = false; m_UserStatus = 0; m_UserStatusIsSet = false; - } User::~User() @@ -51,7 +50,6 @@ void User::validate() web::json::value User::toJson() const { - web::json::value val = web::json::value::object(); if(m_IdIsSet) @@ -86,15 +84,12 @@ web::json::value User::toJson() const { val[U("userStatus")] = ModelBase::toJson(m_UserStatus); } - return val; } void User::fromJson(web::json::value& val) { - - if(val.has_field(U("id"))) { setId(ModelBase::int64_tFromJson(val[U("id")])); @@ -102,38 +97,31 @@ void User::fromJson(web::json::value& val) if(val.has_field(U("username"))) { setUsername(ModelBase::stringFromJson(val[U("username")])); - } if(val.has_field(U("firstName"))) { setFirstName(ModelBase::stringFromJson(val[U("firstName")])); - } if(val.has_field(U("lastName"))) { setLastName(ModelBase::stringFromJson(val[U("lastName")])); - } if(val.has_field(U("email"))) { setEmail(ModelBase::stringFromJson(val[U("email")])); - } if(val.has_field(U("password"))) { setPassword(ModelBase::stringFromJson(val[U("password")])); - } if(val.has_field(U("phone"))) { setPhone(ModelBase::stringFromJson(val[U("phone")])); - } if(val.has_field(U("userStatus"))) { setUserStatus(ModelBase::int32_tFromJson(val[U("userStatus")])); } - } void User::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const @@ -182,7 +170,6 @@ void User::toMultipart(std::shared_ptr multipart, const utili { multipart->add(ModelBase::toHttpContent(namePrefix + U("userStatus"), m_UserStatus)); } - } void User::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) @@ -200,173 +187,196 @@ void User::fromMultiPart(std::shared_ptr multipart, const uti if(multipart->hasContent(U("username"))) { setUsername(ModelBase::stringFromHttpContent(multipart->getContent(U("username")))); - } if(multipart->hasContent(U("firstName"))) { setFirstName(ModelBase::stringFromHttpContent(multipart->getContent(U("firstName")))); - } if(multipart->hasContent(U("lastName"))) { setLastName(ModelBase::stringFromHttpContent(multipart->getContent(U("lastName")))); - } if(multipart->hasContent(U("email"))) { setEmail(ModelBase::stringFromHttpContent(multipart->getContent(U("email")))); - } if(multipart->hasContent(U("password"))) { setPassword(ModelBase::stringFromHttpContent(multipart->getContent(U("password")))); - } if(multipart->hasContent(U("phone"))) { setPhone(ModelBase::stringFromHttpContent(multipart->getContent(U("phone")))); - } if(multipart->hasContent(U("userStatus"))) { setUserStatus(ModelBase::int32_tFromHttpContent(multipart->getContent(U("userStatus")))); } - } - int64_t User::getId() const { return m_Id; } + void User::setId(int64_t value) { m_Id = value; m_IdIsSet = true; } + bool User::idIsSet() const { return m_IdIsSet; } + void User::unsetId() { m_IdIsSet = false; } + utility::string_t User::getUsername() const { return m_Username; } + void User::setUsername(utility::string_t value) { m_Username = value; m_UsernameIsSet = true; } + bool User::usernameIsSet() const { return m_UsernameIsSet; } + void User::unsetUsername() { m_UsernameIsSet = false; } + utility::string_t User::getFirstName() const { return m_FirstName; } + void User::setFirstName(utility::string_t value) { m_FirstName = value; m_FirstNameIsSet = true; } + bool User::firstNameIsSet() const { return m_FirstNameIsSet; } + void User::unsetFirstName() { m_FirstNameIsSet = false; } + utility::string_t User::getLastName() const { return m_LastName; } + void User::setLastName(utility::string_t value) { m_LastName = value; m_LastNameIsSet = true; } + bool User::lastNameIsSet() const { return m_LastNameIsSet; } + void User::unsetLastName() { m_LastNameIsSet = false; } + utility::string_t User::getEmail() const { return m_Email; } + void User::setEmail(utility::string_t value) { m_Email = value; m_EmailIsSet = true; } + bool User::emailIsSet() const { return m_EmailIsSet; } + void User::unsetEmail() { m_EmailIsSet = false; } + utility::string_t User::getPassword() const { return m_Password; } + void User::setPassword(utility::string_t value) { m_Password = value; m_PasswordIsSet = true; } + bool User::passwordIsSet() const { return m_PasswordIsSet; } + void User::unsetPassword() { m_PasswordIsSet = false; } + utility::string_t User::getPhone() const { return m_Phone; } + void User::setPhone(utility::string_t value) { m_Phone = value; m_PhoneIsSet = true; } + bool User::phoneIsSet() const { return m_PhoneIsSet; } + void User::unsetPhone() { m_PhoneIsSet = false; } + int32_t User::getUserStatus() const { return m_UserStatus; } + void User::setUserStatus(int32_t value) { m_UserStatus = value; m_UserStatusIsSet = true; } + bool User::userStatusIsSet() const { return m_UserStatusIsSet; } + void User::unsetUserStatus() { m_UserStatusIsSet = false; diff --git a/samples/client/petstore/javascript-es6/README.md b/samples/client/petstore/javascript-es6/README.md index eff200e4844..2ea09ae3d9e 100644 --- a/samples/client/petstore/javascript-es6/README.md +++ b/samples/client/petstore/javascript-es6/README.md @@ -82,6 +82,7 @@ Class | Method | HTTP request | Description *SwaggerPetstore.FakeApi* | [**testClientModel**](docs/FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model *SwaggerPetstore.FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *SwaggerPetstore.FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters +*SwaggerPetstore.FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data *SwaggerPetstore.Fake_classname_tags123Api* | [**testClassname**](docs/Fake_classname_tags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case *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 diff --git a/samples/client/petstore/javascript-es6/docs/FakeApi.md b/samples/client/petstore/javascript-es6/docs/FakeApi.md index 85ac0b3d8a2..5dd1db67371 100644 --- a/samples/client/petstore/javascript-es6/docs/FakeApi.md +++ b/samples/client/petstore/javascript-es6/docs/FakeApi.md @@ -11,6 +11,7 @@ Method | HTTP request | Description [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters +[**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data @@ -23,22 +24,21 @@ Test serialization of outer boolean types ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); +import SwaggerPetstore from 'swagger_petstore'; -var apiInstance = new SwaggerPetstore.FakeApi(); +let apiInstance = new SwaggerPetstore.FakeApi(); -var opts = { +let opts = { 'body': new SwaggerPetstore.OuterBoolean() // OuterBoolean | Input boolean as post body }; -var callback = function(error, data, response) { +apiInstance.fakeOuterBooleanSerialize(opts, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } -}; -apiInstance.fakeOuterBooleanSerialize(opts, callback); +}); ``` ### Parameters @@ -70,22 +70,21 @@ Test serialization of object with outer number type ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); +import SwaggerPetstore from 'swagger_petstore'; -var apiInstance = new SwaggerPetstore.FakeApi(); +let apiInstance = new SwaggerPetstore.FakeApi(); -var opts = { +let opts = { 'body': new SwaggerPetstore.OuterComposite() // OuterComposite | Input composite as post body }; -var callback = function(error, data, response) { +apiInstance.fakeOuterCompositeSerialize(opts, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } -}; -apiInstance.fakeOuterCompositeSerialize(opts, callback); +}); ``` ### Parameters @@ -117,22 +116,21 @@ Test serialization of outer number types ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); +import SwaggerPetstore from 'swagger_petstore'; -var apiInstance = new SwaggerPetstore.FakeApi(); +let apiInstance = new SwaggerPetstore.FakeApi(); -var opts = { +let opts = { 'body': new SwaggerPetstore.OuterNumber() // OuterNumber | Input number as post body }; -var callback = function(error, data, response) { +apiInstance.fakeOuterNumberSerialize(opts, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } -}; -apiInstance.fakeOuterNumberSerialize(opts, callback); +}); ``` ### Parameters @@ -164,22 +162,21 @@ Test serialization of outer string types ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); +import SwaggerPetstore from 'swagger_petstore'; -var apiInstance = new SwaggerPetstore.FakeApi(); +let apiInstance = new SwaggerPetstore.FakeApi(); -var opts = { +let opts = { 'body': new SwaggerPetstore.OuterString() // OuterString | Input string as post body }; -var callback = function(error, data, response) { +apiInstance.fakeOuterStringSerialize(opts, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } -}; -apiInstance.fakeOuterStringSerialize(opts, callback); +}); ``` ### Parameters @@ -211,21 +208,20 @@ To test \"client\" model ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); +import SwaggerPetstore from 'swagger_petstore'; -var apiInstance = new SwaggerPetstore.FakeApi(); +let apiInstance = new SwaggerPetstore.FakeApi(); -var body = new SwaggerPetstore.Client(); // Client | client model +let body = new SwaggerPetstore.Client(); // Client | client model -var callback = function(error, data, response) { +apiInstance.testClientModel(body, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } -}; -apiInstance.testClientModel(body, callback); +}); ``` ### Parameters @@ -257,25 +253,25 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); -var defaultClient = SwaggerPetstore.ApiClient.instance; +import SwaggerPetstore from 'swagger_petstore'; +let defaultClient = SwaggerPetstore.ApiClient.instance; // Configure HTTP basic authorization: http_basic_test -var http_basic_test = defaultClient.authentications['http_basic_test']; +let http_basic_test = defaultClient.authentications['http_basic_test']; http_basic_test.username = 'YOUR USERNAME'; http_basic_test.password = 'YOUR PASSWORD'; -var apiInstance = new SwaggerPetstore.FakeApi(); +let apiInstance = new SwaggerPetstore.FakeApi(); -var _number = 3.4; // Number | None +let _number = 3.4; // Number | None -var _double = 1.2; // Number | None +let _double = 1.2; // Number | None -var patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None +let patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None -var _byte = B; // Blob | None +let _byte = B; // Blob | None -var opts = { +let opts = { 'integer': 56, // Number | None 'int32': 56, // Number | None 'int64': 789, // Number | None @@ -288,14 +284,13 @@ var opts = { 'callback': "callback_example" // String | None }; -var callback = function(error, data, response) { +apiInstance.testEndpointParameters(_number, _double, patternWithoutDelimiter, _byte, opts, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully.'); } -}; -apiInstance.testEndpointParameters(_number, _double, patternWithoutDelimiter, _byte, opts, callback); +}); ``` ### Parameters @@ -340,11 +335,11 @@ To test enum parameters ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); +import SwaggerPetstore from 'swagger_petstore'; -var apiInstance = new SwaggerPetstore.FakeApi(); +let apiInstance = new SwaggerPetstore.FakeApi(); -var opts = { +let opts = { 'enumFormStringArray': ["enumFormStringArray_example"], // [String] | Form parameter enum test (string array) 'enumFormString': "-efg", // String | Form parameter enum test (string) 'enumHeaderStringArray': ["enumHeaderStringArray_example"], // [String] | Header parameter enum test (string array) @@ -355,14 +350,13 @@ var opts = { 'enumQueryDouble': 1.2 // Number | Query parameter enum test (double) }; -var callback = function(error, data, response) { +apiInstance.testEnumParameters(opts, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully.'); } -}; -apiInstance.testEnumParameters(opts, callback); +}); ``` ### Parameters @@ -391,3 +385,51 @@ No authorization required - **Content-Type**: */* - **Accept**: */* + +# **testJsonFormData** +> testJsonFormData(param, param2) + +test json serialization of form data + + + +### Example +```javascript +import SwaggerPetstore from 'swagger_petstore'; + +let apiInstance = new SwaggerPetstore.FakeApi(); + +let param = "param_example"; // String | field1 + +let param2 = "param2_example"; // String | field2 + + +apiInstance.testJsonFormData(param, param2, (error, data, response) => { + if (error) { + console.error(error); + } else { + console.log('API called successfully.'); + } +}); +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | **String**| field1 | + **param2** | **String**| field2 | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + diff --git a/samples/client/petstore/javascript-es6/docs/Fake_classname_tags123Api.md b/samples/client/petstore/javascript-es6/docs/Fake_classname_tags123Api.md index 017483b51a6..04cc7717ea6 100644 --- a/samples/client/petstore/javascript-es6/docs/Fake_classname_tags123Api.md +++ b/samples/client/petstore/javascript-es6/docs/Fake_classname_tags123Api.md @@ -15,21 +15,20 @@ To test class name in snake case ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); +import SwaggerPetstore from 'swagger_petstore'; -var apiInstance = new SwaggerPetstore.Fake_classname_tags123Api(); +let apiInstance = new SwaggerPetstore.Fake_classname_tags123Api(); -var body = new SwaggerPetstore.Client(); // Client | client model +let body = new SwaggerPetstore.Client(); // Client | client model -var callback = function(error, data, response) { +apiInstance.testClassname(body, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } -}; -apiInstance.testClassname(body, callback); +}); ``` ### Parameters diff --git a/samples/client/petstore/javascript-es6/docs/PetApi.md b/samples/client/petstore/javascript-es6/docs/PetApi.md index fee9b40dbbc..9901993bf12 100644 --- a/samples/client/petstore/javascript-es6/docs/PetApi.md +++ b/samples/client/petstore/javascript-es6/docs/PetApi.md @@ -24,26 +24,25 @@ Add a new pet to the store ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); -var defaultClient = SwaggerPetstore.ApiClient.instance; +import SwaggerPetstore from 'swagger_petstore'; +let defaultClient = SwaggerPetstore.ApiClient.instance; // Configure OAuth2 access token for authorization: petstore_auth -var petstore_auth = defaultClient.authentications['petstore_auth']; +let petstore_auth = defaultClient.authentications['petstore_auth']; petstore_auth.accessToken = 'YOUR ACCESS TOKEN'; -var apiInstance = new SwaggerPetstore.PetApi(); +let apiInstance = new SwaggerPetstore.PetApi(); -var body = new SwaggerPetstore.Pet(); // Pet | Pet object that needs to be added to the store +let body = new SwaggerPetstore.Pet(); // Pet | Pet object that needs to be added to the store -var callback = function(error, data, response) { +apiInstance.addPet(body, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully.'); } -}; -apiInstance.addPet(body, callback); +}); ``` ### Parameters @@ -75,29 +74,28 @@ Deletes a pet ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); -var defaultClient = SwaggerPetstore.ApiClient.instance; +import SwaggerPetstore from 'swagger_petstore'; +let defaultClient = SwaggerPetstore.ApiClient.instance; // Configure OAuth2 access token for authorization: petstore_auth -var petstore_auth = defaultClient.authentications['petstore_auth']; +let petstore_auth = defaultClient.authentications['petstore_auth']; petstore_auth.accessToken = 'YOUR ACCESS TOKEN'; -var apiInstance = new SwaggerPetstore.PetApi(); +let apiInstance = new SwaggerPetstore.PetApi(); -var petId = 789; // Number | Pet id to delete +let petId = 789; // Number | Pet id to delete -var opts = { +let opts = { 'apiKey': "apiKey_example" // String | }; -var callback = function(error, data, response) { +apiInstance.deletePet(petId, opts, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully.'); } -}; -apiInstance.deletePet(petId, opts, callback); +}); ``` ### Parameters @@ -130,26 +128,25 @@ Multiple status values can be provided with comma separated strings ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); -var defaultClient = SwaggerPetstore.ApiClient.instance; +import SwaggerPetstore from 'swagger_petstore'; +let defaultClient = SwaggerPetstore.ApiClient.instance; // Configure OAuth2 access token for authorization: petstore_auth -var petstore_auth = defaultClient.authentications['petstore_auth']; +let petstore_auth = defaultClient.authentications['petstore_auth']; petstore_auth.accessToken = 'YOUR ACCESS TOKEN'; -var apiInstance = new SwaggerPetstore.PetApi(); +let apiInstance = new SwaggerPetstore.PetApi(); -var status = ["status_example"]; // [String] | Status values that need to be considered for filter +let status = ["status_example"]; // [String] | Status values that need to be considered for filter -var callback = function(error, data, response) { +apiInstance.findPetsByStatus(status, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } -}; -apiInstance.findPetsByStatus(status, callback); +}); ``` ### Parameters @@ -181,26 +178,25 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); -var defaultClient = SwaggerPetstore.ApiClient.instance; +import SwaggerPetstore from 'swagger_petstore'; +let defaultClient = SwaggerPetstore.ApiClient.instance; // Configure OAuth2 access token for authorization: petstore_auth -var petstore_auth = defaultClient.authentications['petstore_auth']; +let petstore_auth = defaultClient.authentications['petstore_auth']; petstore_auth.accessToken = 'YOUR ACCESS TOKEN'; -var apiInstance = new SwaggerPetstore.PetApi(); +let apiInstance = new SwaggerPetstore.PetApi(); -var tags = ["tags_example"]; // [String] | Tags to filter by +let tags = ["tags_example"]; // [String] | Tags to filter by -var callback = function(error, data, response) { +apiInstance.findPetsByTags(tags, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } -}; -apiInstance.findPetsByTags(tags, callback); +}); ``` ### Parameters @@ -232,28 +228,27 @@ Returns a single pet ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); -var defaultClient = SwaggerPetstore.ApiClient.instance; +import SwaggerPetstore from 'swagger_petstore'; +let defaultClient = SwaggerPetstore.ApiClient.instance; // Configure API key authorization: api_key -var api_key = defaultClient.authentications['api_key']; +let api_key = defaultClient.authentications['api_key']; api_key.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //api_key.apiKeyPrefix = 'Token'; -var apiInstance = new SwaggerPetstore.PetApi(); +let apiInstance = new SwaggerPetstore.PetApi(); -var petId = 789; // Number | ID of pet to return +let petId = 789; // Number | ID of pet to return -var callback = function(error, data, response) { +apiInstance.getPetById(petId, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } -}; -apiInstance.getPetById(petId, callback); +}); ``` ### Parameters @@ -285,26 +280,25 @@ Update an existing pet ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); -var defaultClient = SwaggerPetstore.ApiClient.instance; +import SwaggerPetstore from 'swagger_petstore'; +let defaultClient = SwaggerPetstore.ApiClient.instance; // Configure OAuth2 access token for authorization: petstore_auth -var petstore_auth = defaultClient.authentications['petstore_auth']; +let petstore_auth = defaultClient.authentications['petstore_auth']; petstore_auth.accessToken = 'YOUR ACCESS TOKEN'; -var apiInstance = new SwaggerPetstore.PetApi(); +let apiInstance = new SwaggerPetstore.PetApi(); -var body = new SwaggerPetstore.Pet(); // Pet | Pet object that needs to be added to the store +let body = new SwaggerPetstore.Pet(); // Pet | Pet object that needs to be added to the store -var callback = function(error, data, response) { +apiInstance.updatePet(body, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully.'); } -}; -apiInstance.updatePet(body, callback); +}); ``` ### Parameters @@ -336,30 +330,29 @@ Updates a pet in the store with form data ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); -var defaultClient = SwaggerPetstore.ApiClient.instance; +import SwaggerPetstore from 'swagger_petstore'; +let defaultClient = SwaggerPetstore.ApiClient.instance; // Configure OAuth2 access token for authorization: petstore_auth -var petstore_auth = defaultClient.authentications['petstore_auth']; +let petstore_auth = defaultClient.authentications['petstore_auth']; petstore_auth.accessToken = 'YOUR ACCESS TOKEN'; -var apiInstance = new SwaggerPetstore.PetApi(); +let apiInstance = new SwaggerPetstore.PetApi(); -var petId = 789; // Number | ID of pet that needs to be updated +let petId = 789; // Number | ID of pet that needs to be updated -var opts = { +let opts = { 'name': "name_example", // String | Updated name of the pet 'status': "status_example" // String | Updated status of the pet }; -var callback = function(error, data, response) { +apiInstance.updatePetWithForm(petId, opts, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully.'); } -}; -apiInstance.updatePetWithForm(petId, opts, callback); +}); ``` ### Parameters @@ -393,30 +386,29 @@ uploads an image ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); -var defaultClient = SwaggerPetstore.ApiClient.instance; +import SwaggerPetstore from 'swagger_petstore'; +let defaultClient = SwaggerPetstore.ApiClient.instance; // Configure OAuth2 access token for authorization: petstore_auth -var petstore_auth = defaultClient.authentications['petstore_auth']; +let petstore_auth = defaultClient.authentications['petstore_auth']; petstore_auth.accessToken = 'YOUR ACCESS TOKEN'; -var apiInstance = new SwaggerPetstore.PetApi(); +let apiInstance = new SwaggerPetstore.PetApi(); -var petId = 789; // Number | ID of pet to update +let petId = 789; // Number | ID of pet to update -var opts = { +let opts = { 'additionalMetadata': "additionalMetadata_example", // String | Additional data to pass to server 'file': "/path/to/file.txt" // File | file to upload }; -var callback = function(error, data, response) { +apiInstance.uploadFile(petId, opts, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } -}; -apiInstance.uploadFile(petId, opts, callback); +}); ``` ### Parameters diff --git a/samples/client/petstore/javascript-es6/docs/StoreApi.md b/samples/client/petstore/javascript-es6/docs/StoreApi.md index 64d4658232d..2581dc0b7d3 100644 --- a/samples/client/petstore/javascript-es6/docs/StoreApi.md +++ b/samples/client/petstore/javascript-es6/docs/StoreApi.md @@ -20,21 +20,20 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); +import SwaggerPetstore from 'swagger_petstore'; -var apiInstance = new SwaggerPetstore.StoreApi(); +let apiInstance = new SwaggerPetstore.StoreApi(); -var orderId = "orderId_example"; // String | ID of the order that needs to be deleted +let orderId = "orderId_example"; // String | ID of the order that needs to be deleted -var callback = function(error, data, response) { +apiInstance.deleteOrder(orderId, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully.'); } -}; -apiInstance.deleteOrder(orderId, callback); +}); ``` ### Parameters @@ -66,25 +65,24 @@ Returns a map of status codes to quantities ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); -var defaultClient = SwaggerPetstore.ApiClient.instance; +import SwaggerPetstore from 'swagger_petstore'; +let defaultClient = SwaggerPetstore.ApiClient.instance; // Configure API key authorization: api_key -var api_key = defaultClient.authentications['api_key']; +let api_key = defaultClient.authentications['api_key']; api_key.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //api_key.apiKeyPrefix = 'Token'; -var apiInstance = new SwaggerPetstore.StoreApi(); +let apiInstance = new SwaggerPetstore.StoreApi(); -var callback = function(error, data, response) { +apiInstance.getInventory((error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } -}; -apiInstance.getInventory(callback); +}); ``` ### Parameters @@ -113,21 +111,20 @@ For valid response try integer IDs with value <= 5 or > 10. Other val ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); +import SwaggerPetstore from 'swagger_petstore'; -var apiInstance = new SwaggerPetstore.StoreApi(); +let apiInstance = new SwaggerPetstore.StoreApi(); -var orderId = 789; // Number | ID of pet that needs to be fetched +let orderId = 789; // Number | ID of pet that needs to be fetched -var callback = function(error, data, response) { +apiInstance.getOrderById(orderId, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } -}; -apiInstance.getOrderById(orderId, callback); +}); ``` ### Parameters @@ -159,21 +156,20 @@ Place an order for a pet ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); +import SwaggerPetstore from 'swagger_petstore'; -var apiInstance = new SwaggerPetstore.StoreApi(); +let apiInstance = new SwaggerPetstore.StoreApi(); -var body = new SwaggerPetstore.Order(); // Order | order placed for purchasing the pet +let body = new SwaggerPetstore.Order(); // Order | order placed for purchasing the pet -var callback = function(error, data, response) { +apiInstance.placeOrder(body, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } -}; -apiInstance.placeOrder(body, callback); +}); ``` ### Parameters diff --git a/samples/client/petstore/javascript-es6/docs/UserApi.md b/samples/client/petstore/javascript-es6/docs/UserApi.md index d0ff1003b0c..d77e8413fd3 100644 --- a/samples/client/petstore/javascript-es6/docs/UserApi.md +++ b/samples/client/petstore/javascript-es6/docs/UserApi.md @@ -24,21 +24,20 @@ This can only be done by the logged in user. ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); +import SwaggerPetstore from 'swagger_petstore'; -var apiInstance = new SwaggerPetstore.UserApi(); +let apiInstance = new SwaggerPetstore.UserApi(); -var body = new SwaggerPetstore.User(); // User | Created user object +let body = new SwaggerPetstore.User(); // User | Created user object -var callback = function(error, data, response) { +apiInstance.createUser(body, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully.'); } -}; -apiInstance.createUser(body, callback); +}); ``` ### Parameters @@ -70,21 +69,20 @@ Creates list of users with given input array ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); +import SwaggerPetstore from 'swagger_petstore'; -var apiInstance = new SwaggerPetstore.UserApi(); +let apiInstance = new SwaggerPetstore.UserApi(); -var body = [new SwaggerPetstore.User()]; // [User] | List of user object +let body = [new SwaggerPetstore.User()]; // [User] | List of user object -var callback = function(error, data, response) { +apiInstance.createUsersWithArrayInput(body, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully.'); } -}; -apiInstance.createUsersWithArrayInput(body, callback); +}); ``` ### Parameters @@ -116,21 +114,20 @@ Creates list of users with given input array ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); +import SwaggerPetstore from 'swagger_petstore'; -var apiInstance = new SwaggerPetstore.UserApi(); +let apiInstance = new SwaggerPetstore.UserApi(); -var body = [new SwaggerPetstore.User()]; // [User] | List of user object +let body = [new SwaggerPetstore.User()]; // [User] | List of user object -var callback = function(error, data, response) { +apiInstance.createUsersWithListInput(body, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully.'); } -}; -apiInstance.createUsersWithListInput(body, callback); +}); ``` ### Parameters @@ -162,21 +159,20 @@ This can only be done by the logged in user. ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); +import SwaggerPetstore from 'swagger_petstore'; -var apiInstance = new SwaggerPetstore.UserApi(); +let apiInstance = new SwaggerPetstore.UserApi(); -var username = "username_example"; // String | The name that needs to be deleted +let username = "username_example"; // String | The name that needs to be deleted -var callback = function(error, data, response) { +apiInstance.deleteUser(username, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully.'); } -}; -apiInstance.deleteUser(username, callback); +}); ``` ### Parameters @@ -208,21 +204,20 @@ Get user by user name ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); +import SwaggerPetstore from 'swagger_petstore'; -var apiInstance = new SwaggerPetstore.UserApi(); +let apiInstance = new SwaggerPetstore.UserApi(); -var username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing. +let username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing. -var callback = function(error, data, response) { +apiInstance.getUserByName(username, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } -}; -apiInstance.getUserByName(username, callback); +}); ``` ### Parameters @@ -254,23 +249,22 @@ Logs user into the system ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); +import SwaggerPetstore from 'swagger_petstore'; -var apiInstance = new SwaggerPetstore.UserApi(); +let apiInstance = new SwaggerPetstore.UserApi(); -var username = "username_example"; // String | The user name for login +let username = "username_example"; // String | The user name for login -var password = "password_example"; // String | The password for login in clear text +let password = "password_example"; // String | The password for login in clear text -var callback = function(error, data, response) { +apiInstance.loginUser(username, password, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } -}; -apiInstance.loginUser(username, password, callback); +}); ``` ### Parameters @@ -303,18 +297,17 @@ Logs out current logged in user session ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); +import SwaggerPetstore from 'swagger_petstore'; -var apiInstance = new SwaggerPetstore.UserApi(); +let apiInstance = new SwaggerPetstore.UserApi(); -var callback = function(error, data, response) { +apiInstance.logoutUser((error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully.'); } -}; -apiInstance.logoutUser(callback); +}); ``` ### Parameters @@ -343,23 +336,22 @@ This can only be done by the logged in user. ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); +import SwaggerPetstore from 'swagger_petstore'; -var apiInstance = new SwaggerPetstore.UserApi(); +let apiInstance = new SwaggerPetstore.UserApi(); -var username = "username_example"; // String | name that need to be deleted +let username = "username_example"; // String | name that need to be deleted -var body = new SwaggerPetstore.User(); // User | Updated user object +let body = new SwaggerPetstore.User(); // User | Updated user object -var callback = function(error, data, response) { +apiInstance.updateUser(username, body, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully.'); } -}; -apiInstance.updateUser(username, body, callback); +}); ``` ### Parameters diff --git a/samples/client/petstore/javascript-es6/package.json b/samples/client/petstore/javascript-es6/package.json index 881163c02f4..0332217891a 100644 --- a/samples/client/petstore/javascript-es6/package.json +++ b/samples/client/petstore/javascript-es6/package.json @@ -5,17 +5,22 @@ "license": "Unlicense", "main": "src/index.js", "scripts": { - "test": "./node_modules/mocha/bin/mocha --recursive" + "test": "mocha --compilers js:babel-core/register --recursive" }, "browser": { "fs": false }, "dependencies": { + "babel": "^6.23.0", + "babel-cli": "^6.24.1", "superagent": "3.5.2" }, "devDependencies": { + "babel-core": "6.18.0", + "babel-preset-es2015": "^6.24.1", + "babel-preset-stage-0": "^6.24.1", + "expect.js": "~0.3.1", "mocha": "~2.3.4", - "sinon": "1.17.3", - "expect.js": "~0.3.1" + "sinon": "1.17.3" } } diff --git a/samples/client/petstore/javascript-es6/src/ApiClient.js b/samples/client/petstore/javascript-es6/src/ApiClient.js index b56bc9b4e5f..d47828d2a41 100644 --- a/samples/client/petstore/javascript-es6/src/ApiClient.js +++ b/samples/client/petstore/javascript-es6/src/ApiClient.js @@ -7,584 +7,570 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(function(root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['superagent', 'querystring'], factory); - } else if (typeof module === 'object' && module.exports) { - // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('superagent'), require('querystring')); - } else { - // Browser globals (root is window) - if (!root.SwaggerPetstore) { - root.SwaggerPetstore = {}; + +import superagent from "superagent"; +import querystring from "querystring"; + +/** +* @module ApiClient +* @version 1.0.0 +*/ + +/** +* Manages low level client-server communications, parameter marshalling, etc. There should not be any need for an +* application to use this class directly - the *Api and model classes provide the public API for the service. The +* contents of this file should be regarded as internal but are documented for completeness. +* @alias module:ApiClient +* @class +*/ +export default class ApiClient { + constructor() { + /** + * The base URL against which to resolve every API call's (relative) path. + * @type {String} + * @default http://petstore.swagger.io:80/v2 + */ + this.basePath = 'http://petstore.swagger.io:80/v2'.replace(/\/+$/, ''); + + /** + * The authentication methods to be included for all API calls. + * @type {Array.} + */ + this.authentications = { + 'api_key': {type: 'apiKey', 'in': 'header', name: 'api_key'}, + 'http_basic_test': {type: 'basic'}, + 'petstore_auth': {type: 'oauth2'} + } + + /** + * The default HTTP headers to be included for all API calls. + * @type {Array.} + * @default {} + */ + this.defaultHeaders = {}; + + /** + * The default HTTP timeout for all API calls. + * @type {Number} + * @default 60000 + */ + this.timeout = 60000; + + /** + * If set to false an additional timestamp parameter is added to all API GET calls to + * prevent browser caching + * @type {Boolean} + * @default true + */ + this.cache = true; + + /** + * If set to true, the client will save the cookies from each server + * response, and return them in the next request. + * @default false + */ + this.enableCookies = false; + + /* + * Used to save and return cookies in a node.js (non-browser) setting, + * if this.enableCookies is set to true. + */ + if (typeof window === 'undefined') { + this.agent = new superagent.agent(); + } } - root.SwaggerPetstore.ApiClient = factory(root.superagent, root.querystring); - } -}(this, function(superagent, querystring) { - 'use strict'; - - /** - * @module ApiClient - * @version 1.0.0 - */ - - /** - * Manages low level client-server communications, parameter marshalling, etc. There should not be any need for an - * application to use this class directly - the *Api and model classes provide the public API for the service. The - * contents of this file should be regarded as internal but are documented for completeness. - * @alias module:ApiClient - * @class - */ - var exports = function() { - /** - * The base URL against which to resolve every API call's (relative) path. - * @type {String} - * @default http://petstore.swagger.io:80/v2 - */ - this.basePath = 'http://petstore.swagger.io:80/v2'.replace(/\/+$/, ''); /** - * The authentication methods to be included for all API calls. - * @type {Array.} - */ - this.authentications = { - 'api_key': {type: 'apiKey', 'in': 'header', name: 'api_key'}, - 'http_basic_test': {type: 'basic'}, - 'petstore_auth': {type: 'oauth2'} + * Returns a string representation for an actual parameter. + * @param param The actual parameter. + * @returns {String} The string representation of param. + */ + paramToString(param) { + if (param == undefined || param == null) { + return ''; + } + if (param instanceof Date) { + return param.toJSON(); + } + + return param.toString(); + } + + /** + * Builds full URL by appending the given path to the base URL and replacing path parameter place-holders with parameter values. + * NOTE: query parameters are not handled here. + * @param {String} path The path to append to the base URL. + * @param {Object} pathParams The parameter values to append. + * @returns {String} The encoded path with parameter values substituted. + */ + buildUrl(path, pathParams) { + if (!path.match(/^\//)) { + path = '/' + path; + } + + var url = this.basePath + path; + url = url.replace(/\{([\w-]+)\}/g, (fullMatch, key) => { + var value; + if (pathParams.hasOwnProperty(key)) { + value = this.paramToString(pathParams[key]); + } else { + value = fullMatch; + } + + return encodeURIComponent(value); + }); + + return url; + } + + /** + * Checks whether the given content type represents JSON.
+ * JSON content type examples:
+ *
    + *
  • application/json
  • + *
  • application/json; charset=UTF8
  • + *
  • APPLICATION/JSON
  • + *
+ * @param {String} contentType The MIME content type to check. + * @returns {Boolean} true if contentType represents JSON, otherwise false. + */ + isJsonMime(contentType) { + return Boolean(contentType != null && contentType.match(/^application\/json(;.*)?$/i)); + } + + /** + * Chooses a content type from the given array, with JSON preferred; i.e. return JSON if included, otherwise return the first. + * @param {Array.} contentTypes + * @returns {String} The chosen content type, preferring JSON. + */ + jsonPreferredMime(contentTypes) { + for (var i = 0; i < contentTypes.length; i++) { + if (this.isJsonMime(contentTypes[i])) { + return contentTypes[i]; + } + } + + return contentTypes[0]; + } + + /** + * Checks whether the given parameter value represents file-like content. + * @param param The parameter to check. + * @returns {Boolean} true if param represents a file. + */ + isFileParam(param) { + // fs.ReadStream in Node.js and Electron (but not in runtime like browserify) + if (typeof require === 'function') { + let fs; + try { + fs = require('fs'); + } catch (err) {} + if (fs && fs.ReadStream && param instanceof fs.ReadStream) { + return true; + } + } + + // Buffer in Node.js + if (typeof Buffer === 'function' && param instanceof Buffer) { + return true; + } + + // Blob in browser + if (typeof Blob === 'function' && param instanceof Blob) { + return true; + } + + // File in browser (it seems File object is also instance of Blob, but keep this for safe) + if (typeof File === 'function' && param instanceof File) { + return true; + } + + return false; + } + + /** + * Normalizes parameter values: + *
    + *
  • remove nils
  • + *
  • keep files and arrays
  • + *
  • format to string with `paramToString` for other cases
  • + *
+ * @param {Object.} params The parameters as object properties. + * @returns {Object.} normalized parameters. + */ + normalizeParams(params) { + var newParams = {}; + for (var key in params) { + if (params.hasOwnProperty(key) && params[key] != undefined && params[key] != null) { + var value = params[key]; + if (this.isFileParam(value) || Array.isArray(value)) { + newParams[key] = value; + } else { + newParams[key] = this.paramToString(value); + } + } + } + + return newParams; + } + + /** + * Enumeration of collection format separator strategies. + * @enum {String} + * @readonly + */ + static CollectionFormatEnum = { + /** + * Comma-separated values. Value: csv + * @const + */ + CSV: ',', + + /** + * Space-separated values. Value: ssv + * @const + */ + SSV: ' ', + + /** + * Tab-separated values. Value: tsv + * @const + */ + TSV: '\t', + + /** + * Pipe(|)-separated values. Value: pipes + * @const + */ + PIPES: '|', + + /** + * Native array. Value: multi + * @const + */ + MULTI: 'multi' }; - /** - * The default HTTP headers to be included for all API calls. - * @type {Array.} - * @default {} - */ - this.defaultHeaders = {}; /** - * The default HTTP timeout for all API calls. - * @type {Number} - * @default 60000 - */ - this.timeout = 60000; + * Builds a string representation of an array-type actual parameter, according to the given collection format. + * @param {Array} param An array parameter. + * @param {module:ApiClient.CollectionFormatEnum} collectionFormat The array element separator strategy. + * @returns {String|Array} A string representation of the supplied collection, using the specified delimiter. Returns + * param as is if collectionFormat is multi. + */ + buildCollectionParam(param, collectionFormat) { + if (param == null) { + return null; + } + switch (collectionFormat) { + case 'csv': + return param.map(this.paramToString).join(','); + case 'ssv': + return param.map(this.paramToString).join(' '); + case 'tsv': + return param.map(this.paramToString).join('\t'); + case 'pipes': + return param.map(this.paramToString).join('|'); + case 'multi': + //return the array directly as SuperAgent will handle it as expected + return param.map(this.paramToString); + default: + throw new Error('Unknown collection format: ' + collectionFormat); + } + } /** - * If set to false an additional timestamp parameter is added to all API GET calls to - * prevent browser caching - * @type {Boolean} - * @default true - */ - this.cache = true; + * Applies authentication headers to the request. + * @param {Object} request The request object created by a superagent() call. + * @param {Array.} authNames An array of authentication method names. + */ + applyAuthToRequest(request, authNames) { + authNames.forEach((authName) => { + var auth = this.authentications[authName]; + switch (auth.type) { + case 'basic': + if (auth.username || auth.password) { + request.auth(auth.username || '', auth.password || ''); + } + + break; + case 'apiKey': + if (auth.apiKey) { + var data = {}; + if (auth.apiKeyPrefix) { + data[auth.name] = auth.apiKeyPrefix + ' ' + auth.apiKey; + } else { + data[auth.name] = auth.apiKey; + } + + if (auth['in'] === 'header') { + request.set(data); + } else { + request.query(data); + } + } + + break; + case 'oauth2': + if (auth.accessToken) { + request.set({'Authorization': 'Bearer ' + auth.accessToken}); + } + + break; + default: + throw new Error('Unknown authentication type: ' + auth.type); + } + }); + } /** - * If set to true, the client will save the cookies from each server - * response, and return them in the next request. - * @default false - */ - this.enableCookies = false; + * Deserializes an HTTP response body into a value of the specified type. + * @param {Object} response A SuperAgent response object. + * @param {(String|Array.|Object.|Function)} returnType The type to return. Pass a string for simple types + * or the constructor function for a complex type. Pass an array containing the type name to return an array of that type. To + * return an object, pass an object with one property whose name is the key type and whose value is the corresponding value type: + * all properties on data will be converted to this type. + * @returns A value of the specified type. + */ + deserialize(response, returnType) { + if (response == null || returnType == null || response.status == 204) { + return null; + } - /* - * Used to save and return cookies in a node.js (non-browser) setting, - * if this.enableCookies is set to true. - */ - if (typeof window === 'undefined') { - this.agent = new superagent.agent(); + // Rely on SuperAgent for parsing response body. + // See http://visionmedia.github.io/superagent/#parsing-response-bodies + var data = response.body; + if (data == null || (typeof data === 'object' && typeof data.length === 'undefined' && !Object.keys(data).length)) { + // SuperAgent does not always produce a body; use the unparsed response as a fallback + data = response.text; + } + + return ApiClient.convertToType(data, returnType); } - }; + /** + * Callback function to receive the result of the operation. + * @callback module:ApiClient~callApiCallback + * @param {String} error Error message, if any. + * @param data The data returned by the service call. + * @param {String} response The complete HTTP response. + */ - /** - * Returns a string representation for an actual parameter. - * @param param The actual parameter. - * @returns {String} The string representation of param. - */ - exports.prototype.paramToString = function(param) { - if (param == undefined || param == null) { - return ''; - } - if (param instanceof Date) { - return param.toJSON(); - } - return param.toString(); - }; + /** + * Invokes the REST service using the supplied settings and parameters. + * @param {String} path The base URL to invoke. + * @param {String} httpMethod The HTTP method to use. + * @param {Object.} pathParams A map of path parameters and their values. + * @param {Object.} queryParams A map of query parameters and their values. + * @param {Object.} headerParams A map of header parameters and their values. + * @param {Object.} formParams A map of form parameters and their values. + * @param {Object} bodyParam The value to pass as the request body. + * @param {Array.} authNames An array of authentication type names. + * @param {Array.} contentTypes An array of request MIME types. + * @param {Array.} accepts An array of acceptable response MIME types. + * @param {(String|Array|ObjectFunction)} returnType The required type to return; can be a string for simple types or the + * constructor for a complex type. + * @param {module:ApiClient~callApiCallback} callback The callback function. + * @returns {Object} The SuperAgent request object. + */ + callApi(path, httpMethod, pathParams, + queryParams, headerParams, formParams, bodyParam, authNames, contentTypes, accepts, + returnType, callback) { - /** - * Builds full URL by appending the given path to the base URL and replacing path parameter place-holders with parameter values. - * NOTE: query parameters are not handled here. - * @param {String} path The path to append to the base URL. - * @param {Object} pathParams The parameter values to append. - * @returns {String} The encoded path with parameter values substituted. - */ - exports.prototype.buildUrl = function(path, pathParams) { - if (!path.match(/^\//)) { - path = '/' + path; - } - var url = this.basePath + path; - var _this = this; - url = url.replace(/\{([\w-]+)\}/g, function(fullMatch, key) { - var value; - if (pathParams.hasOwnProperty(key)) { - value = _this.paramToString(pathParams[key]); - } else { - value = fullMatch; - } - return encodeURIComponent(value); - }); - return url; - }; + var url = this.buildUrl(path, pathParams); + var request = superagent(httpMethod, url); - /** - * Checks whether the given content type represents JSON.
- * JSON content type examples:
- *
    - *
  • application/json
  • - *
  • application/json; charset=UTF8
  • - *
  • APPLICATION/JSON
  • - *
- * @param {String} contentType The MIME content type to check. - * @returns {Boolean} true if contentType represents JSON, otherwise false. - */ - exports.prototype.isJsonMime = function(contentType) { - return Boolean(contentType != null && contentType.match(/^application\/json(;.*)?$/i)); - }; + // apply authentications + this.applyAuthToRequest(request, authNames); - /** - * Chooses a content type from the given array, with JSON preferred; i.e. return JSON if included, otherwise return the first. - * @param {Array.} contentTypes - * @returns {String} The chosen content type, preferring JSON. - */ - exports.prototype.jsonPreferredMime = function(contentTypes) { - for (var i = 0; i < contentTypes.length; i++) { - if (this.isJsonMime(contentTypes[i])) { - return contentTypes[i]; - } - } - return contentTypes[0]; - }; + // set query parameters + if (httpMethod.toUpperCase() === 'GET' && this.cache === false) { + queryParams['_'] = new Date().getTime(); + } - /** - * Checks whether the given parameter value represents file-like content. - * @param param The parameter to check. - * @returns {Boolean} true if param represents a file. - */ - exports.prototype.isFileParam = function(param) { - // fs.ReadStream in Node.js and Electron (but not in runtime like browserify) - if (typeof require === 'function') { - var fs; - try { - fs = require('fs'); - } catch (err) {} - if (fs && fs.ReadStream && param instanceof fs.ReadStream) { - return true; - } - } - // Buffer in Node.js - if (typeof Buffer === 'function' && param instanceof Buffer) { - return true; - } - // Blob in browser - if (typeof Blob === 'function' && param instanceof Blob) { - return true; - } - // File in browser (it seems File object is also instance of Blob, but keep this for safe) - if (typeof File === 'function' && param instanceof File) { - return true; - } - return false; - }; + request.query(this.normalizeParams(queryParams)); - /** - * Normalizes parameter values: - *
    - *
  • remove nils
  • - *
  • keep files and arrays
  • - *
  • format to string with `paramToString` for other cases
  • - *
- * @param {Object.} params The parameters as object properties. - * @returns {Object.} normalized parameters. - */ - exports.prototype.normalizeParams = function(params) { - var newParams = {}; - for (var key in params) { - if (params.hasOwnProperty(key) && params[key] != undefined && params[key] != null) { - var value = params[key]; - if (this.isFileParam(value) || Array.isArray(value)) { - newParams[key] = value; + // set header parameters + request.set(this.defaultHeaders).set(this.normalizeParams(headerParams)); + + // set request timeout + request.timeout(this.timeout); + + var contentType = this.jsonPreferredMime(contentTypes); + if (contentType) { + // Issue with superagent and multipart/form-data (https://github.com/visionmedia/superagent/issues/746) + if(contentType != 'multipart/form-data') { + request.type(contentType); + } + } else if (!request.header['Content-Type']) { + request.type('application/json'); + } + + if (contentType === 'application/x-www-form-urlencoded') { + request.send(querystring.stringify(this.normalizeParams(formParams))); + } else if (contentType == 'multipart/form-data') { + var _formParams = this.normalizeParams(formParams); + for (var key in _formParams) { + if (_formParams.hasOwnProperty(key)) { + if (this.isFileParam(_formParams[key])) { + // file field + request.attach(key, _formParams[key]); + } else { + request.field(key, _formParams[key]); + } + } + } + } else if (bodyParam) { + request.send(bodyParam); + } + + var accept = this.jsonPreferredMime(accepts); + if (accept) { + request.accept(accept); + } + + if (returnType === 'Blob') { + request.responseType('blob'); + } else if (returnType === 'String') { + request.responseType('string'); + } + + // Attach previously saved cookies, if enabled + if (this.enableCookies){ + if (typeof window === 'undefined') { + this.agent.attachCookies(request); + } + else { + request.withCredentials(); + } + } + + + + request.end((error, response) => { + if (callback) { + var data = null; + if (!error) { + try { + data = this.deserialize(response, returnType); + if (this.enableCookies && typeof window === 'undefined'){ + this.agent.saveCookies(response); + } + } catch (err) { + error = err; + } + } + + callback(error, data, response); + } + }); + + return request; + } + + /** + * Parses an ISO-8601 string representation of a date value. + * @param {String} str The date value as a string. + * @returns {Date} The parsed date object. + */ + static parseDate(str) { + return new Date(str.replace(/T/i, ' ')); + } + + /** + * Converts a value to the specified type. + * @param {(String|Object)} data The data to convert, as a string or object. + * @param {(String|Array.|Object.|Function)} type The type to return. Pass a string for simple types + * or the constructor function for a complex type. Pass an array containing the type name to return an array of that type. To + * return an object, pass an object with one property whose name is the key type and whose value is the corresponding value type: + * all properties on data will be converted to this type. + * @returns An instance of the specified type or null or undefined if data is null or undefined. + */ + static convertToType(data, type) { + if (data === null || data === undefined) + return data + + switch (type) { + case 'Boolean': + return Boolean(data); + case 'Integer': + return parseInt(data, 10); + case 'Number': + return parseFloat(data); + case 'String': + return String(data); + case 'Date': + return ApiClient.parseDate(String(data)); + case 'Blob': + return data; + default: + if (type === Object) { + // generic object, return directly + return data; + } else if (typeof type === 'function') { + // for model type like: User + return type.constructFromObject(data); + } else if (Array.isArray(type)) { + // for array type like: ['String'] + var itemType = type[0]; + + return data.map((item) => { + return ApiClient.convertToType(item, itemType); + }); + } else if (typeof type === 'object') { + // for plain object type like: {'String': 'Integer'} + var keyType, valueType; + for (var k in type) { + if (type.hasOwnProperty(k)) { + keyType = k; + valueType = type[k]; + break; + } + } + + var result = {}; + for (var k in data) { + if (data.hasOwnProperty(k)) { + var key = ApiClient.convertToType(k, keyType); + var value = ApiClient.convertToType(data[k], valueType); + result[key] = value; + } + } + + return result; + } else { + // for unknown type, return the data directly + return data; + } + } + } + + /** + * Constructs a new map or array model from REST data. + * @param data {Object|Array} The REST data. + * @param obj {Object|Array} The target object or array. + */ + static constructFromObject(data, obj, itemType) { + if (Array.isArray(data)) { + for (var i = 0; i < data.length; i++) { + if (data.hasOwnProperty(i)) + obj[i] = ApiClient.convertToType(data[i], itemType); + } } else { - newParams[key] = this.paramToString(value); - } - } - } - return newParams; - }; - - /** - * Enumeration of collection format separator strategies. - * @enum {String} - * @readonly - */ - exports.CollectionFormatEnum = { - /** - * Comma-separated values. Value: csv - * @const - */ - CSV: ',', - /** - * Space-separated values. Value: ssv - * @const - */ - SSV: ' ', - /** - * Tab-separated values. Value: tsv - * @const - */ - TSV: '\t', - /** - * Pipe(|)-separated values. Value: pipes - * @const - */ - PIPES: '|', - /** - * Native array. Value: multi - * @const - */ - MULTI: 'multi' - }; - - /** - * Builds a string representation of an array-type actual parameter, according to the given collection format. - * @param {Array} param An array parameter. - * @param {module:ApiClient.CollectionFormatEnum} collectionFormat The array element separator strategy. - * @returns {String|Array} A string representation of the supplied collection, using the specified delimiter. Returns - * param as is if collectionFormat is multi. - */ - exports.prototype.buildCollectionParam = function buildCollectionParam(param, collectionFormat) { - if (param == null) { - return null; - } - switch (collectionFormat) { - case 'csv': - return param.map(this.paramToString).join(','); - case 'ssv': - return param.map(this.paramToString).join(' '); - case 'tsv': - return param.map(this.paramToString).join('\t'); - case 'pipes': - return param.map(this.paramToString).join('|'); - case 'multi': - // return the array directly as SuperAgent will handle it as expected - return param.map(this.paramToString); - default: - throw new Error('Unknown collection format: ' + collectionFormat); - } - }; - - /** - * Applies authentication headers to the request. - * @param {Object} request The request object created by a superagent() call. - * @param {Array.} authNames An array of authentication method names. - */ - exports.prototype.applyAuthToRequest = function(request, authNames) { - var _this = this; - authNames.forEach(function(authName) { - var auth = _this.authentications[authName]; - switch (auth.type) { - case 'basic': - if (auth.username || auth.password) { - request.auth(auth.username || '', auth.password || ''); - } - break; - case 'apiKey': - if (auth.apiKey) { - var data = {}; - if (auth.apiKeyPrefix) { - data[auth.name] = auth.apiKeyPrefix + ' ' + auth.apiKey; - } else { - data[auth.name] = auth.apiKey; + for (var k in data) { + if (data.hasOwnProperty(k)) + obj[k] = ApiClient.convertToType(data[k], itemType); } - if (auth['in'] === 'header') { - request.set(data); - } else { - request.query(data); - } - } - break; - case 'oauth2': - if (auth.accessToken) { - request.set({'Authorization': 'Bearer ' + auth.accessToken}); - } - break; - default: - throw new Error('Unknown authentication type: ' + auth.type); - } - }); - }; - - /** - * Deserializes an HTTP response body into a value of the specified type. - * @param {Object} response A SuperAgent response object. - * @param {(String|Array.|Object.|Function)} returnType The type to return. Pass a string for simple types - * or the constructor function for a complex type. Pass an array containing the type name to return an array of that type. To - * return an object, pass an object with one property whose name is the key type and whose value is the corresponding value type: - * all properties on data will be converted to this type. - * @returns A value of the specified type. - */ - exports.prototype.deserialize = function deserialize(response, returnType) { - if (response == null || returnType == null || response.status == 204) { - return null; - } - // Rely on SuperAgent for parsing response body. - // See http://visionmedia.github.io/superagent/#parsing-response-bodies - var data = response.body; - if (data == null || (typeof data === 'object' && typeof data.length === 'undefined' && !Object.keys(data).length)) { - // SuperAgent does not always produce a body; use the unparsed response as a fallback - data = response.text; - } - return exports.convertToType(data, returnType); - }; - - /** - * Callback function to receive the result of the operation. - * @callback module:ApiClient~callApiCallback - * @param {String} error Error message, if any. - * @param data The data returned by the service call. - * @param {String} response The complete HTTP response. - */ - - /** - * Invokes the REST service using the supplied settings and parameters. - * @param {String} path The base URL to invoke. - * @param {String} httpMethod The HTTP method to use. - * @param {Object.} pathParams A map of path parameters and their values. - * @param {Object.} queryParams A map of query parameters and their values. - * @param {Object.} collectionQueryParams A map of collection query parameters and their values. - * @param {Object.} headerParams A map of header parameters and their values. - * @param {Object.} formParams A map of form parameters and their values. - * @param {Object} bodyParam The value to pass as the request body. - * @param {Array.} authNames An array of authentication type names. - * @param {Array.} contentTypes An array of request MIME types. - * @param {Array.} accepts An array of acceptable response MIME types. - * @param {(String|Array|ObjectFunction)} returnType The required type to return; can be a string for simple types or the - * constructor for a complex type. - * @param {module:ApiClient~callApiCallback} callback The callback function. - * @returns {Object} The SuperAgent request object. - */ - exports.prototype.callApi = function callApi(path, httpMethod, pathParams, - queryParams, collectionQueryParams, headerParams, formParams, bodyParam, authNames, contentTypes, accepts, - returnType, callback) { - - var _this = this; - var url = this.buildUrl(path, pathParams); - var request = superagent(httpMethod, url); - - // apply authentications - this.applyAuthToRequest(request, authNames); - - // set collection query parameters - for (var key in collectionQueryParams) { - if (collectionQueryParams.hasOwnProperty(key)) { - var param = collectionQueryParams[key]; - if (param.collectionFormat === 'csv') { - // SuperAgent normally percent-encodes all reserved characters in a query parameter. However, - // commas are used as delimiters for the 'csv' collectionFormat so they must not be encoded. We - // must therefore construct and encode 'csv' collection query parameters manually. - if (param.value != null) { - var value = param.value.map(this.paramToString).map(encodeURIComponent).join(','); - request.query(encodeURIComponent(key) + "=" + value); - } - } else { - // All other collection query parameters should be treated as ordinary query parameters. - queryParams[key] = this.buildCollectionParam(param.value, param.collectionFormat); } - } - } + }; +} - // set query parameters - if (httpMethod.toUpperCase() === 'GET' && this.cache === false) { - queryParams['_'] = new Date().getTime(); - } - request.query(this.normalizeParams(queryParams)); - - // set header parameters - request.set(this.defaultHeaders).set(this.normalizeParams(headerParams)); - - // set request timeout - request.timeout(this.timeout); - - var contentType = this.jsonPreferredMime(contentTypes); - if (contentType) { - // Issue with superagent and multipart/form-data (https://github.com/visionmedia/superagent/issues/746) - if(contentType != 'multipart/form-data') { - request.type(contentType); - } - } else if (!request.header['Content-Type']) { - request.type('application/json'); - } - - if (contentType === 'application/x-www-form-urlencoded') { - request.send(querystring.stringify(this.normalizeParams(formParams))); - } else if (contentType == 'multipart/form-data') { - var _formParams = this.normalizeParams(formParams); - for (var key in _formParams) { - if (_formParams.hasOwnProperty(key)) { - if (this.isFileParam(_formParams[key])) { - // file field - request.attach(key, _formParams[key]); - } else { - request.field(key, _formParams[key]); - } - } - } - } else if (bodyParam) { - request.send(bodyParam); - } - - var accept = this.jsonPreferredMime(accepts); - if (accept) { - request.accept(accept); - } - - if (returnType === 'Blob') { - request.responseType('blob'); - } else if (returnType === 'String') { - request.responseType('string'); - } - - // Attach previously saved cookies, if enabled - if (this.enableCookies){ - if (typeof window === 'undefined') { - this.agent.attachCookies(request); - } - else { - request.withCredentials(); - } - } - - - request.end(function(error, response) { - if (callback) { - var data = null; - if (!error) { - try { - data = _this.deserialize(response, returnType); - if (_this.enableCookies && typeof window === 'undefined'){ - _this.agent.saveCookies(response); - } - } catch (err) { - error = err; - } - } - callback(error, data, response); - } - }); - - return request; - }; - - /** - * Parses an ISO-8601 string representation of a date value. - * @param {String} str The date value as a string. - * @returns {Date} The parsed date object. - */ - exports.parseDate = function(str) { - return new Date(str.replace(/T/i, ' ')); - }; - - /** - * Converts a value to the specified type. - * @param {(String|Object)} data The data to convert, as a string or object. - * @param {(String|Array.|Object.|Function)} type The type to return. Pass a string for simple types - * or the constructor function for a complex type. Pass an array containing the type name to return an array of that type. To - * return an object, pass an object with one property whose name is the key type and whose value is the corresponding value type: - * all properties on data will be converted to this type. - * @returns An instance of the specified type or null or undefined if data is null or undefined. - */ - exports.convertToType = function(data, type) { - if (data === null || data === undefined) - return data - - switch (type) { - case 'Boolean': - return Boolean(data); - case 'Integer': - return parseInt(data, 10); - case 'Number': - return parseFloat(data); - case 'String': - return String(data); - case 'Date': - return this.parseDate(String(data)); - case 'Blob': - return data; - default: - if (type === Object) { - // generic object, return directly - return data; - } else if (typeof type === 'function') { - // for model type like: User - return type.constructFromObject(data); - } else if (Array.isArray(type)) { - // for array type like: ['String'] - var itemType = type[0]; - return data.map(function(item) { - return exports.convertToType(item, itemType); - }); - } else if (typeof type === 'object') { - // for plain object type like: {'String': 'Integer'} - var keyType, valueType; - for (var k in type) { - if (type.hasOwnProperty(k)) { - keyType = k; - valueType = type[k]; - break; - } - } - var result = {}; - for (var k in data) { - if (data.hasOwnProperty(k)) { - var key = exports.convertToType(k, keyType); - var value = exports.convertToType(data[k], valueType); - result[key] = value; - } - } - return result; - } else { - // for unknown type, return the data directly - return data; - } - } - }; - - /** - * Constructs a new map or array model from REST data. - * @param data {Object|Array} The REST data. - * @param obj {Object|Array} The target object or array. - */ - exports.constructFromObject = function(data, obj, itemType) { - if (Array.isArray(data)) { - for (var i = 0; i < data.length; i++) { - if (data.hasOwnProperty(i)) - obj[i] = exports.convertToType(data[i], itemType); - } - } else { - for (var k in data) { - if (data.hasOwnProperty(k)) - obj[k] = exports.convertToType(data[k], itemType); - } - } - }; - - /** - * The default API client implementation. - * @type {module:ApiClient} - */ - exports.instance = new exports(); - - return exports; -})); +/** +* The default API client implementation. +* @type {module:ApiClient} +*/ +ApiClient.instance = new ApiClient(); diff --git a/samples/client/petstore/javascript-es6/src/api/FakeApi.js b/samples/client/petstore/javascript-es6/src/api/FakeApi.js index 7353eb33f40..df4371ba8f3 100644 --- a/samples/client/petstore/javascript-es6/src/api/FakeApi.js +++ b/samples/client/petstore/javascript-es6/src/api/FakeApi.js @@ -7,45 +7,35 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(function(root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['ApiClient', 'model/Client', 'model/OuterBoolean', 'model/OuterComposite', 'model/OuterNumber', 'model/OuterString'], factory); - } else if (typeof module === 'object' && module.exports) { - // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('../ApiClient'), require('../model/Client'), require('../model/OuterBoolean'), require('../model/OuterComposite'), require('../model/OuterNumber'), require('../model/OuterString')); - } else { - // Browser globals (root is window) - if (!root.SwaggerPetstore) { - root.SwaggerPetstore = {}; + +import ApiClient from "../ApiClient"; +import Client from '../model/Client'; +import OuterBoolean from '../model/OuterBoolean'; +import OuterComposite from '../model/OuterComposite'; +import OuterNumber from '../model/OuterNumber'; +import OuterString from '../model/OuterString'; + +/** +* Fake service. +* @module api/FakeApi +* @version 1.0.0 +*/ +export default class FakeApi { + + /** + * Constructs a new FakeApi. + * @alias module:api/FakeApi + * @class + * @param {module:ApiClient} apiClient Optional API client implementation to use, + * default to {@link module:ApiClient#instance} if unspecified. + */ + constructor(apiClient) { + this.apiClient = apiClient || ApiClient.instance; } - root.SwaggerPetstore.FakeApi = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.Client, root.SwaggerPetstore.OuterBoolean, root.SwaggerPetstore.OuterComposite, root.SwaggerPetstore.OuterNumber, root.SwaggerPetstore.OuterString); - } -}(this, function(ApiClient, Client, OuterBoolean, OuterComposite, OuterNumber, OuterString) { - 'use strict'; - - /** - * Fake service. - * @module api/FakeApi - * @version 1.0.0 - */ - - /** - * Constructs a new FakeApi. - * @alias module:api/FakeApi - * @class - * @param {module:ApiClient} apiClient Optional API client implementation to use, - * default to {@link module:ApiClient#instance} if unspecified. - */ - var exports = function(apiClient) { - this.apiClient = apiClient || ApiClient.instance; /** @@ -63,30 +53,28 @@ * @param {module:api/FakeApi~fakeOuterBooleanSerializeCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/OuterBoolean} */ - this.fakeOuterBooleanSerialize = function(opts, callback) { + fakeOuterBooleanSerialize(opts, callback) { opts = opts || {}; - var postBody = opts['body']; + let postBody = opts['body']; - var pathParams = { + let pathParams = { }; - var queryParams = { + let queryParams = { }; - var collectionQueryParams = { + let headerParams = { }; - var headerParams = { - }; - var formParams = { + let formParams = { }; - var authNames = []; - var contentTypes = []; - var accepts = []; - var returnType = OuterBoolean; + let authNames = []; + let contentTypes = []; + let accepts = []; + let returnType = OuterBoolean; return this.apiClient.callApi( '/fake/outer/boolean', 'POST', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } @@ -106,30 +94,28 @@ * @param {module:api/FakeApi~fakeOuterCompositeSerializeCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/OuterComposite} */ - this.fakeOuterCompositeSerialize = function(opts, callback) { + fakeOuterCompositeSerialize(opts, callback) { opts = opts || {}; - var postBody = opts['body']; + let postBody = opts['body']; - var pathParams = { + let pathParams = { }; - var queryParams = { + let queryParams = { }; - var collectionQueryParams = { + let headerParams = { }; - var headerParams = { - }; - var formParams = { + let formParams = { }; - var authNames = []; - var contentTypes = []; - var accepts = []; - var returnType = OuterComposite; + let authNames = []; + let contentTypes = []; + let accepts = []; + let returnType = OuterComposite; return this.apiClient.callApi( '/fake/outer/composite', 'POST', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } @@ -149,30 +135,28 @@ * @param {module:api/FakeApi~fakeOuterNumberSerializeCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/OuterNumber} */ - this.fakeOuterNumberSerialize = function(opts, callback) { + fakeOuterNumberSerialize(opts, callback) { opts = opts || {}; - var postBody = opts['body']; + let postBody = opts['body']; - var pathParams = { + let pathParams = { }; - var queryParams = { + let queryParams = { }; - var collectionQueryParams = { + let headerParams = { }; - var headerParams = { - }; - var formParams = { + let formParams = { }; - var authNames = []; - var contentTypes = []; - var accepts = []; - var returnType = OuterNumber; + let authNames = []; + let contentTypes = []; + let accepts = []; + let returnType = OuterNumber; return this.apiClient.callApi( '/fake/outer/number', 'POST', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } @@ -192,30 +176,28 @@ * @param {module:api/FakeApi~fakeOuterStringSerializeCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/OuterString} */ - this.fakeOuterStringSerialize = function(opts, callback) { + fakeOuterStringSerialize(opts, callback) { opts = opts || {}; - var postBody = opts['body']; + let postBody = opts['body']; - var pathParams = { + let pathParams = { }; - var queryParams = { + let queryParams = { }; - var collectionQueryParams = { + let headerParams = { }; - var headerParams = { - }; - var formParams = { + let formParams = { }; - var authNames = []; - var contentTypes = []; - var accepts = []; - var returnType = OuterString; + let authNames = []; + let contentTypes = []; + let accepts = []; + let returnType = OuterString; return this.apiClient.callApi( '/fake/outer/string', 'POST', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } @@ -235,8 +217,8 @@ * @param {module:api/FakeApi~testClientModelCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/Client} */ - this.testClientModel = function(body, callback) { - var postBody = body; + testClientModel(body, callback) { + let postBody = body; // verify the required parameter 'body' is set if (body === undefined || body === null) { @@ -244,25 +226,23 @@ } - var pathParams = { + let pathParams = { }; - var queryParams = { + let queryParams = { }; - var collectionQueryParams = { + let headerParams = { }; - var headerParams = { - }; - var formParams = { + let formParams = { }; - var authNames = []; - var contentTypes = ['application/json']; - var accepts = ['application/json']; - var returnType = Client; + let authNames = []; + let contentTypes = ['application/json']; + let accepts = ['application/json']; + let returnType = Client; return this.apiClient.callApi( '/fake', 'PATCH', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } @@ -295,9 +275,9 @@ * @param {String} opts.callback None * @param {module:api/FakeApi~testEndpointParametersCallback} callback The callback function, accepting three arguments: error, data, response */ - this.testEndpointParameters = function(_number, _double, patternWithoutDelimiter, _byte, opts, callback) { + testEndpointParameters(_number, _double, patternWithoutDelimiter, _byte, opts, callback) { opts = opts || {}; - var postBody = null; + let postBody = null; // verify the required parameter '_number' is set if (_number === undefined || _number === null) { @@ -320,15 +300,13 @@ } - var pathParams = { + let pathParams = { }; - var queryParams = { + let queryParams = { }; - var collectionQueryParams = { + let headerParams = { }; - var headerParams = { - }; - var formParams = { + let formParams = { 'integer': opts['integer'], 'int32': opts['int32'], 'int64': opts['int64'], @@ -345,14 +323,14 @@ 'callback': opts['callback'] }; - var authNames = ['http_basic_test']; - 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; + let authNames = ['http_basic_test']; + let contentTypes = ['application/xml; charset=utf-8', 'application/json; charset=utf-8']; + let accepts = ['application/xml; charset=utf-8', 'application/json; charset=utf-8']; + let returnType = null; return this.apiClient.callApi( '/fake', 'POST', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } @@ -379,45 +357,91 @@ * @param {module:model/Number} opts.enumQueryDouble Query parameter enum test (double) * @param {module:api/FakeApi~testEnumParametersCallback} callback The callback function, accepting three arguments: error, data, response */ - this.testEnumParameters = function(opts, callback) { + testEnumParameters(opts, callback) { opts = opts || {}; - var postBody = null; + let postBody = null; - var pathParams = { + let pathParams = { }; - var queryParams = { + let queryParams = { + 'enum_query_string_array': this.apiClient.buildCollectionParam(opts['enumQueryStringArray'], 'csv'), 'enum_query_string': opts['enumQueryString'], - 'enum_query_integer': opts['enumQueryInteger'], + 'enum_query_integer': opts['enumQueryInteger'] }; - var collectionQueryParams = { - 'enum_query_string_array': { - value: opts['enumQueryStringArray'], - collectionFormat: 'csv' - }, - }; - var headerParams = { + let headerParams = { 'enum_header_string_array': opts['enumHeaderStringArray'], 'enum_header_string': opts['enumHeaderString'] }; - var formParams = { + let formParams = { 'enum_form_string_array': this.apiClient.buildCollectionParam(opts['enumFormStringArray'], 'csv'), 'enum_form_string': opts['enumFormString'], 'enum_query_double': opts['enumQueryDouble'] }; - var authNames = []; - var contentTypes = ['*/*']; - var accepts = ['*/*']; - var returnType = null; + let authNames = []; + let contentTypes = ['*/*']; + let accepts = ['*/*']; + let returnType = null; return this.apiClient.callApi( '/fake', 'GET', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } - }; - return exports; -})); + /** + * Callback function to receive the result of the testJsonFormData operation. + * @callback module:api/FakeApi~testJsonFormDataCallback + * @param {String} error Error message, if any. + * @param data This operation does not return a value. + * @param {String} response The complete HTTP response. + */ + + /** + * test json serialization of form data + * + * @param {String} param field1 + * @param {String} param2 field2 + * @param {module:api/FakeApi~testJsonFormDataCallback} callback The callback function, accepting three arguments: error, data, response + */ + testJsonFormData(param, param2, callback) { + let postBody = null; + + // verify the required parameter 'param' is set + if (param === undefined || param === null) { + throw new Error("Missing the required parameter 'param' when calling testJsonFormData"); + } + + // verify the required parameter 'param2' is set + if (param2 === undefined || param2 === null) { + throw new Error("Missing the required parameter 'param2' when calling testJsonFormData"); + } + + + let pathParams = { + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + 'param': param, + 'param2': param2 + }; + + let authNames = []; + let contentTypes = ['application/json']; + let accepts = []; + let returnType = null; + + return this.apiClient.callApi( + '/fake/jsonFormData', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, callback + ); + } + + +} diff --git a/samples/client/petstore/javascript-es6/src/api/Fake_classname_tags123Api.js b/samples/client/petstore/javascript-es6/src/api/Fake_classname_tags123Api.js index 67c002e26c0..43cb8ffd875 100644 --- a/samples/client/petstore/javascript-es6/src/api/Fake_classname_tags123Api.js +++ b/samples/client/petstore/javascript-es6/src/api/Fake_classname_tags123Api.js @@ -7,45 +7,31 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(function(root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['ApiClient', 'model/Client'], factory); - } else if (typeof module === 'object' && module.exports) { - // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('../ApiClient'), require('../model/Client')); - } else { - // Browser globals (root is window) - if (!root.SwaggerPetstore) { - root.SwaggerPetstore = {}; + +import ApiClient from "../ApiClient"; +import Client from '../model/Client'; + +/** +* Fake_classname_tags123 service. +* @module api/Fake_classname_tags123Api +* @version 1.0.0 +*/ +export default class Fake_classname_tags123Api { + + /** + * Constructs a new Fake_classname_tags123Api. + * @alias module:api/Fake_classname_tags123Api + * @class + * @param {module:ApiClient} apiClient Optional API client implementation to use, + * default to {@link module:ApiClient#instance} if unspecified. + */ + constructor(apiClient) { + this.apiClient = apiClient || ApiClient.instance; } - root.SwaggerPetstore.Fake_classname_tags123Api = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.Client); - } -}(this, function(ApiClient, Client) { - 'use strict'; - - /** - * Fake_classname_tags123 service. - * @module api/Fake_classname_tags123Api - * @version 1.0.0 - */ - - /** - * Constructs a new Fake_classname_tags123Api. - * @alias module:api/Fake_classname_tags123Api - * @class - * @param {module:ApiClient} apiClient Optional API client implementation to use, - * default to {@link module:ApiClient#instance} if unspecified. - */ - var exports = function(apiClient) { - this.apiClient = apiClient || ApiClient.instance; /** @@ -62,8 +48,8 @@ * @param {module:api/Fake_classname_tags123Api~testClassnameCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/Client} */ - this.testClassname = function(body, callback) { - var postBody = body; + testClassname(body, callback) { + let postBody = body; // verify the required parameter 'body' is set if (body === undefined || body === null) { @@ -71,29 +57,26 @@ } - var pathParams = { + let pathParams = { }; - var queryParams = { + let queryParams = { }; - var collectionQueryParams = { + let headerParams = { }; - var headerParams = { - }; - var formParams = { + let formParams = { }; - var authNames = []; - var contentTypes = ['application/json']; - var accepts = ['application/json']; - var returnType = Client; + let authNames = []; + let contentTypes = ['application/json']; + let accepts = ['application/json']; + let returnType = Client; return this.apiClient.callApi( '/fake_classname_test', 'PATCH', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } - }; - return exports; -})); + +} diff --git a/samples/client/petstore/javascript-es6/src/api/PetApi.js b/samples/client/petstore/javascript-es6/src/api/PetApi.js index dffd8db2bcb..e59d99bcc38 100644 --- a/samples/client/petstore/javascript-es6/src/api/PetApi.js +++ b/samples/client/petstore/javascript-es6/src/api/PetApi.js @@ -7,45 +7,32 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(function(root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['ApiClient', 'model/ApiResponse', 'model/Pet'], factory); - } else if (typeof module === 'object' && module.exports) { - // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('../ApiClient'), require('../model/ApiResponse'), require('../model/Pet')); - } else { - // Browser globals (root is window) - if (!root.SwaggerPetstore) { - root.SwaggerPetstore = {}; + +import ApiClient from "../ApiClient"; +import ApiResponse from '../model/ApiResponse'; +import Pet from '../model/Pet'; + +/** +* Pet service. +* @module api/PetApi +* @version 1.0.0 +*/ +export default class PetApi { + + /** + * Constructs a new PetApi. + * @alias module:api/PetApi + * @class + * @param {module:ApiClient} apiClient Optional API client implementation to use, + * default to {@link module:ApiClient#instance} if unspecified. + */ + constructor(apiClient) { + this.apiClient = apiClient || ApiClient.instance; } - root.SwaggerPetstore.PetApi = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.ApiResponse, root.SwaggerPetstore.Pet); - } -}(this, function(ApiClient, ApiResponse, Pet) { - 'use strict'; - - /** - * Pet service. - * @module api/PetApi - * @version 1.0.0 - */ - - /** - * Constructs a new PetApi. - * @alias module:api/PetApi - * @class - * @param {module:ApiClient} apiClient Optional API client implementation to use, - * default to {@link module:ApiClient#instance} if unspecified. - */ - var exports = function(apiClient) { - this.apiClient = apiClient || ApiClient.instance; /** @@ -62,8 +49,8 @@ * @param {module:model/Pet} body Pet object that needs to be added to the store * @param {module:api/PetApi~addPetCallback} callback The callback function, accepting three arguments: error, data, response */ - this.addPet = function(body, callback) { - var postBody = body; + addPet(body, callback) { + let postBody = body; // verify the required parameter 'body' is set if (body === undefined || body === null) { @@ -71,25 +58,23 @@ } - var pathParams = { + let pathParams = { }; - var queryParams = { + let queryParams = { }; - var collectionQueryParams = { + let headerParams = { }; - var headerParams = { - }; - var formParams = { + let formParams = { }; - var authNames = ['petstore_auth']; - var contentTypes = ['application/json', 'application/xml']; - var accepts = ['application/xml', 'application/json']; - var returnType = null; + let authNames = ['petstore_auth']; + let contentTypes = ['application/json', 'application/xml']; + let accepts = ['application/xml', 'application/json']; + let returnType = null; return this.apiClient.callApi( '/pet', 'POST', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } @@ -110,9 +95,9 @@ * @param {String} opts.apiKey * @param {module:api/PetApi~deletePetCallback} callback The callback function, accepting three arguments: error, data, response */ - this.deletePet = function(petId, opts, callback) { + deletePet(petId, opts, callback) { opts = opts || {}; - var postBody = null; + let postBody = null; // verify the required parameter 'petId' is set if (petId === undefined || petId === null) { @@ -120,27 +105,25 @@ } - var pathParams = { + let pathParams = { 'petId': petId }; - var queryParams = { + let queryParams = { }; - var collectionQueryParams = { - }; - var headerParams = { + let headerParams = { 'api_key': opts['apiKey'] }; - var formParams = { + let formParams = { }; - var authNames = ['petstore_auth']; - var contentTypes = []; - var accepts = ['application/xml', 'application/json']; - var returnType = null; + let authNames = ['petstore_auth']; + let contentTypes = []; + let accepts = ['application/xml', 'application/json']; + let returnType = null; return this.apiClient.callApi( '/pet/{petId}', 'DELETE', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } @@ -160,8 +143,8 @@ * @param {module:api/PetApi~findPetsByStatusCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link Array.} */ - this.findPetsByStatus = function(status, callback) { - var postBody = null; + findPetsByStatus(status, callback) { + let postBody = null; // verify the required parameter 'status' is set if (status === undefined || status === null) { @@ -169,29 +152,24 @@ } - var pathParams = { + let pathParams = { }; - var queryParams = { + let queryParams = { + 'status': this.apiClient.buildCollectionParam(status, 'csv') }; - var collectionQueryParams = { - 'status': { - value: status, - collectionFormat: 'csv' - }, + let headerParams = { }; - var headerParams = { - }; - var formParams = { + let formParams = { }; - var authNames = ['petstore_auth']; - var contentTypes = []; - var accepts = ['application/xml', 'application/json']; - var returnType = [Pet]; + let authNames = ['petstore_auth']; + let contentTypes = []; + let accepts = ['application/xml', 'application/json']; + let returnType = [Pet]; return this.apiClient.callApi( '/pet/findByStatus', 'GET', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } @@ -211,8 +189,8 @@ * @param {module:api/PetApi~findPetsByTagsCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link Array.} */ - this.findPetsByTags = function(tags, callback) { - var postBody = null; + findPetsByTags(tags, callback) { + let postBody = null; // verify the required parameter 'tags' is set if (tags === undefined || tags === null) { @@ -220,29 +198,24 @@ } - var pathParams = { + let pathParams = { }; - var queryParams = { + let queryParams = { + 'tags': this.apiClient.buildCollectionParam(tags, 'csv') }; - var collectionQueryParams = { - 'tags': { - value: tags, - collectionFormat: 'csv' - }, + let headerParams = { }; - var headerParams = { - }; - var formParams = { + let formParams = { }; - var authNames = ['petstore_auth']; - var contentTypes = []; - var accepts = ['application/xml', 'application/json']; - var returnType = [Pet]; + let authNames = ['petstore_auth']; + let contentTypes = []; + let accepts = ['application/xml', 'application/json']; + let returnType = [Pet]; return this.apiClient.callApi( '/pet/findByTags', 'GET', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } @@ -262,8 +235,8 @@ * @param {module:api/PetApi~getPetByIdCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/Pet} */ - this.getPetById = function(petId, callback) { - var postBody = null; + getPetById(petId, callback) { + let postBody = null; // verify the required parameter 'petId' is set if (petId === undefined || petId === null) { @@ -271,26 +244,24 @@ } - var pathParams = { + let pathParams = { 'petId': petId }; - var queryParams = { + let queryParams = { }; - var collectionQueryParams = { + let headerParams = { }; - var headerParams = { - }; - var formParams = { + let formParams = { }; - var authNames = ['api_key']; - var contentTypes = []; - var accepts = ['application/xml', 'application/json']; - var returnType = Pet; + let authNames = ['api_key']; + let contentTypes = []; + let accepts = ['application/xml', 'application/json']; + let returnType = Pet; return this.apiClient.callApi( '/pet/{petId}', 'GET', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } @@ -309,8 +280,8 @@ * @param {module:model/Pet} body Pet object that needs to be added to the store * @param {module:api/PetApi~updatePetCallback} callback The callback function, accepting three arguments: error, data, response */ - this.updatePet = function(body, callback) { - var postBody = body; + updatePet(body, callback) { + let postBody = body; // verify the required parameter 'body' is set if (body === undefined || body === null) { @@ -318,25 +289,23 @@ } - var pathParams = { + let pathParams = { }; - var queryParams = { + let queryParams = { }; - var collectionQueryParams = { + let headerParams = { }; - var headerParams = { - }; - var formParams = { + let formParams = { }; - var authNames = ['petstore_auth']; - var contentTypes = ['application/json', 'application/xml']; - var accepts = ['application/xml', 'application/json']; - var returnType = null; + let authNames = ['petstore_auth']; + let contentTypes = ['application/json', 'application/xml']; + let accepts = ['application/xml', 'application/json']; + let returnType = null; return this.apiClient.callApi( '/pet', 'PUT', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } @@ -358,9 +327,9 @@ * @param {String} opts.status Updated status of the pet * @param {module:api/PetApi~updatePetWithFormCallback} callback The callback function, accepting three arguments: error, data, response */ - this.updatePetWithForm = function(petId, opts, callback) { + updatePetWithForm(petId, opts, callback) { opts = opts || {}; - var postBody = null; + let postBody = null; // verify the required parameter 'petId' is set if (petId === undefined || petId === null) { @@ -368,28 +337,26 @@ } - var pathParams = { + let pathParams = { 'petId': petId }; - var queryParams = { + let queryParams = { }; - var collectionQueryParams = { + let headerParams = { }; - var headerParams = { - }; - var formParams = { + let formParams = { 'name': opts['name'], 'status': opts['status'] }; - var authNames = ['petstore_auth']; - var contentTypes = ['application/x-www-form-urlencoded']; - var accepts = ['application/xml', 'application/json']; - var returnType = null; + let authNames = ['petstore_auth']; + let contentTypes = ['application/x-www-form-urlencoded']; + let accepts = ['application/xml', 'application/json']; + let returnType = null; return this.apiClient.callApi( '/pet/{petId}', 'POST', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } @@ -412,9 +379,9 @@ * @param {module:api/PetApi~uploadFileCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/ApiResponse} */ - this.uploadFile = function(petId, opts, callback) { + uploadFile(petId, opts, callback) { opts = opts || {}; - var postBody = null; + let postBody = null; // verify the required parameter 'petId' is set if (petId === undefined || petId === null) { @@ -422,32 +389,29 @@ } - var pathParams = { + let pathParams = { 'petId': petId }; - var queryParams = { + let queryParams = { }; - var collectionQueryParams = { + let headerParams = { }; - var headerParams = { - }; - var formParams = { + let formParams = { 'additionalMetadata': opts['additionalMetadata'], 'file': opts['file'] }; - var authNames = ['petstore_auth']; - var contentTypes = ['multipart/form-data']; - var accepts = ['application/json']; - var returnType = ApiResponse; + let authNames = ['petstore_auth']; + let contentTypes = ['multipart/form-data']; + let accepts = ['application/json']; + let returnType = ApiResponse; return this.apiClient.callApi( '/pet/{petId}/uploadImage', 'POST', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } - }; - return exports; -})); + +} diff --git a/samples/client/petstore/javascript-es6/src/api/StoreApi.js b/samples/client/petstore/javascript-es6/src/api/StoreApi.js index 8be29a01f55..b70fc4c0883 100644 --- a/samples/client/petstore/javascript-es6/src/api/StoreApi.js +++ b/samples/client/petstore/javascript-es6/src/api/StoreApi.js @@ -7,45 +7,31 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(function(root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['ApiClient', 'model/Order'], factory); - } else if (typeof module === 'object' && module.exports) { - // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('../ApiClient'), require('../model/Order')); - } else { - // Browser globals (root is window) - if (!root.SwaggerPetstore) { - root.SwaggerPetstore = {}; + +import ApiClient from "../ApiClient"; +import Order from '../model/Order'; + +/** +* Store service. +* @module api/StoreApi +* @version 1.0.0 +*/ +export default class StoreApi { + + /** + * Constructs a new StoreApi. + * @alias module:api/StoreApi + * @class + * @param {module:ApiClient} apiClient Optional API client implementation to use, + * default to {@link module:ApiClient#instance} if unspecified. + */ + constructor(apiClient) { + this.apiClient = apiClient || ApiClient.instance; } - root.SwaggerPetstore.StoreApi = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.Order); - } -}(this, function(ApiClient, Order) { - 'use strict'; - - /** - * Store service. - * @module api/StoreApi - * @version 1.0.0 - */ - - /** - * Constructs a new StoreApi. - * @alias module:api/StoreApi - * @class - * @param {module:ApiClient} apiClient Optional API client implementation to use, - * default to {@link module:ApiClient#instance} if unspecified. - */ - var exports = function(apiClient) { - this.apiClient = apiClient || ApiClient.instance; /** @@ -62,8 +48,8 @@ * @param {String} orderId ID of the order that needs to be deleted * @param {module:api/StoreApi~deleteOrderCallback} callback The callback function, accepting three arguments: error, data, response */ - this.deleteOrder = function(orderId, callback) { - var postBody = null; + deleteOrder(orderId, callback) { + let postBody = null; // verify the required parameter 'orderId' is set if (orderId === undefined || orderId === null) { @@ -71,26 +57,24 @@ } - var pathParams = { + let pathParams = { 'order_id': orderId }; - var queryParams = { + let queryParams = { }; - var collectionQueryParams = { + let headerParams = { }; - var headerParams = { - }; - var formParams = { + let formParams = { }; - var authNames = []; - var contentTypes = []; - var accepts = ['application/xml', 'application/json']; - var returnType = null; + let authNames = []; + let contentTypes = []; + let accepts = ['application/xml', 'application/json']; + let returnType = null; return this.apiClient.callApi( '/store/order/{order_id}', 'DELETE', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } @@ -109,29 +93,27 @@ * @param {module:api/StoreApi~getInventoryCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link Object.} */ - this.getInventory = function(callback) { - var postBody = null; + getInventory(callback) { + let postBody = null; - var pathParams = { + let pathParams = { }; - var queryParams = { + let queryParams = { }; - var collectionQueryParams = { + let headerParams = { }; - var headerParams = { - }; - var formParams = { + let formParams = { }; - var authNames = ['api_key']; - var contentTypes = []; - var accepts = ['application/json']; - var returnType = {'String': 'Number'}; + let authNames = ['api_key']; + let contentTypes = []; + let accepts = ['application/json']; + let returnType = {'String': 'Number'}; return this.apiClient.callApi( '/store/inventory', 'GET', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } @@ -151,8 +133,8 @@ * @param {module:api/StoreApi~getOrderByIdCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/Order} */ - this.getOrderById = function(orderId, callback) { - var postBody = null; + getOrderById(orderId, callback) { + let postBody = null; // verify the required parameter 'orderId' is set if (orderId === undefined || orderId === null) { @@ -160,26 +142,24 @@ } - var pathParams = { + let pathParams = { 'order_id': orderId }; - var queryParams = { + let queryParams = { }; - var collectionQueryParams = { + let headerParams = { }; - var headerParams = { - }; - var formParams = { + let formParams = { }; - var authNames = []; - var contentTypes = []; - var accepts = ['application/xml', 'application/json']; - var returnType = Order; + let authNames = []; + let contentTypes = []; + let accepts = ['application/xml', 'application/json']; + let returnType = Order; return this.apiClient.callApi( '/store/order/{order_id}', 'GET', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } @@ -199,8 +179,8 @@ * @param {module:api/StoreApi~placeOrderCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/Order} */ - this.placeOrder = function(body, callback) { - var postBody = body; + placeOrder(body, callback) { + let postBody = body; // verify the required parameter 'body' is set if (body === undefined || body === null) { @@ -208,29 +188,26 @@ } - var pathParams = { + let pathParams = { }; - var queryParams = { + let queryParams = { }; - var collectionQueryParams = { + let headerParams = { }; - var headerParams = { - }; - var formParams = { + let formParams = { }; - var authNames = []; - var contentTypes = []; - var accepts = ['application/xml', 'application/json']; - var returnType = Order; + let authNames = []; + let contentTypes = []; + let accepts = ['application/xml', 'application/json']; + let returnType = Order; return this.apiClient.callApi( '/store/order', 'POST', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } - }; - return exports; -})); + +} diff --git a/samples/client/petstore/javascript-es6/src/api/UserApi.js b/samples/client/petstore/javascript-es6/src/api/UserApi.js index 829b5ea4bc9..54c9b110d7b 100644 --- a/samples/client/petstore/javascript-es6/src/api/UserApi.js +++ b/samples/client/petstore/javascript-es6/src/api/UserApi.js @@ -7,45 +7,31 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(function(root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['ApiClient', 'model/User'], factory); - } else if (typeof module === 'object' && module.exports) { - // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('../ApiClient'), require('../model/User')); - } else { - // Browser globals (root is window) - if (!root.SwaggerPetstore) { - root.SwaggerPetstore = {}; + +import ApiClient from "../ApiClient"; +import User from '../model/User'; + +/** +* User service. +* @module api/UserApi +* @version 1.0.0 +*/ +export default class UserApi { + + /** + * Constructs a new UserApi. + * @alias module:api/UserApi + * @class + * @param {module:ApiClient} apiClient Optional API client implementation to use, + * default to {@link module:ApiClient#instance} if unspecified. + */ + constructor(apiClient) { + this.apiClient = apiClient || ApiClient.instance; } - root.SwaggerPetstore.UserApi = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.User); - } -}(this, function(ApiClient, User) { - 'use strict'; - - /** - * User service. - * @module api/UserApi - * @version 1.0.0 - */ - - /** - * Constructs a new UserApi. - * @alias module:api/UserApi - * @class - * @param {module:ApiClient} apiClient Optional API client implementation to use, - * default to {@link module:ApiClient#instance} if unspecified. - */ - var exports = function(apiClient) { - this.apiClient = apiClient || ApiClient.instance; /** @@ -62,8 +48,8 @@ * @param {module:model/User} body Created user object * @param {module:api/UserApi~createUserCallback} callback The callback function, accepting three arguments: error, data, response */ - this.createUser = function(body, callback) { - var postBody = body; + createUser(body, callback) { + let postBody = body; // verify the required parameter 'body' is set if (body === undefined || body === null) { @@ -71,25 +57,23 @@ } - var pathParams = { + let pathParams = { }; - var queryParams = { + let queryParams = { }; - var collectionQueryParams = { + let headerParams = { }; - var headerParams = { - }; - var formParams = { + let formParams = { }; - var authNames = []; - var contentTypes = []; - var accepts = ['application/xml', 'application/json']; - var returnType = null; + let authNames = []; + let contentTypes = []; + let accepts = ['application/xml', 'application/json']; + let returnType = null; return this.apiClient.callApi( '/user', 'POST', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } @@ -108,8 +92,8 @@ * @param {Array.} body List of user object * @param {module:api/UserApi~createUsersWithArrayInputCallback} callback The callback function, accepting three arguments: error, data, response */ - this.createUsersWithArrayInput = function(body, callback) { - var postBody = body; + createUsersWithArrayInput(body, callback) { + let postBody = body; // verify the required parameter 'body' is set if (body === undefined || body === null) { @@ -117,25 +101,23 @@ } - var pathParams = { + let pathParams = { }; - var queryParams = { + let queryParams = { }; - var collectionQueryParams = { + let headerParams = { }; - var headerParams = { - }; - var formParams = { + let formParams = { }; - var authNames = []; - var contentTypes = []; - var accepts = ['application/xml', 'application/json']; - var returnType = null; + let authNames = []; + let contentTypes = []; + let accepts = ['application/xml', 'application/json']; + let returnType = null; return this.apiClient.callApi( '/user/createWithArray', 'POST', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } @@ -154,8 +136,8 @@ * @param {Array.} body List of user object * @param {module:api/UserApi~createUsersWithListInputCallback} callback The callback function, accepting three arguments: error, data, response */ - this.createUsersWithListInput = function(body, callback) { - var postBody = body; + createUsersWithListInput(body, callback) { + let postBody = body; // verify the required parameter 'body' is set if (body === undefined || body === null) { @@ -163,25 +145,23 @@ } - var pathParams = { + let pathParams = { }; - var queryParams = { + let queryParams = { }; - var collectionQueryParams = { + let headerParams = { }; - var headerParams = { - }; - var formParams = { + let formParams = { }; - var authNames = []; - var contentTypes = []; - var accepts = ['application/xml', 'application/json']; - var returnType = null; + let authNames = []; + let contentTypes = []; + let accepts = ['application/xml', 'application/json']; + let returnType = null; return this.apiClient.callApi( '/user/createWithList', 'POST', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } @@ -200,8 +180,8 @@ * @param {String} username The name that needs to be deleted * @param {module:api/UserApi~deleteUserCallback} callback The callback function, accepting three arguments: error, data, response */ - this.deleteUser = function(username, callback) { - var postBody = null; + deleteUser(username, callback) { + let postBody = null; // verify the required parameter 'username' is set if (username === undefined || username === null) { @@ -209,26 +189,24 @@ } - var pathParams = { + let pathParams = { 'username': username }; - var queryParams = { + let queryParams = { }; - var collectionQueryParams = { + let headerParams = { }; - var headerParams = { - }; - var formParams = { + let formParams = { }; - var authNames = []; - var contentTypes = []; - var accepts = ['application/xml', 'application/json']; - var returnType = null; + let authNames = []; + let contentTypes = []; + let accepts = ['application/xml', 'application/json']; + let returnType = null; return this.apiClient.callApi( '/user/{username}', 'DELETE', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } @@ -248,8 +226,8 @@ * @param {module:api/UserApi~getUserByNameCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/User} */ - this.getUserByName = function(username, callback) { - var postBody = null; + getUserByName(username, callback) { + let postBody = null; // verify the required parameter 'username' is set if (username === undefined || username === null) { @@ -257,26 +235,24 @@ } - var pathParams = { + let pathParams = { 'username': username }; - var queryParams = { + let queryParams = { }; - var collectionQueryParams = { + let headerParams = { }; - var headerParams = { - }; - var formParams = { + let formParams = { }; - var authNames = []; - var contentTypes = []; - var accepts = ['application/xml', 'application/json']; - var returnType = User; + let authNames = []; + let contentTypes = []; + let accepts = ['application/xml', 'application/json']; + let returnType = User; return this.apiClient.callApi( '/user/{username}', 'GET', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } @@ -297,8 +273,8 @@ * @param {module:api/UserApi~loginUserCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link 'String'} */ - this.loginUser = function(username, password, callback) { - var postBody = null; + loginUser(username, password, callback) { + let postBody = null; // verify the required parameter 'username' is set if (username === undefined || username === null) { @@ -311,27 +287,25 @@ } - var pathParams = { + let pathParams = { }; - var queryParams = { + let queryParams = { 'username': username, - 'password': password, + 'password': password }; - var collectionQueryParams = { + let headerParams = { }; - var headerParams = { - }; - var formParams = { + let formParams = { }; - var authNames = []; - var contentTypes = []; - var accepts = ['application/xml', 'application/json']; - var returnType = 'String'; + let authNames = []; + let contentTypes = []; + let accepts = ['application/xml', 'application/json']; + let returnType = 'String'; return this.apiClient.callApi( '/user/login', 'GET', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } @@ -349,29 +323,27 @@ * * @param {module:api/UserApi~logoutUserCallback} callback The callback function, accepting three arguments: error, data, response */ - this.logoutUser = function(callback) { - var postBody = null; + logoutUser(callback) { + let postBody = null; - var pathParams = { + let pathParams = { }; - var queryParams = { + let queryParams = { }; - var collectionQueryParams = { + let headerParams = { }; - var headerParams = { - }; - var formParams = { + let formParams = { }; - var authNames = []; - var contentTypes = []; - var accepts = ['application/xml', 'application/json']; - var returnType = null; + let authNames = []; + let contentTypes = []; + let accepts = ['application/xml', 'application/json']; + let returnType = null; return this.apiClient.callApi( '/user/logout', 'GET', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } @@ -391,8 +363,8 @@ * @param {module:model/User} body Updated user object * @param {module:api/UserApi~updateUserCallback} callback The callback function, accepting three arguments: error, data, response */ - this.updateUser = function(username, body, callback) { - var postBody = body; + updateUser(username, body, callback) { + let postBody = body; // verify the required parameter 'username' is set if (username === undefined || username === null) { @@ -405,30 +377,27 @@ } - var pathParams = { + let pathParams = { 'username': username }; - var queryParams = { + let queryParams = { }; - var collectionQueryParams = { + let headerParams = { }; - var headerParams = { - }; - var formParams = { + let formParams = { }; - var authNames = []; - var contentTypes = []; - var accepts = ['application/xml', 'application/json']; - var returnType = null; + let authNames = []; + let contentTypes = []; + let accepts = ['application/xml', 'application/json']; + let returnType = null; return this.apiClient.callApi( '/user/{username}', 'PUT', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } - }; - return exports; -})); + +} diff --git a/samples/client/petstore/javascript-es6/src/index.js b/samples/client/petstore/javascript-es6/src/index.js index afc840ce758..9a8ff8e2e42 100644 --- a/samples/client/petstore/javascript-es6/src/index.js +++ b/samples/client/petstore/javascript-es6/src/index.js @@ -7,267 +7,336 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(function(factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['ApiClient', 'model/AdditionalPropertiesClass', 'model/Animal', 'model/AnimalFarm', 'model/ApiResponse', 'model/ArrayOfArrayOfNumberOnly', 'model/ArrayOfNumberOnly', 'model/ArrayTest', 'model/Capitalization', 'model/Category', 'model/ClassModel', 'model/Client', 'model/EnumArrays', 'model/EnumClass', 'model/EnumTest', 'model/FormatTest', 'model/HasOnlyReadOnly', 'model/List', 'model/MapTest', 'model/MixedPropertiesAndAdditionalPropertiesClass', 'model/Model200Response', 'model/ModelReturn', 'model/Name', 'model/NumberOnly', 'model/Order', 'model/OuterBoolean', 'model/OuterComposite', 'model/OuterEnum', 'model/OuterNumber', 'model/OuterString', 'model/Pet', 'model/ReadOnlyFirst', 'model/SpecialModelName', 'model/Tag', 'model/User', 'model/Cat', 'model/Dog', 'api/FakeApi', 'api/Fake_classname_tags123Api', '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/AdditionalPropertiesClass'), require('./model/Animal'), require('./model/AnimalFarm'), require('./model/ApiResponse'), require('./model/ArrayOfArrayOfNumberOnly'), require('./model/ArrayOfNumberOnly'), require('./model/ArrayTest'), require('./model/Capitalization'), require('./model/Category'), require('./model/ClassModel'), require('./model/Client'), require('./model/EnumArrays'), require('./model/EnumClass'), require('./model/EnumTest'), require('./model/FormatTest'), require('./model/HasOnlyReadOnly'), require('./model/List'), require('./model/MapTest'), require('./model/MixedPropertiesAndAdditionalPropertiesClass'), require('./model/Model200Response'), require('./model/ModelReturn'), require('./model/Name'), require('./model/NumberOnly'), require('./model/Order'), require('./model/OuterBoolean'), require('./model/OuterComposite'), require('./model/OuterEnum'), require('./model/OuterNumber'), require('./model/OuterString'), require('./model/Pet'), require('./model/ReadOnlyFirst'), require('./model/SpecialModelName'), require('./model/Tag'), require('./model/User'), require('./model/Cat'), require('./model/Dog'), require('./api/FakeApi'), require('./api/Fake_classname_tags123Api'), require('./api/PetApi'), require('./api/StoreApi'), require('./api/UserApi')); - } -}(function(ApiClient, AdditionalPropertiesClass, Animal, AnimalFarm, ApiResponse, ArrayOfArrayOfNumberOnly, ArrayOfNumberOnly, ArrayTest, Capitalization, Category, ClassModel, Client, EnumArrays, EnumClass, EnumTest, FormatTest, HasOnlyReadOnly, List, MapTest, MixedPropertiesAndAdditionalPropertiesClass, Model200Response, ModelReturn, Name, NumberOnly, Order, OuterBoolean, OuterComposite, OuterEnum, OuterNumber, OuterString, Pet, ReadOnlyFirst, SpecialModelName, Tag, User, Cat, Dog, FakeApi, Fake_classname_tags123Api, 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__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: - *

-   * var SwaggerPetstore = require('index'); // See note below*.
-   * var xxxSvc = new SwaggerPetstore.XxxApi(); // Allocate the API class we're going to use.
-   * var yyyModel = new SwaggerPetstore.Yyy(); // Construct a model instance.
-   * yyyModel.someProperty = 'someValue';
-   * ...
-   * var zzz = xxxSvc.doSomething(yyyModel); // Invoke the service.
-   * ...
-   * 
- * *NOTE: For a top-level AMD script, use require(['index'], function(){...}) - * and put the application logic within the callback function. - *

- *

- * A non-AMD browser application (discouraged) might do something like this: - *

-   * var xxxSvc = new SwaggerPetstore.XxxApi(); // Allocate the API class we're going to use.
-   * var yyy = new SwaggerPetstore.Yyy(); // Construct a model instance.
-   * yyyModel.someProperty = 'someValue';
-   * ...
-   * var zzz = xxxSvc.doSomething(yyyModel); // Invoke the service.
-   * ...
-   * 
- *

- * @module index - * @version 1.0.0 - */ - var exports = { +import ApiClient from './ApiClient'; +import AdditionalPropertiesClass from './model/AdditionalPropertiesClass'; +import Animal from './model/Animal'; +import AnimalFarm from './model/AnimalFarm'; +import ApiResponse from './model/ApiResponse'; +import ArrayOfArrayOfNumberOnly from './model/ArrayOfArrayOfNumberOnly'; +import ArrayOfNumberOnly from './model/ArrayOfNumberOnly'; +import ArrayTest from './model/ArrayTest'; +import Capitalization from './model/Capitalization'; +import Category from './model/Category'; +import ClassModel from './model/ClassModel'; +import Client from './model/Client'; +import EnumArrays from './model/EnumArrays'; +import EnumClass from './model/EnumClass'; +import EnumTest from './model/EnumTest'; +import FormatTest from './model/FormatTest'; +import HasOnlyReadOnly from './model/HasOnlyReadOnly'; +import List from './model/List'; +import MapTest from './model/MapTest'; +import MixedPropertiesAndAdditionalPropertiesClass from './model/MixedPropertiesAndAdditionalPropertiesClass'; +import Model200Response from './model/Model200Response'; +import ModelReturn from './model/ModelReturn'; +import Name from './model/Name'; +import NumberOnly from './model/NumberOnly'; +import Order from './model/Order'; +import OuterBoolean from './model/OuterBoolean'; +import OuterComposite from './model/OuterComposite'; +import OuterEnum from './model/OuterEnum'; +import OuterNumber from './model/OuterNumber'; +import OuterString from './model/OuterString'; +import Pet from './model/Pet'; +import ReadOnlyFirst from './model/ReadOnlyFirst'; +import SpecialModelName from './model/SpecialModelName'; +import Tag from './model/Tag'; +import User from './model/User'; +import Cat from './model/Cat'; +import Dog from './model/Dog'; +import FakeApi from './api/FakeApi'; +import Fake_classname_tags123Api from './api/Fake_classname_tags123Api'; +import PetApi from './api/PetApi'; +import StoreApi from './api/StoreApi'; +import UserApi from './api/UserApi'; + + +/** +* This_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: +*

+* var SwaggerPetstore = require('index'); // See note below*.
+* var xxxSvc = new SwaggerPetstore.XxxApi(); // Allocate the API class we're going to use.
+* var yyyModel = new SwaggerPetstore.Yyy(); // Construct a model instance.
+* yyyModel.someProperty = 'someValue';
+* ...
+* var zzz = xxxSvc.doSomething(yyyModel); // Invoke the service.
+* ...
+* 
+* *NOTE: For a top-level AMD script, use require(['index'], function(){...}) +* and put the application logic within the callback function. +*

+*

+* A non-AMD browser application (discouraged) might do something like this: +*

+* var xxxSvc = new SwaggerPetstore.XxxApi(); // Allocate the API class we're going to use.
+* var yyy = new SwaggerPetstore.Yyy(); // Construct a model instance.
+* yyyModel.someProperty = 'someValue';
+* ...
+* var zzz = xxxSvc.doSomething(yyyModel); // Invoke the service.
+* ...
+* 
+*

+* @module index +* @version 1.0.0 +*/ +export { /** * The ApiClient constructor. * @property {module:ApiClient} */ - ApiClient: ApiClient, + ApiClient, + /** * The AdditionalPropertiesClass model constructor. * @property {module:model/AdditionalPropertiesClass} */ - AdditionalPropertiesClass: AdditionalPropertiesClass, + AdditionalPropertiesClass, + /** * The Animal model constructor. * @property {module:model/Animal} */ - Animal: Animal, + Animal, + /** * The AnimalFarm model constructor. * @property {module:model/AnimalFarm} */ - AnimalFarm: AnimalFarm, + AnimalFarm, + /** * The ApiResponse model constructor. * @property {module:model/ApiResponse} */ - ApiResponse: ApiResponse, + ApiResponse, + /** * The ArrayOfArrayOfNumberOnly model constructor. * @property {module:model/ArrayOfArrayOfNumberOnly} */ - ArrayOfArrayOfNumberOnly: ArrayOfArrayOfNumberOnly, + ArrayOfArrayOfNumberOnly, + /** * The ArrayOfNumberOnly model constructor. * @property {module:model/ArrayOfNumberOnly} */ - ArrayOfNumberOnly: ArrayOfNumberOnly, + ArrayOfNumberOnly, + /** * The ArrayTest model constructor. * @property {module:model/ArrayTest} */ - ArrayTest: ArrayTest, + ArrayTest, + /** * The Capitalization model constructor. * @property {module:model/Capitalization} */ - Capitalization: Capitalization, + Capitalization, + /** * The Category model constructor. * @property {module:model/Category} */ - Category: Category, + Category, + /** * The ClassModel model constructor. * @property {module:model/ClassModel} */ - ClassModel: ClassModel, + ClassModel, + /** * The Client model constructor. * @property {module:model/Client} */ - Client: Client, + Client, + /** * The EnumArrays model constructor. * @property {module:model/EnumArrays} */ - EnumArrays: EnumArrays, + EnumArrays, + /** * The EnumClass model constructor. * @property {module:model/EnumClass} */ - EnumClass: EnumClass, + EnumClass, + /** * The EnumTest model constructor. * @property {module:model/EnumTest} */ - EnumTest: EnumTest, + EnumTest, + /** * The FormatTest model constructor. * @property {module:model/FormatTest} */ - FormatTest: FormatTest, + FormatTest, + /** * The HasOnlyReadOnly model constructor. * @property {module:model/HasOnlyReadOnly} */ - HasOnlyReadOnly: HasOnlyReadOnly, + HasOnlyReadOnly, + /** * The List model constructor. * @property {module:model/List} */ - List: List, + List, + /** * The MapTest model constructor. * @property {module:model/MapTest} */ - MapTest: MapTest, + MapTest, + /** * The MixedPropertiesAndAdditionalPropertiesClass model constructor. * @property {module:model/MixedPropertiesAndAdditionalPropertiesClass} */ - MixedPropertiesAndAdditionalPropertiesClass: MixedPropertiesAndAdditionalPropertiesClass, + MixedPropertiesAndAdditionalPropertiesClass, + /** * The Model200Response model constructor. * @property {module:model/Model200Response} */ - Model200Response: Model200Response, + Model200Response, + /** * The ModelReturn model constructor. * @property {module:model/ModelReturn} */ - ModelReturn: ModelReturn, + ModelReturn, + /** * The Name model constructor. * @property {module:model/Name} */ - Name: Name, + Name, + /** * The NumberOnly model constructor. * @property {module:model/NumberOnly} */ - NumberOnly: NumberOnly, + NumberOnly, + /** * The Order model constructor. * @property {module:model/Order} */ - Order: Order, + Order, + /** * The OuterBoolean model constructor. * @property {module:model/OuterBoolean} */ - OuterBoolean: OuterBoolean, + OuterBoolean, + /** * The OuterComposite model constructor. * @property {module:model/OuterComposite} */ - OuterComposite: OuterComposite, + OuterComposite, + /** * The OuterEnum model constructor. * @property {module:model/OuterEnum} */ - OuterEnum: OuterEnum, + OuterEnum, + /** * The OuterNumber model constructor. * @property {module:model/OuterNumber} */ - OuterNumber: OuterNumber, + OuterNumber, + /** * The OuterString model constructor. * @property {module:model/OuterString} */ - OuterString: OuterString, + OuterString, + /** * The Pet model constructor. * @property {module:model/Pet} */ - Pet: Pet, + Pet, + /** * The ReadOnlyFirst model constructor. * @property {module:model/ReadOnlyFirst} */ - ReadOnlyFirst: ReadOnlyFirst, + ReadOnlyFirst, + /** * The SpecialModelName model constructor. * @property {module:model/SpecialModelName} */ - SpecialModelName: SpecialModelName, + SpecialModelName, + /** * The Tag model constructor. * @property {module:model/Tag} */ - Tag: Tag, + Tag, + /** * The User model constructor. * @property {module:model/User} */ - User: User, + User, + /** * The Cat model constructor. * @property {module:model/Cat} */ - Cat: Cat, + Cat, + /** * The Dog model constructor. * @property {module:model/Dog} */ - Dog: Dog, - /** - * The FakeApi service constructor. - * @property {module:api/FakeApi} - */ - FakeApi: FakeApi, - /** - * The Fake_classname_tags123Api service constructor. - * @property {module:api/Fake_classname_tags123Api} - */ - Fake_classname_tags123Api: Fake_classname_tags123Api, - /** - * The PetApi service constructor. - * @property {module:api/PetApi} - */ - PetApi: PetApi, - /** - * The StoreApi service constructor. - * @property {module:api/StoreApi} - */ - StoreApi: StoreApi, - /** - * The UserApi service constructor. - * @property {module:api/UserApi} - */ - UserApi: UserApi - }; + Dog, - return exports; -})); + /** + * The FakeApi service constructor. + * @property {module:api/FakeApi} + */ + FakeApi, + + /** + * The Fake_classname_tags123Api service constructor. + * @property {module:api/Fake_classname_tags123Api} + */ + Fake_classname_tags123Api, + + /** + * The PetApi service constructor. + * @property {module:api/PetApi} + */ + PetApi, + + /** + * The StoreApi service constructor. + * @property {module:api/StoreApi} + */ + StoreApi, + + /** + * The UserApi service constructor. + * @property {module:api/UserApi} + */ + UserApi +}; diff --git a/samples/client/petstore/javascript-es6/src/model/AdditionalPropertiesClass.js b/samples/client/petstore/javascript-es6/src/model/AdditionalPropertiesClass.js index 4399d89bdc3..088cbb29b35 100644 --- a/samples/client/petstore/javascript-es6/src/model/AdditionalPropertiesClass.js +++ b/samples/client/petstore/javascript-es6/src/model/AdditionalPropertiesClass.js @@ -7,84 +7,81 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + + + + +/** +* The AdditionalPropertiesClass model module. +* @module model/AdditionalPropertiesClass +* @version 1.0.0 +*/ +export default class AdditionalPropertiesClass { + /** + * Constructs a new AdditionalPropertiesClass. + * @alias module:model/AdditionalPropertiesClass + * @class + */ + + constructor() { + + + + + + + + } - root.SwaggerPetstore.AdditionalPropertiesClass = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; + /** + * 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. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new AdditionalPropertiesClass(); + + + - - /** - * The AdditionalPropertiesClass model module. - * @module model/AdditionalPropertiesClass - * @version 1.0.0 - */ - - /** - * Constructs a new AdditionalPropertiesClass. - * @alias module:model/AdditionalPropertiesClass - * @class - */ - var exports = function() { - var _this = 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(); - - if (data.hasOwnProperty('map_property')) { - obj['map_property'] = ApiClient.convertToType(data['map_property'], {'String': 'String'}); - } - if (data.hasOwnProperty('map_of_map_property')) { - obj['map_of_map_property'] = ApiClient.convertToType(data['map_of_map_property'], {'String': {'String': 'String'}}); - } + if (data.hasOwnProperty('map_property')) { + obj['map_property'] = ApiClient.convertToType(data['map_property'], {'String': 'String'}); + } + if (data.hasOwnProperty('map_of_map_property')) { + obj['map_of_map_property'] = ApiClient.convertToType(data['map_of_map_property'], {'String': {'String': 'String'}}); + } + } + return obj; } - return obj; - } - /** - * @member {Object.} map_property - */ - exports.prototype['map_property'] = undefined; - /** - * @member {Object.>} map_of_map_property - */ - exports.prototype['map_of_map_property'] = undefined; + /** + * @member {Object.} map_property + */ + map_property = undefined; + /** + * @member {Object.>} map_of_map_property + */ + map_of_map_property = undefined; - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-es6/src/model/Animal.js b/samples/client/petstore/javascript-es6/src/model/Animal.js index eee2768eeb6..b3fb1a63f32 100644 --- a/samples/client/petstore/javascript-es6/src/model/Animal.js +++ b/samples/client/petstore/javascript-es6/src/model/Animal.js @@ -7,86 +7,83 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + + + + +/** +* The Animal model module. +* @module model/Animal +* @version 1.0.0 +*/ +export default class Animal { + /** + * Constructs a new Animal. + * @alias module:model/Animal + * @class + * @param className {String} + */ + + constructor(className) { + + + + + + this['className'] = className; + + } - root.SwaggerPetstore.Animal = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; + /** + * Constructs a Animal 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/Animal} obj Optional instance to populate. + * @return {module:model/Animal} The populated Animal instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new Animal(); + + + - - /** - * The Animal model module. - * @module model/Animal - * @version 1.0.0 - */ - - /** - * Constructs a new Animal. - * @alias module:model/Animal - * @class - * @param className {String} - */ - var exports = function(className) { - var _this = this; - - _this['className'] = className; - - }; - - /** - * Constructs a Animal 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/Animal} obj Optional instance to populate. - * @return {module:model/Animal} The populated Animal instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - - if (data.hasOwnProperty('className')) { - obj['className'] = ApiClient.convertToType(data['className'], 'String'); - } - if (data.hasOwnProperty('color')) { - obj['color'] = ApiClient.convertToType(data['color'], 'String'); - } + if (data.hasOwnProperty('className')) { + obj['className'] = ApiClient.convertToType(data['className'], 'String'); + } + if (data.hasOwnProperty('color')) { + obj['color'] = ApiClient.convertToType(data['color'], 'String'); + } + } + return obj; } - return obj; - } - /** - * @member {String} className - */ - exports.prototype['className'] = undefined; - /** - * @member {String} color - * @default 'red' - */ - exports.prototype['color'] = 'red'; + /** + * @member {String} className + */ + className = undefined; + /** + * @member {String} color + * @default 'red' + */ + color = 'red'; - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-es6/src/model/AnimalFarm.js b/samples/client/petstore/javascript-es6/src/model/AnimalFarm.js index b24078dee2a..8dc9f00cadb 100644 --- a/samples/client/petstore/javascript-es6/src/model/AnimalFarm.js +++ b/samples/client/petstore/javascript-es6/src/model/AnimalFarm.js @@ -7,73 +7,72 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; +import Animal from './Animal'; + + + + + +/** +* The AnimalFarm model module. +* @module model/AnimalFarm +* @version 1.0.0 +*/ +export default class AnimalFarm { + /** + * Constructs a new AnimalFarm. + * @alias module:model/AnimalFarm + * @class + * @extends Array + */ + + constructor() { + + this = new Array(); + Object.setPrototypeOf(this, AnimalFarm); + + + + + + + return this; } - root.SwaggerPetstore.AnimalFarm = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.Animal); - } -}(this, function(ApiClient, Animal) { - 'use strict'; + /** + * Constructs a AnimalFarm 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/AnimalFarm} obj Optional instance to populate. + * @return {module:model/AnimalFarm} The populated AnimalFarm instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new AnimalFarm(); + ApiClient.constructFromObject(data, obj, 'Animal'); + + - /** - * The AnimalFarm model module. - * @module model/AnimalFarm - * @version 1.0.0 - */ - - /** - * Constructs a new AnimalFarm. - * @alias module:model/AnimalFarm - * @class - * @extends Array - */ - var exports = function() { - var _this = this; - _this = new Array(); - Object.setPrototypeOf(_this, exports); - - return _this; - }; - - /** - * Constructs a AnimalFarm 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/AnimalFarm} obj Optional instance to populate. - * @return {module:model/AnimalFarm} The populated AnimalFarm instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - ApiClient.constructFromObject(data, obj, 'Animal'); - + } + return obj; } - return obj; - } - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-es6/src/model/ApiResponse.js b/samples/client/petstore/javascript-es6/src/model/ApiResponse.js index 9588ce4cf31..49ddd1ac27f 100644 --- a/samples/client/petstore/javascript-es6/src/model/ApiResponse.js +++ b/samples/client/petstore/javascript-es6/src/model/ApiResponse.js @@ -7,92 +7,88 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + + + + +/** +* The ApiResponse model module. +* @module model/ApiResponse +* @version 1.0.0 +*/ +export default class ApiResponse { + /** + * Constructs a new ApiResponse. + * @alias module:model/ApiResponse + * @class + */ + + constructor() { + + + + + + + + } - root.SwaggerPetstore.ApiResponse = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; + /** + * Constructs a ApiResponse 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/ApiResponse} obj Optional instance to populate. + * @return {module:model/ApiResponse} The populated ApiResponse instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new ApiResponse(); + + + - - /** - * The ApiResponse model module. - * @module model/ApiResponse - * @version 1.0.0 - */ - - /** - * Constructs a new ApiResponse. - * @alias module:model/ApiResponse - * @class - */ - var exports = function() { - var _this = this; - - - - - }; - - /** - * Constructs a ApiResponse 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/ApiResponse} obj Optional instance to populate. - * @return {module:model/ApiResponse} The populated ApiResponse instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - - if (data.hasOwnProperty('code')) { - obj['code'] = ApiClient.convertToType(data['code'], 'Number'); - } - if (data.hasOwnProperty('type')) { - obj['type'] = ApiClient.convertToType(data['type'], 'String'); - } - if (data.hasOwnProperty('message')) { - obj['message'] = ApiClient.convertToType(data['message'], 'String'); - } + if (data.hasOwnProperty('code')) { + obj['code'] = ApiClient.convertToType(data['code'], 'Number'); + } + if (data.hasOwnProperty('type')) { + obj['type'] = ApiClient.convertToType(data['type'], 'String'); + } + if (data.hasOwnProperty('message')) { + obj['message'] = ApiClient.convertToType(data['message'], 'String'); + } + } + return obj; } - return obj; - } - /** - * @member {Number} code - */ - exports.prototype['code'] = undefined; - /** - * @member {String} type - */ - exports.prototype['type'] = undefined; - /** - * @member {String} message - */ - exports.prototype['message'] = undefined; + /** + * @member {Number} code + */ + code = undefined; + /** + * @member {String} type + */ + type = undefined; + /** + * @member {String} message + */ + message = undefined; - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-es6/src/model/ArrayOfArrayOfNumberOnly.js b/samples/client/petstore/javascript-es6/src/model/ArrayOfArrayOfNumberOnly.js index 0b91fc04338..1dfd4487c62 100644 --- a/samples/client/petstore/javascript-es6/src/model/ArrayOfArrayOfNumberOnly.js +++ b/samples/client/petstore/javascript-es6/src/model/ArrayOfArrayOfNumberOnly.js @@ -7,76 +7,74 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + + + + +/** +* The ArrayOfArrayOfNumberOnly model module. +* @module model/ArrayOfArrayOfNumberOnly +* @version 1.0.0 +*/ +export default class ArrayOfArrayOfNumberOnly { + /** + * Constructs a new ArrayOfArrayOfNumberOnly. + * @alias module:model/ArrayOfArrayOfNumberOnly + * @class + */ + + constructor() { + + + + + + + + } - root.SwaggerPetstore.ArrayOfArrayOfNumberOnly = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; + /** + * Constructs a ArrayOfArrayOfNumberOnly 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/ArrayOfArrayOfNumberOnly} obj Optional instance to populate. + * @return {module:model/ArrayOfArrayOfNumberOnly} The populated ArrayOfArrayOfNumberOnly instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new ArrayOfArrayOfNumberOnly(); + + + - - /** - * The ArrayOfArrayOfNumberOnly model module. - * @module model/ArrayOfArrayOfNumberOnly - * @version 1.0.0 - */ - - /** - * Constructs a new ArrayOfArrayOfNumberOnly. - * @alias module:model/ArrayOfArrayOfNumberOnly - * @class - */ - var exports = function() { - var _this = this; - - - }; - - /** - * Constructs a ArrayOfArrayOfNumberOnly 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/ArrayOfArrayOfNumberOnly} obj Optional instance to populate. - * @return {module:model/ArrayOfArrayOfNumberOnly} The populated ArrayOfArrayOfNumberOnly instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - - if (data.hasOwnProperty('ArrayArrayNumber')) { - obj['ArrayArrayNumber'] = ApiClient.convertToType(data['ArrayArrayNumber'], [['Number']]); - } + if (data.hasOwnProperty('ArrayArrayNumber')) { + obj['ArrayArrayNumber'] = ApiClient.convertToType(data['ArrayArrayNumber'], [['Number']]); + } + } + return obj; } - return obj; - } - /** - * @member {Array.>} ArrayArrayNumber - */ - exports.prototype['ArrayArrayNumber'] = undefined; + /** + * @member {Array.>} ArrayArrayNumber + */ + ArrayArrayNumber = undefined; - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-es6/src/model/ArrayOfNumberOnly.js b/samples/client/petstore/javascript-es6/src/model/ArrayOfNumberOnly.js index f79ab37c076..379a19ba3ff 100644 --- a/samples/client/petstore/javascript-es6/src/model/ArrayOfNumberOnly.js +++ b/samples/client/petstore/javascript-es6/src/model/ArrayOfNumberOnly.js @@ -7,76 +7,74 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + + + + +/** +* The ArrayOfNumberOnly model module. +* @module model/ArrayOfNumberOnly +* @version 1.0.0 +*/ +export default class ArrayOfNumberOnly { + /** + * Constructs a new ArrayOfNumberOnly. + * @alias module:model/ArrayOfNumberOnly + * @class + */ + + constructor() { + + + + + + + + } - root.SwaggerPetstore.ArrayOfNumberOnly = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; + /** + * Constructs a ArrayOfNumberOnly 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/ArrayOfNumberOnly} obj Optional instance to populate. + * @return {module:model/ArrayOfNumberOnly} The populated ArrayOfNumberOnly instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new ArrayOfNumberOnly(); + + + - - /** - * The ArrayOfNumberOnly model module. - * @module model/ArrayOfNumberOnly - * @version 1.0.0 - */ - - /** - * Constructs a new ArrayOfNumberOnly. - * @alias module:model/ArrayOfNumberOnly - * @class - */ - var exports = function() { - var _this = this; - - - }; - - /** - * Constructs a ArrayOfNumberOnly 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/ArrayOfNumberOnly} obj Optional instance to populate. - * @return {module:model/ArrayOfNumberOnly} The populated ArrayOfNumberOnly instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - - if (data.hasOwnProperty('ArrayNumber')) { - obj['ArrayNumber'] = ApiClient.convertToType(data['ArrayNumber'], ['Number']); - } + if (data.hasOwnProperty('ArrayNumber')) { + obj['ArrayNumber'] = ApiClient.convertToType(data['ArrayNumber'], ['Number']); + } + } + return obj; } - return obj; - } - /** - * @member {Array.} ArrayNumber - */ - exports.prototype['ArrayNumber'] = undefined; + /** + * @member {Array.} ArrayNumber + */ + ArrayNumber = undefined; - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-es6/src/model/ArrayTest.js b/samples/client/petstore/javascript-es6/src/model/ArrayTest.js index 8698b21a153..58e9ac58840 100644 --- a/samples/client/petstore/javascript-es6/src/model/ArrayTest.js +++ b/samples/client/petstore/javascript-es6/src/model/ArrayTest.js @@ -7,92 +7,89 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(function(root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['ApiClient', 'model/ReadOnlyFirst'], factory); - } else if (typeof module === 'object' && module.exports) { - // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('../ApiClient'), require('./ReadOnlyFirst')); - } else { - // Browser globals (root is window) - if (!root.SwaggerPetstore) { - root.SwaggerPetstore = {}; + +import ApiClient from '../ApiClient'; +import ReadOnlyFirst from './ReadOnlyFirst'; + + + + + +/** +* The ArrayTest model module. +* @module model/ArrayTest +* @version 1.0.0 +*/ +export default class ArrayTest { + /** + * Constructs a new ArrayTest. + * @alias module:model/ArrayTest + * @class + */ + + constructor() { + + + + + + + + } - root.SwaggerPetstore.ArrayTest = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.ReadOnlyFirst); - } -}(this, function(ApiClient, ReadOnlyFirst) { - 'use strict'; + /** + * 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. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new ArrayTest(); + + + - - /** - * 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(); - - if (data.hasOwnProperty('array_of_string')) { - obj['array_of_string'] = ApiClient.convertToType(data['array_of_string'], ['String']); - } - if (data.hasOwnProperty('array_array_of_integer')) { - obj['array_array_of_integer'] = ApiClient.convertToType(data['array_array_of_integer'], [['Number']]); - } - if (data.hasOwnProperty('array_array_of_model')) { - obj['array_array_of_model'] = ApiClient.convertToType(data['array_array_of_model'], [[ReadOnlyFirst]]); - } + if (data.hasOwnProperty('array_of_string')) { + obj['array_of_string'] = ApiClient.convertToType(data['array_of_string'], ['String']); + } + if (data.hasOwnProperty('array_array_of_integer')) { + obj['array_array_of_integer'] = ApiClient.convertToType(data['array_array_of_integer'], [['Number']]); + } + if (data.hasOwnProperty('array_array_of_model')) { + obj['array_array_of_model'] = ApiClient.convertToType(data['array_array_of_model'], [[ReadOnlyFirst]]); + } + } + return obj; } - return obj; - } - /** - * @member {Array.} array_of_string - */ - exports.prototype['array_of_string'] = undefined; - /** - * @member {Array.>} array_array_of_integer - */ - exports.prototype['array_array_of_integer'] = undefined; - /** - * @member {Array.>} array_array_of_model - */ - exports.prototype['array_array_of_model'] = undefined; + /** + * @member {Array.} array_of_string + */ + array_of_string = undefined; + /** + * @member {Array.>} array_array_of_integer + */ + array_array_of_integer = undefined; + /** + * @member {Array.>} array_array_of_model + */ + array_array_of_model = undefined; - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-es6/src/model/Capitalization.js b/samples/client/petstore/javascript-es6/src/model/Capitalization.js index e4d1cce1e92..12f3f3f5593 100644 --- a/samples/client/petstore/javascript-es6/src/model/Capitalization.js +++ b/samples/client/petstore/javascript-es6/src/model/Capitalization.js @@ -7,117 +7,110 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + + + + +/** +* The Capitalization model module. +* @module model/Capitalization +* @version 1.0.0 +*/ +export default class Capitalization { + /** + * Constructs a new Capitalization. + * @alias module:model/Capitalization + * @class + */ + + constructor() { + + + + + + + + } - root.SwaggerPetstore.Capitalization = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; + /** + * Constructs a Capitalization 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/Capitalization} obj Optional instance to populate. + * @return {module:model/Capitalization} The populated Capitalization instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new Capitalization(); + + + - - /** - * The Capitalization model module. - * @module model/Capitalization - * @version 1.0.0 - */ - - /** - * Constructs a new Capitalization. - * @alias module:model/Capitalization - * @class - */ - var exports = function() { - var _this = this; - - - - - - - - }; - - /** - * Constructs a Capitalization 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/Capitalization} obj Optional instance to populate. - * @return {module:model/Capitalization} The populated Capitalization instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - - if (data.hasOwnProperty('smallCamel')) { - obj['smallCamel'] = ApiClient.convertToType(data['smallCamel'], 'String'); - } - if (data.hasOwnProperty('CapitalCamel')) { - obj['CapitalCamel'] = ApiClient.convertToType(data['CapitalCamel'], 'String'); - } - if (data.hasOwnProperty('small_Snake')) { - obj['small_Snake'] = ApiClient.convertToType(data['small_Snake'], 'String'); - } - if (data.hasOwnProperty('Capital_Snake')) { - obj['Capital_Snake'] = ApiClient.convertToType(data['Capital_Snake'], 'String'); - } - if (data.hasOwnProperty('SCA_ETH_Flow_Points')) { - obj['SCA_ETH_Flow_Points'] = ApiClient.convertToType(data['SCA_ETH_Flow_Points'], 'String'); - } - if (data.hasOwnProperty('ATT_NAME')) { - obj['ATT_NAME'] = ApiClient.convertToType(data['ATT_NAME'], 'String'); - } + if (data.hasOwnProperty('smallCamel')) { + obj['smallCamel'] = ApiClient.convertToType(data['smallCamel'], 'String'); + } + if (data.hasOwnProperty('CapitalCamel')) { + obj['CapitalCamel'] = ApiClient.convertToType(data['CapitalCamel'], 'String'); + } + if (data.hasOwnProperty('small_Snake')) { + obj['small_Snake'] = ApiClient.convertToType(data['small_Snake'], 'String'); + } + if (data.hasOwnProperty('Capital_Snake')) { + obj['Capital_Snake'] = ApiClient.convertToType(data['Capital_Snake'], 'String'); + } + if (data.hasOwnProperty('SCA_ETH_Flow_Points')) { + obj['SCA_ETH_Flow_Points'] = ApiClient.convertToType(data['SCA_ETH_Flow_Points'], 'String'); + } + if (data.hasOwnProperty('ATT_NAME')) { + obj['ATT_NAME'] = ApiClient.convertToType(data['ATT_NAME'], 'String'); + } + } + return obj; } - return obj; - } - /** - * @member {String} smallCamel - */ - exports.prototype['smallCamel'] = undefined; - /** - * @member {String} CapitalCamel - */ - exports.prototype['CapitalCamel'] = undefined; - /** - * @member {String} small_Snake - */ - exports.prototype['small_Snake'] = undefined; - /** - * @member {String} Capital_Snake - */ - exports.prototype['Capital_Snake'] = undefined; - /** - * @member {String} SCA_ETH_Flow_Points - */ - exports.prototype['SCA_ETH_Flow_Points'] = undefined; - /** - * Name of the pet - * @member {String} ATT_NAME - */ - exports.prototype['ATT_NAME'] = undefined; + /** + * @member {String} smallCamel + */ + smallCamel = undefined; + /** + * @member {String} CapitalCamel + */ + CapitalCamel = undefined; + /** + * @member {String} small_Snake + */ + small_Snake = undefined; + /** + * @member {String} Capital_Snake + */ + Capital_Snake = undefined; + /** + * @member {String} SCA_ETH_Flow_Points + */ + SCA_ETH_Flow_Points = undefined; + /** + * Name of the pet + * @member {String} ATT_NAME + */ + ATT_NAME = undefined; - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-es6/src/model/Cat.js b/samples/client/petstore/javascript-es6/src/model/Cat.js index 55f0a0c9834..da946664d08 100644 --- a/samples/client/petstore/javascript-es6/src/model/Cat.js +++ b/samples/client/petstore/javascript-es6/src/model/Cat.js @@ -7,81 +7,78 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; +import Animal from './Animal'; + + + + + +/** +* The Cat model module. +* @module model/Cat +* @version 1.0.0 +*/ +export default class Cat { + /** + * Constructs a new Cat. + * @alias module:model/Cat + * @class + * @extends module:model/Animal + * @param className {String} + */ + + constructor(className) { + + + Animal.call(this, className); + + + + + } - root.SwaggerPetstore.Cat = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.Animal); - } -}(this, function(ApiClient, Animal) { - 'use strict'; + /** + * Constructs a Cat 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/Cat} obj Optional instance to populate. + * @return {module:model/Cat} The populated Cat instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new Cat(); + + Animal.constructFromObject(data, obj); + - /** - * The Cat model module. - * @module model/Cat - * @version 1.0.0 - */ - - /** - * Constructs a new Cat. - * @alias module:model/Cat - * @class - * @extends module:model/Animal - * @param className {String} - */ - var exports = function(className) { - var _this = this; - Animal.call(_this, className); - - }; - - /** - * Constructs a Cat 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/Cat} obj Optional instance to populate. - * @return {module:model/Cat} The populated Cat instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - Animal.constructFromObject(data, obj); - if (data.hasOwnProperty('declawed')) { - obj['declawed'] = ApiClient.convertToType(data['declawed'], 'Boolean'); - } + if (data.hasOwnProperty('declawed')) { + obj['declawed'] = ApiClient.convertToType(data['declawed'], 'Boolean'); + } + } + return obj; } - return obj; - } - exports.prototype = Object.create(Animal.prototype); - exports.prototype.constructor = exports; - - /** - * @member {Boolean} declawed - */ - exports.prototype['declawed'] = undefined; + /** + * @member {Boolean} declawed + */ + declawed = undefined; - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-es6/src/model/Category.js b/samples/client/petstore/javascript-es6/src/model/Category.js index 37f547c79a1..a281817b72f 100644 --- a/samples/client/petstore/javascript-es6/src/model/Category.js +++ b/samples/client/petstore/javascript-es6/src/model/Category.js @@ -7,84 +7,81 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + + + + +/** +* The Category model module. +* @module model/Category +* @version 1.0.0 +*/ +export default class Category { + /** + * Constructs a new Category. + * @alias module:model/Category + * @class + */ + + constructor() { + + + + + + + + } - root.SwaggerPetstore.Category = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; + /** + * Constructs a Category 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/Category} obj Optional instance to populate. + * @return {module:model/Category} The populated Category instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new Category(); + + + - - /** - * The Category model module. - * @module model/Category - * @version 1.0.0 - */ - - /** - * Constructs a new Category. - * @alias module:model/Category - * @class - */ - var exports = function() { - var _this = this; - - - - }; - - /** - * Constructs a Category 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/Category} obj Optional instance to populate. - * @return {module:model/Category} The populated Category instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - - if (data.hasOwnProperty('id')) { - obj['id'] = ApiClient.convertToType(data['id'], 'Number'); - } - if (data.hasOwnProperty('name')) { - obj['name'] = ApiClient.convertToType(data['name'], 'String'); - } + if (data.hasOwnProperty('id')) { + obj['id'] = ApiClient.convertToType(data['id'], 'Number'); + } + if (data.hasOwnProperty('name')) { + obj['name'] = ApiClient.convertToType(data['name'], 'String'); + } + } + return obj; } - return obj; - } - /** - * @member {Number} id - */ - exports.prototype['id'] = undefined; - /** - * @member {String} name - */ - exports.prototype['name'] = undefined; + /** + * @member {Number} id + */ + id = undefined; + /** + * @member {String} name + */ + name = undefined; - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-es6/src/model/ClassModel.js b/samples/client/petstore/javascript-es6/src/model/ClassModel.js index bd390a22524..6a558444ade 100644 --- a/samples/client/petstore/javascript-es6/src/model/ClassModel.js +++ b/samples/client/petstore/javascript-es6/src/model/ClassModel.js @@ -7,77 +7,75 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + + + + +/** +* The ClassModel model module. +* @module model/ClassModel +* @version 1.0.0 +*/ +export default class ClassModel { + /** + * Constructs a new ClassModel. + * Model for testing model with \"_class\" property + * @alias module:model/ClassModel + * @class + */ + + constructor() { + + + + + + + + } - root.SwaggerPetstore.ClassModel = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; + /** + * Constructs a ClassModel 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/ClassModel} obj Optional instance to populate. + * @return {module:model/ClassModel} The populated ClassModel instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new ClassModel(); + + + - - /** - * The ClassModel model module. - * @module model/ClassModel - * @version 1.0.0 - */ - - /** - * Constructs a new ClassModel. - * Model for testing model with \"_class\" property - * @alias module:model/ClassModel - * @class - */ - var exports = function() { - var _this = this; - - - }; - - /** - * Constructs a ClassModel 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/ClassModel} obj Optional instance to populate. - * @return {module:model/ClassModel} The populated ClassModel instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - - if (data.hasOwnProperty('_class')) { - obj['_class'] = ApiClient.convertToType(data['_class'], 'String'); - } + if (data.hasOwnProperty('_class')) { + obj['_class'] = ApiClient.convertToType(data['_class'], 'String'); + } + } + return obj; } - return obj; - } - /** - * @member {String} _class - */ - exports.prototype['_class'] = undefined; + /** + * @member {String} _class + */ + _class = undefined; - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-es6/src/model/Client.js b/samples/client/petstore/javascript-es6/src/model/Client.js index 21add8d7f98..a4f9b235154 100644 --- a/samples/client/petstore/javascript-es6/src/model/Client.js +++ b/samples/client/petstore/javascript-es6/src/model/Client.js @@ -7,76 +7,74 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + + + + +/** +* The Client model module. +* @module model/Client +* @version 1.0.0 +*/ +export default class Client { + /** + * Constructs a new Client. + * @alias module:model/Client + * @class + */ + + constructor() { + + + + + + + + } - root.SwaggerPetstore.Client = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; + /** + * Constructs a Client 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/Client} obj Optional instance to populate. + * @return {module:model/Client} The populated Client instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new Client(); + + + - - /** - * The Client model module. - * @module model/Client - * @version 1.0.0 - */ - - /** - * Constructs a new Client. - * @alias module:model/Client - * @class - */ - var exports = function() { - var _this = this; - - - }; - - /** - * Constructs a Client 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/Client} obj Optional instance to populate. - * @return {module:model/Client} The populated Client instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - - if (data.hasOwnProperty('client')) { - obj['client'] = ApiClient.convertToType(data['client'], 'String'); - } + if (data.hasOwnProperty('client')) { + obj['client'] = ApiClient.convertToType(data['client'], 'String'); + } + } + return obj; } - return obj; - } - /** - * @member {String} client - */ - exports.prototype['client'] = undefined; + /** + * @member {String} client + */ + client = undefined; - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-es6/src/model/Dog.js b/samples/client/petstore/javascript-es6/src/model/Dog.js index f567953b625..e5bc0d3cecf 100644 --- a/samples/client/petstore/javascript-es6/src/model/Dog.js +++ b/samples/client/petstore/javascript-es6/src/model/Dog.js @@ -7,81 +7,78 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; +import Animal from './Animal'; + + + + + +/** +* The Dog model module. +* @module model/Dog +* @version 1.0.0 +*/ +export default class Dog { + /** + * Constructs a new Dog. + * @alias module:model/Dog + * @class + * @extends module:model/Animal + * @param className {String} + */ + + constructor(className) { + + + Animal.call(this, className); + + + + + } - root.SwaggerPetstore.Dog = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.Animal); - } -}(this, function(ApiClient, Animal) { - 'use strict'; + /** + * Constructs a Dog 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/Dog} obj Optional instance to populate. + * @return {module:model/Dog} The populated Dog instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new Dog(); + + Animal.constructFromObject(data, obj); + - /** - * The Dog model module. - * @module model/Dog - * @version 1.0.0 - */ - - /** - * Constructs a new Dog. - * @alias module:model/Dog - * @class - * @extends module:model/Animal - * @param className {String} - */ - var exports = function(className) { - var _this = this; - Animal.call(_this, className); - - }; - - /** - * Constructs a Dog 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/Dog} obj Optional instance to populate. - * @return {module:model/Dog} The populated Dog instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - Animal.constructFromObject(data, obj); - if (data.hasOwnProperty('breed')) { - obj['breed'] = ApiClient.convertToType(data['breed'], 'String'); - } + if (data.hasOwnProperty('breed')) { + obj['breed'] = ApiClient.convertToType(data['breed'], 'String'); + } + } + return obj; } - return obj; - } - exports.prototype = Object.create(Animal.prototype); - exports.prototype.constructor = exports; - - /** - * @member {String} breed - */ - exports.prototype['breed'] = undefined; + /** + * @member {String} breed + */ + breed = undefined; - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-es6/src/model/EnumArrays.js b/samples/client/petstore/javascript-es6/src/model/EnumArrays.js index 00036542ba7..20a74f0d883 100644 --- a/samples/client/petstore/javascript-es6/src/model/EnumArrays.js +++ b/samples/client/petstore/javascript-es6/src/model/EnumArrays.js @@ -7,118 +7,121 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + + + + +/** +* The EnumArrays model module. +* @module model/EnumArrays +* @version 1.0.0 +*/ +export default class EnumArrays { + /** + * Constructs a new EnumArrays. + * @alias module:model/EnumArrays + * @class + */ + + constructor() { + + + + + + + + } - root.SwaggerPetstore.EnumArrays = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; + /** + * Constructs a EnumArrays 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/EnumArrays} obj Optional instance to populate. + * @return {module:model/EnumArrays} The populated EnumArrays instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new EnumArrays(); + + + - - /** - * The EnumArrays model module. - * @module model/EnumArrays - * @version 1.0.0 - */ - - /** - * Constructs a new EnumArrays. - * @alias module:model/EnumArrays - * @class - */ - var exports = function() { - var _this = this; - - - - }; - - /** - * Constructs a EnumArrays 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/EnumArrays} obj Optional instance to populate. - * @return {module:model/EnumArrays} The populated EnumArrays instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - - if (data.hasOwnProperty('just_symbol')) { - obj['just_symbol'] = ApiClient.convertToType(data['just_symbol'], 'String'); - } - if (data.hasOwnProperty('array_enum')) { - obj['array_enum'] = ApiClient.convertToType(data['array_enum'], ['String']); - } + if (data.hasOwnProperty('just_symbol')) { + obj['just_symbol'] = ApiClient.convertToType(data['just_symbol'], 'String'); + } + if (data.hasOwnProperty('array_enum')) { + obj['array_enum'] = ApiClient.convertToType(data['array_enum'], ['String']); + } + } + return obj; } - return obj; - } - /** - * @member {module:model/EnumArrays.JustSymbolEnum} just_symbol - */ - exports.prototype['just_symbol'] = undefined; - /** - * @member {Array.} array_enum - */ - exports.prototype['array_enum'] = undefined; - - - /** - * Allowed values for the just_symbol property. - * @enum {String} - * @readonly - */ - exports.JustSymbolEnum = { /** - * value: ">=" - * @const - */ - "GREATER_THAN_OR_EQUAL_TO": ">=", + * @member {module:model/EnumArrays.JustSymbolEnum} just_symbol + */ + just_symbol = undefined; /** - * value: "$" - * @const - */ - "DOLLAR": "$" }; + * @member {Array.} array_enum + */ + array_enum = undefined; + + + + + - /** - * Allowed values for the arrayEnum property. - * @enum {String} - * @readonly - */ - exports.ArrayEnumEnum = { /** - * value: "fish" - * @const - */ - "fish": "fish", + * Allowed values for the just_symbol property. + * @enum {String} + * @readonly + */ + static JustSymbolEnum = { + + /** + * value: ">=" + * @const + */ + "GREATER_THAN_OR_EQUAL_TO": ">=", + + /** + * value: "$" + * @const + */ + "DOLLAR": "$" + }; + /** - * value: "crab" - * @const - */ - "crab": "crab" }; + * Allowed values for the arrayEnum property. + * @enum {String} + * @readonly + */ + static ArrayEnumEnum = { + + /** + * value: "fish" + * @const + */ + "fish": "fish", + + /** + * value: "crab" + * @const + */ + "crab": "crab" + }; - return exports; -})); + +} diff --git a/samples/client/petstore/javascript-es6/src/model/EnumClass.js b/samples/client/petstore/javascript-es6/src/model/EnumClass.js index f03ab350d2f..eeb08ca2864 100644 --- a/samples/client/petstore/javascript-es6/src/model/EnumClass.js +++ b/samples/client/petstore/javascript-es6/src/model/EnumClass.js @@ -7,63 +7,51 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + +/** +* Enum class EnumClass. +* @enum {} +* @readonly +*/ +export default class EnumClass { + + /** + * value: "_abc" + * @const + */ + _abc = "_abc"; + + + /** + * value: "-efg" + * @const + */ + -efg = "-efg"; + + + /** + * value: "(xyz)" + * @const + */ + (xyz) = "(xyz)"; + + + + /** + * Returns a EnumClass enum value from a Javascript object name. + * @param {Object} data The plain JavaScript object containing the name of the enum value. + * @return {module:model/EnumClass} The enum EnumClass value. + */ + static constructFromObject(object) { + return object; } - root.SwaggerPetstore.EnumClass = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; - - - /** - * Enum class EnumClass. - * @enum {} - * @readonly - */ - var exports = { - /** - * value: "_abc" - * @const - */ - "_abc": "_abc", - /** - * value: "-efg" - * @const - */ - "-efg": "-efg", - /** - * value: "(xyz)" - * @const - */ - "(xyz)": "(xyz)" }; - - /** - * Returns a EnumClass enum value from a Javascript object name. - * @param {Object} data The plain JavaScript object containing the name of the enum value. - * @return {module:model/EnumClass} The enum EnumClass value. - */ - exports.constructFromObject = function(object) { - return object; - } - - return exports; -})); +} diff --git a/samples/client/petstore/javascript-es6/src/model/EnumTest.js b/samples/client/petstore/javascript-es6/src/model/EnumTest.js index 3e7c9311aaf..b1f9b0b6c69 100644 --- a/samples/client/petstore/javascript-es6/src/model/EnumTest.js +++ b/samples/client/petstore/javascript-es6/src/model/EnumTest.js @@ -7,156 +7,162 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(function(root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['ApiClient', 'model/OuterEnum'], factory); - } else if (typeof module === 'object' && module.exports) { - // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('../ApiClient'), require('./OuterEnum')); - } else { - // Browser globals (root is window) - if (!root.SwaggerPetstore) { - root.SwaggerPetstore = {}; + +import ApiClient from '../ApiClient'; +import OuterEnum from './OuterEnum'; + + + + + +/** +* The EnumTest model module. +* @module model/EnumTest +* @version 1.0.0 +*/ +export default class EnumTest { + /** + * Constructs a new EnumTest. + * @alias module:model/EnumTest + * @class + */ + + constructor() { + + + + + + + + } - root.SwaggerPetstore.EnumTest = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.OuterEnum); - } -}(this, function(ApiClient, OuterEnum) { - 'use strict'; + /** + * Constructs a EnumTest 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/EnumTest} obj Optional instance to populate. + * @return {module:model/EnumTest} The populated EnumTest instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new EnumTest(); + + + - - /** - * The EnumTest model module. - * @module model/EnumTest - * @version 1.0.0 - */ - - /** - * Constructs a new EnumTest. - * @alias module:model/EnumTest - * @class - */ - var exports = function() { - var _this = this; - - - - - - }; - - /** - * Constructs a EnumTest 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/EnumTest} obj Optional instance to populate. - * @return {module:model/EnumTest} The populated EnumTest instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - - if (data.hasOwnProperty('enum_string')) { - obj['enum_string'] = ApiClient.convertToType(data['enum_string'], 'String'); - } - if (data.hasOwnProperty('enum_integer')) { - obj['enum_integer'] = ApiClient.convertToType(data['enum_integer'], 'Number'); - } - if (data.hasOwnProperty('enum_number')) { - obj['enum_number'] = ApiClient.convertToType(data['enum_number'], 'Number'); - } - if (data.hasOwnProperty('outerEnum')) { - obj['outerEnum'] = OuterEnum.constructFromObject(data['outerEnum']); - } + if (data.hasOwnProperty('enum_string')) { + obj['enum_string'] = ApiClient.convertToType(data['enum_string'], 'String'); + } + if (data.hasOwnProperty('enum_integer')) { + obj['enum_integer'] = ApiClient.convertToType(data['enum_integer'], 'Number'); + } + if (data.hasOwnProperty('enum_number')) { + obj['enum_number'] = ApiClient.convertToType(data['enum_number'], 'Number'); + } + if (data.hasOwnProperty('outerEnum')) { + obj['outerEnum'] = OuterEnum.constructFromObject(data['outerEnum']); + } + } + return obj; } - return obj; - } - /** - * @member {module:model/EnumTest.EnumStringEnum} enum_string - */ - exports.prototype['enum_string'] = undefined; - /** - * @member {module:model/EnumTest.EnumIntegerEnum} enum_integer - */ - exports.prototype['enum_integer'] = undefined; - /** - * @member {module:model/EnumTest.EnumNumberEnum} enum_number - */ - exports.prototype['enum_number'] = undefined; - /** - * @member {module:model/OuterEnum} outerEnum - */ - exports.prototype['outerEnum'] = undefined; - - - /** - * Allowed values for the enum_string property. - * @enum {String} - * @readonly - */ - exports.EnumStringEnum = { /** - * value: "UPPER" - * @const - */ - "UPPER": "UPPER", + * @member {module:model/EnumTest.EnumStringEnum} enum_string + */ + enum_string = undefined; /** - * value: "lower" - * @const - */ - "lower": "lower", + * @member {module:model/EnumTest.EnumIntegerEnum} enum_integer + */ + enum_integer = undefined; /** - * value: "" - * @const - */ - "empty": "" }; - - /** - * Allowed values for the enum_integer property. - * @enum {Number} - * @readonly - */ - exports.EnumIntegerEnum = { + * @member {module:model/EnumTest.EnumNumberEnum} enum_number + */ + enum_number = undefined; /** - * value: 1 - * @const - */ - "1": 1, - /** - * value: -1 - * @const - */ - "-1": -1 }; - - /** - * Allowed values for the enum_number property. - * @enum {Number} - * @readonly - */ - exports.EnumNumberEnum = { - /** - * value: 1.1 - * @const - */ - "1.1": 1.1, - /** - * value: -1.2 - * @const - */ - "-1.2": -1.2 }; + * @member {module:model/OuterEnum} outerEnum + */ + outerEnum = undefined; - return exports; -})); + + + + + /** + * Allowed values for the enum_string property. + * @enum {String} + * @readonly + */ + static EnumStringEnum = { + + /** + * value: "UPPER" + * @const + */ + "UPPER": "UPPER", + + /** + * value: "lower" + * @const + */ + "lower": "lower", + + /** + * value: "" + * @const + */ + "empty": "" + }; + + /** + * Allowed values for the enum_integer property. + * @enum {Number} + * @readonly + */ + static EnumIntegerEnum = { + + /** + * value: 1 + * @const + */ + "1": 1, + + /** + * value: -1 + * @const + */ + "-1": -1 + }; + + /** + * Allowed values for the enum_number property. + * @enum {Number} + * @readonly + */ + static EnumNumberEnum = { + + /** + * value: 1.1 + * @const + */ + "1.1": 1.1, + + /** + * value: -1.2 + * @const + */ + "-1.2": -1.2 + }; + + + +} diff --git a/samples/client/petstore/javascript-es6/src/model/FormatTest.js b/samples/client/petstore/javascript-es6/src/model/FormatTest.js index 9b93b06b7ca..8773a3a7755 100644 --- a/samples/client/petstore/javascript-es6/src/model/FormatTest.js +++ b/samples/client/petstore/javascript-es6/src/model/FormatTest.js @@ -7,176 +7,162 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + + + + +/** +* The FormatTest model module. +* @module model/FormatTest +* @version 1.0.0 +*/ +export default class FormatTest { + /** + * Constructs a new FormatTest. + * @alias module:model/FormatTest + * @class + * @param _number {Number} + * @param _byte {Blob} + * @param _date {Date} + * @param password {String} + */ + + constructor(_number, _byte, _date, password) { + + + + + + this['number'] = _number;this['byte'] = _byte;this['date'] = _date;this['password'] = password; + + } - root.SwaggerPetstore.FormatTest = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; + /** + * Constructs a FormatTest 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/FormatTest} obj Optional instance to populate. + * @return {module:model/FormatTest} The populated FormatTest instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new FormatTest(); + + + - - /** - * The FormatTest model module. - * @module model/FormatTest - * @version 1.0.0 - */ - - /** - * Constructs a new FormatTest. - * @alias module:model/FormatTest - * @class - * @param _number {Number} - * @param _byte {Blob} - * @param _date {Date} - * @param password {String} - */ - var exports = function(_number, _byte, _date, password) { - var _this = this; - - - - - _this['number'] = _number; - - - - _this['byte'] = _byte; - - _this['date'] = _date; - - - _this['password'] = password; - }; - - /** - * Constructs a FormatTest 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/FormatTest} obj Optional instance to populate. - * @return {module:model/FormatTest} The populated FormatTest instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - - if (data.hasOwnProperty('integer')) { - obj['integer'] = ApiClient.convertToType(data['integer'], 'Number'); - } - if (data.hasOwnProperty('int32')) { - obj['int32'] = ApiClient.convertToType(data['int32'], 'Number'); - } - if (data.hasOwnProperty('int64')) { - obj['int64'] = ApiClient.convertToType(data['int64'], 'Number'); - } - if (data.hasOwnProperty('number')) { - obj['number'] = ApiClient.convertToType(data['number'], 'Number'); - } - if (data.hasOwnProperty('float')) { - obj['float'] = ApiClient.convertToType(data['float'], 'Number'); - } - if (data.hasOwnProperty('double')) { - obj['double'] = ApiClient.convertToType(data['double'], 'Number'); - } - if (data.hasOwnProperty('string')) { - obj['string'] = ApiClient.convertToType(data['string'], 'String'); - } - if (data.hasOwnProperty('byte')) { - obj['byte'] = ApiClient.convertToType(data['byte'], 'Blob'); - } - if (data.hasOwnProperty('binary')) { - obj['binary'] = ApiClient.convertToType(data['binary'], 'Blob'); - } - if (data.hasOwnProperty('date')) { - obj['date'] = ApiClient.convertToType(data['date'], 'Date'); - } - if (data.hasOwnProperty('dateTime')) { - obj['dateTime'] = ApiClient.convertToType(data['dateTime'], 'Date'); - } - if (data.hasOwnProperty('uuid')) { - obj['uuid'] = ApiClient.convertToType(data['uuid'], 'String'); - } - if (data.hasOwnProperty('password')) { - obj['password'] = ApiClient.convertToType(data['password'], 'String'); - } + if (data.hasOwnProperty('integer')) { + obj['integer'] = ApiClient.convertToType(data['integer'], 'Number'); + } + if (data.hasOwnProperty('int32')) { + obj['int32'] = ApiClient.convertToType(data['int32'], 'Number'); + } + if (data.hasOwnProperty('int64')) { + obj['int64'] = ApiClient.convertToType(data['int64'], 'Number'); + } + if (data.hasOwnProperty('number')) { + obj['number'] = ApiClient.convertToType(data['number'], 'Number'); + } + if (data.hasOwnProperty('float')) { + obj['float'] = ApiClient.convertToType(data['float'], 'Number'); + } + if (data.hasOwnProperty('double')) { + obj['double'] = ApiClient.convertToType(data['double'], 'Number'); + } + if (data.hasOwnProperty('string')) { + obj['string'] = ApiClient.convertToType(data['string'], 'String'); + } + if (data.hasOwnProperty('byte')) { + obj['byte'] = ApiClient.convertToType(data['byte'], 'Blob'); + } + if (data.hasOwnProperty('binary')) { + obj['binary'] = ApiClient.convertToType(data['binary'], 'Blob'); + } + if (data.hasOwnProperty('date')) { + obj['date'] = ApiClient.convertToType(data['date'], 'Date'); + } + if (data.hasOwnProperty('dateTime')) { + obj['dateTime'] = ApiClient.convertToType(data['dateTime'], 'Date'); + } + if (data.hasOwnProperty('uuid')) { + obj['uuid'] = ApiClient.convertToType(data['uuid'], 'String'); + } + if (data.hasOwnProperty('password')) { + obj['password'] = ApiClient.convertToType(data['password'], 'String'); + } + } + return obj; } - return obj; - } - /** - * @member {Number} integer - */ - exports.prototype['integer'] = undefined; - /** - * @member {Number} int32 - */ - exports.prototype['int32'] = undefined; - /** - * @member {Number} int64 - */ - exports.prototype['int64'] = undefined; - /** - * @member {Number} number - */ - exports.prototype['number'] = undefined; - /** - * @member {Number} float - */ - exports.prototype['float'] = undefined; - /** - * @member {Number} double - */ - exports.prototype['double'] = undefined; - /** - * @member {String} string - */ - exports.prototype['string'] = undefined; - /** - * @member {Blob} byte - */ - exports.prototype['byte'] = undefined; - /** - * @member {Blob} binary - */ - exports.prototype['binary'] = undefined; - /** - * @member {Date} date - */ - exports.prototype['date'] = undefined; - /** - * @member {Date} dateTime - */ - exports.prototype['dateTime'] = undefined; - /** - * @member {String} uuid - */ - exports.prototype['uuid'] = undefined; - /** - * @member {String} password - */ - exports.prototype['password'] = undefined; + /** + * @member {Number} integer + */ + integer = undefined; + /** + * @member {Number} int32 + */ + int32 = undefined; + /** + * @member {Number} int64 + */ + int64 = undefined; + /** + * @member {Number} number + */ + number = undefined; + /** + * @member {Number} float + */ + float = undefined; + /** + * @member {Number} double + */ + double = undefined; + /** + * @member {String} string + */ + string = undefined; + /** + * @member {Blob} byte + */ + byte = undefined; + /** + * @member {Blob} binary + */ + binary = undefined; + /** + * @member {Date} date + */ + date = undefined; + /** + * @member {Date} dateTime + */ + dateTime = undefined; + /** + * @member {String} uuid + */ + uuid = undefined; + /** + * @member {String} password + */ + password = undefined; - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-es6/src/model/HasOnlyReadOnly.js b/samples/client/petstore/javascript-es6/src/model/HasOnlyReadOnly.js index 17c09dfca7b..cb859fe3e50 100644 --- a/samples/client/petstore/javascript-es6/src/model/HasOnlyReadOnly.js +++ b/samples/client/petstore/javascript-es6/src/model/HasOnlyReadOnly.js @@ -7,84 +7,81 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + + + + +/** +* The HasOnlyReadOnly model module. +* @module model/HasOnlyReadOnly +* @version 1.0.0 +*/ +export default class HasOnlyReadOnly { + /** + * Constructs a new HasOnlyReadOnly. + * @alias module:model/HasOnlyReadOnly + * @class + */ + + constructor() { + + + + + + + + } - root.SwaggerPetstore.HasOnlyReadOnly = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; + /** + * Constructs a HasOnlyReadOnly 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/HasOnlyReadOnly} obj Optional instance to populate. + * @return {module:model/HasOnlyReadOnly} The populated HasOnlyReadOnly instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new HasOnlyReadOnly(); + + + - - /** - * The HasOnlyReadOnly model module. - * @module model/HasOnlyReadOnly - * @version 1.0.0 - */ - - /** - * Constructs a new HasOnlyReadOnly. - * @alias module:model/HasOnlyReadOnly - * @class - */ - var exports = function() { - var _this = this; - - - - }; - - /** - * Constructs a HasOnlyReadOnly 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/HasOnlyReadOnly} obj Optional instance to populate. - * @return {module:model/HasOnlyReadOnly} The populated HasOnlyReadOnly 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('foo')) { - obj['foo'] = ApiClient.convertToType(data['foo'], 'String'); - } + if (data.hasOwnProperty('bar')) { + obj['bar'] = ApiClient.convertToType(data['bar'], 'String'); + } + if (data.hasOwnProperty('foo')) { + obj['foo'] = ApiClient.convertToType(data['foo'], 'String'); + } + } + return obj; } - return obj; - } - /** - * @member {String} bar - */ - exports.prototype['bar'] = undefined; - /** - * @member {String} foo - */ - exports.prototype['foo'] = undefined; + /** + * @member {String} bar + */ + bar = undefined; + /** + * @member {String} foo + */ + foo = undefined; - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-es6/src/model/List.js b/samples/client/petstore/javascript-es6/src/model/List.js index ce54341bb18..513acd45aff 100644 --- a/samples/client/petstore/javascript-es6/src/model/List.js +++ b/samples/client/petstore/javascript-es6/src/model/List.js @@ -7,76 +7,74 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + + + + +/** +* The List model module. +* @module model/List +* @version 1.0.0 +*/ +export default class List { + /** + * Constructs a new List. + * @alias module:model/List + * @class + */ + + constructor() { + + + + + + + + } - root.SwaggerPetstore.List = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; + /** + * Constructs a List 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/List} obj Optional instance to populate. + * @return {module:model/List} The populated List instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new List(); + + + - - /** - * The List model module. - * @module model/List - * @version 1.0.0 - */ - - /** - * Constructs a new List. - * @alias module:model/List - * @class - */ - var exports = function() { - var _this = this; - - - }; - - /** - * Constructs a List 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/List} obj Optional instance to populate. - * @return {module:model/List} The populated List instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - - if (data.hasOwnProperty('123-list')) { - obj['123-list'] = ApiClient.convertToType(data['123-list'], 'String'); - } + if (data.hasOwnProperty('123-list')) { + obj['123-list'] = ApiClient.convertToType(data['123-list'], 'String'); + } + } + return obj; } - return obj; - } - /** - * @member {String} 123-list - */ - exports.prototype['123-list'] = undefined; + /** + * @member {String} 123-list + */ + 123-list = undefined; - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-es6/src/model/MapTest.js b/samples/client/petstore/javascript-es6/src/model/MapTest.js index b7d0164b998..b7a60cd8d9d 100644 --- a/samples/client/petstore/javascript-es6/src/model/MapTest.js +++ b/samples/client/petstore/javascript-es6/src/model/MapTest.js @@ -7,101 +7,101 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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.MapTest = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; + +import ApiClient from '../ApiClient'; - /** - * The MapTest model module. - * @module model/MapTest - * @version 1.0.0 - */ - /** - * Constructs a new MapTest. - * @alias module:model/MapTest - * @class - */ - var exports = function() { - var _this = this; - - - - }; - - /** - * Constructs a MapTest 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/MapTest} obj Optional instance to populate. - * @return {module:model/MapTest} The populated MapTest instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - - if (data.hasOwnProperty('map_map_of_string')) { - obj['map_map_of_string'] = ApiClient.convertToType(data['map_map_of_string'], {'String': {'String': 'String'}}); - } - if (data.hasOwnProperty('map_of_enum_string')) { - obj['map_of_enum_string'] = ApiClient.convertToType(data['map_of_enum_string'], {'String': 'String'}); - } - } - return obj; - } - - /** - * @member {Object.>} map_map_of_string - */ - exports.prototype['map_map_of_string'] = undefined; - /** - * @member {Object.} map_of_enum_string - */ - exports.prototype['map_of_enum_string'] = undefined; - - - /** - * Allowed values for the inner property. - * @enum {String} - * @readonly - */ - exports.InnerEnum = { +/** +* The MapTest model module. +* @module model/MapTest +* @version 1.0.0 +*/ +export default class MapTest { /** - * value: "UPPER" - * @const - */ - "UPPER": "UPPER", + * Constructs a new MapTest. + * @alias module:model/MapTest + * @class + */ + + constructor() { + + + + + + + + + } + /** - * value: "lower" - * @const - */ - "lower": "lower" }; + * Constructs a MapTest 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/MapTest} obj Optional instance to populate. + * @return {module:model/MapTest} The populated MapTest instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new MapTest(); + + + + + + if (data.hasOwnProperty('map_map_of_string')) { + obj['map_map_of_string'] = ApiClient.convertToType(data['map_map_of_string'], {'String': {'String': 'String'}}); + } + if (data.hasOwnProperty('map_of_enum_string')) { + obj['map_of_enum_string'] = ApiClient.convertToType(data['map_of_enum_string'], {'String': 'String'}); + } + } + return obj; + } + + /** + * @member {Object.>} map_map_of_string + */ + map_map_of_string = undefined; + /** + * @member {Object.} map_of_enum_string + */ + map_of_enum_string = undefined; - return exports; -})); + + + + + /** + * Allowed values for the inner property. + * @enum {String} + * @readonly + */ + static InnerEnum = { + + /** + * value: "UPPER" + * @const + */ + "UPPER": "UPPER", + + /** + * value: "lower" + * @const + */ + "lower": "lower" + }; + + + +} diff --git a/samples/client/petstore/javascript-es6/src/model/MixedPropertiesAndAdditionalPropertiesClass.js b/samples/client/petstore/javascript-es6/src/model/MixedPropertiesAndAdditionalPropertiesClass.js index 973ca5a65e2..6d912ceeb9b 100644 --- a/samples/client/petstore/javascript-es6/src/model/MixedPropertiesAndAdditionalPropertiesClass.js +++ b/samples/client/petstore/javascript-es6/src/model/MixedPropertiesAndAdditionalPropertiesClass.js @@ -7,92 +7,89 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; +import Animal from './Animal'; + + + + + +/** +* The MixedPropertiesAndAdditionalPropertiesClass model module. +* @module model/MixedPropertiesAndAdditionalPropertiesClass +* @version 1.0.0 +*/ +export default class MixedPropertiesAndAdditionalPropertiesClass { + /** + * Constructs a new MixedPropertiesAndAdditionalPropertiesClass. + * @alias module:model/MixedPropertiesAndAdditionalPropertiesClass + * @class + */ + + constructor() { + + + + + + + + } - root.SwaggerPetstore.MixedPropertiesAndAdditionalPropertiesClass = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.Animal); - } -}(this, function(ApiClient, Animal) { - 'use strict'; + /** + * 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. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new MixedPropertiesAndAdditionalPropertiesClass(); + + + - - /** - * The MixedPropertiesAndAdditionalPropertiesClass model module. - * @module model/MixedPropertiesAndAdditionalPropertiesClass - * @version 1.0.0 - */ - - /** - * Constructs a new MixedPropertiesAndAdditionalPropertiesClass. - * @alias module:model/MixedPropertiesAndAdditionalPropertiesClass - * @class - */ - var exports = function() { - var _this = 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(); - - if (data.hasOwnProperty('uuid')) { - obj['uuid'] = ApiClient.convertToType(data['uuid'], 'String'); - } - if (data.hasOwnProperty('dateTime')) { - obj['dateTime'] = ApiClient.convertToType(data['dateTime'], 'Date'); - } - if (data.hasOwnProperty('map')) { - obj['map'] = ApiClient.convertToType(data['map'], {'String': Animal}); - } + if (data.hasOwnProperty('uuid')) { + obj['uuid'] = ApiClient.convertToType(data['uuid'], 'String'); + } + if (data.hasOwnProperty('dateTime')) { + obj['dateTime'] = ApiClient.convertToType(data['dateTime'], 'Date'); + } + if (data.hasOwnProperty('map')) { + obj['map'] = ApiClient.convertToType(data['map'], {'String': Animal}); + } + } + return obj; } - return obj; - } - /** - * @member {String} uuid - */ - exports.prototype['uuid'] = undefined; - /** - * @member {Date} dateTime - */ - exports.prototype['dateTime'] = undefined; - /** - * @member {Object.} map - */ - exports.prototype['map'] = undefined; + /** + * @member {String} uuid + */ + uuid = undefined; + /** + * @member {Date} dateTime + */ + dateTime = undefined; + /** + * @member {Object.} map + */ + map = undefined; - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-es6/src/model/Model200Response.js b/samples/client/petstore/javascript-es6/src/model/Model200Response.js index c382f333344..df4d957df7c 100644 --- a/samples/client/petstore/javascript-es6/src/model/Model200Response.js +++ b/samples/client/petstore/javascript-es6/src/model/Model200Response.js @@ -7,85 +7,82 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + + + + +/** +* The Model200Response model module. +* @module model/Model200Response +* @version 1.0.0 +*/ +export default class Model200Response { + /** + * Constructs a new Model200Response. + * Model for testing model name starting with number + * @alias module:model/Model200Response + * @class + */ + + constructor() { + + + + + + + + } - root.SwaggerPetstore.Model200Response = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; + /** + * Constructs a Model200Response 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/Model200Response} obj Optional instance to populate. + * @return {module:model/Model200Response} The populated Model200Response instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new Model200Response(); + + + - - /** - * The Model200Response model module. - * @module model/Model200Response - * @version 1.0.0 - */ - - /** - * Constructs a new Model200Response. - * Model for testing model name starting with number - * @alias module:model/Model200Response - * @class - */ - var exports = function() { - var _this = this; - - - - }; - - /** - * Constructs a Model200Response 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/Model200Response} obj Optional instance to populate. - * @return {module:model/Model200Response} The populated Model200Response instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - - if (data.hasOwnProperty('name')) { - obj['name'] = ApiClient.convertToType(data['name'], 'Number'); - } - if (data.hasOwnProperty('class')) { - obj['class'] = ApiClient.convertToType(data['class'], 'String'); - } + if (data.hasOwnProperty('name')) { + obj['name'] = ApiClient.convertToType(data['name'], 'Number'); + } + if (data.hasOwnProperty('class')) { + obj['class'] = ApiClient.convertToType(data['class'], 'String'); + } + } + return obj; } - return obj; - } - /** - * @member {Number} name - */ - exports.prototype['name'] = undefined; - /** - * @member {String} class - */ - exports.prototype['class'] = undefined; + /** + * @member {Number} name + */ + name = undefined; + /** + * @member {String} class + */ + class = undefined; - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-es6/src/model/ModelReturn.js b/samples/client/petstore/javascript-es6/src/model/ModelReturn.js index fa5bc9910f8..88fd97ab85f 100644 --- a/samples/client/petstore/javascript-es6/src/model/ModelReturn.js +++ b/samples/client/petstore/javascript-es6/src/model/ModelReturn.js @@ -7,77 +7,75 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + + + + +/** +* The ModelReturn model module. +* @module model/ModelReturn +* @version 1.0.0 +*/ +export default class ModelReturn { + /** + * Constructs a new ModelReturn. + * Model for testing reserved words + * @alias module:model/ModelReturn + * @class + */ + + constructor() { + + + + + + + + } - root.SwaggerPetstore.ModelReturn = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; + /** + * Constructs a ModelReturn 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/ModelReturn} obj Optional instance to populate. + * @return {module:model/ModelReturn} The populated ModelReturn instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new ModelReturn(); + + + - - /** - * The ModelReturn model module. - * @module model/ModelReturn - * @version 1.0.0 - */ - - /** - * Constructs a new ModelReturn. - * Model for testing reserved words - * @alias module:model/ModelReturn - * @class - */ - var exports = function() { - var _this = this; - - - }; - - /** - * Constructs a ModelReturn 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/ModelReturn} obj Optional instance to populate. - * @return {module:model/ModelReturn} The populated ModelReturn instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - - if (data.hasOwnProperty('return')) { - obj['return'] = ApiClient.convertToType(data['return'], 'Number'); - } + if (data.hasOwnProperty('return')) { + obj['return'] = ApiClient.convertToType(data['return'], 'Number'); + } + } + return obj; } - return obj; - } - /** - * @member {Number} return - */ - exports.prototype['return'] = undefined; + /** + * @member {Number} return + */ + return = undefined; - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-es6/src/model/Name.js b/samples/client/petstore/javascript-es6/src/model/Name.js index 0671311976c..f355fbdd403 100644 --- a/samples/client/petstore/javascript-es6/src/model/Name.js +++ b/samples/client/petstore/javascript-es6/src/model/Name.js @@ -7,102 +7,97 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + + + + +/** +* The Name model module. +* @module model/Name +* @version 1.0.0 +*/ +export default class Name { + /** + * Constructs a new Name. + * Model for testing model name same as property name + * @alias module:model/Name + * @class + * @param name {Number} + */ + + constructor(name) { + + + + + + this['name'] = name; + + } - root.SwaggerPetstore.Name = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; + /** + * Constructs a Name 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/Name} obj Optional instance to populate. + * @return {module:model/Name} The populated Name instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new Name(); + + + - - /** - * The Name model module. - * @module model/Name - * @version 1.0.0 - */ - - /** - * Constructs a new Name. - * Model for testing model name same as property name - * @alias module:model/Name - * @class - * @param name {Number} - */ - var exports = function(name) { - var _this = this; - - _this['name'] = name; - - - - }; - - /** - * Constructs a Name 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/Name} obj Optional instance to populate. - * @return {module:model/Name} The populated Name instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - - if (data.hasOwnProperty('name')) { - obj['name'] = ApiClient.convertToType(data['name'], 'Number'); - } - if (data.hasOwnProperty('snake_case')) { - obj['snake_case'] = ApiClient.convertToType(data['snake_case'], 'Number'); - } - if (data.hasOwnProperty('property')) { - obj['property'] = ApiClient.convertToType(data['property'], 'String'); - } - if (data.hasOwnProperty('123Number')) { - obj['123Number'] = ApiClient.convertToType(data['123Number'], 'Number'); - } + if (data.hasOwnProperty('name')) { + obj['name'] = ApiClient.convertToType(data['name'], 'Number'); + } + if (data.hasOwnProperty('snake_case')) { + obj['snake_case'] = ApiClient.convertToType(data['snake_case'], 'Number'); + } + if (data.hasOwnProperty('property')) { + obj['property'] = ApiClient.convertToType(data['property'], 'String'); + } + if (data.hasOwnProperty('123Number')) { + obj['123Number'] = ApiClient.convertToType(data['123Number'], 'Number'); + } + } + return obj; } - return obj; - } - /** - * @member {Number} name - */ - exports.prototype['name'] = undefined; - /** - * @member {Number} snake_case - */ - exports.prototype['snake_case'] = undefined; - /** - * @member {String} property - */ - exports.prototype['property'] = undefined; - /** - * @member {Number} 123Number - */ - exports.prototype['123Number'] = undefined; + /** + * @member {Number} name + */ + name = undefined; + /** + * @member {Number} snake_case + */ + snake_case = undefined; + /** + * @member {String} property + */ + property = undefined; + /** + * @member {Number} 123Number + */ + 123Number = undefined; - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-es6/src/model/NumberOnly.js b/samples/client/petstore/javascript-es6/src/model/NumberOnly.js index d9ee8fcd3ab..bee66870891 100644 --- a/samples/client/petstore/javascript-es6/src/model/NumberOnly.js +++ b/samples/client/petstore/javascript-es6/src/model/NumberOnly.js @@ -7,76 +7,74 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + + + + +/** +* The NumberOnly model module. +* @module model/NumberOnly +* @version 1.0.0 +*/ +export default class NumberOnly { + /** + * Constructs a new NumberOnly. + * @alias module:model/NumberOnly + * @class + */ + + constructor() { + + + + + + + + } - root.SwaggerPetstore.NumberOnly = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; + /** + * Constructs a NumberOnly 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/NumberOnly} obj Optional instance to populate. + * @return {module:model/NumberOnly} The populated NumberOnly instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new NumberOnly(); + + + - - /** - * The NumberOnly model module. - * @module model/NumberOnly - * @version 1.0.0 - */ - - /** - * Constructs a new NumberOnly. - * @alias module:model/NumberOnly - * @class - */ - var exports = function() { - var _this = this; - - - }; - - /** - * Constructs a NumberOnly 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/NumberOnly} obj Optional instance to populate. - * @return {module:model/NumberOnly} The populated NumberOnly instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - - if (data.hasOwnProperty('JustNumber')) { - obj['JustNumber'] = ApiClient.convertToType(data['JustNumber'], 'Number'); - } + if (data.hasOwnProperty('JustNumber')) { + obj['JustNumber'] = ApiClient.convertToType(data['JustNumber'], 'Number'); + } + } + return obj; } - return obj; - } - /** - * @member {Number} JustNumber - */ - exports.prototype['JustNumber'] = undefined; + /** + * @member {Number} JustNumber + */ + JustNumber = undefined; - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-es6/src/model/Order.js b/samples/client/petstore/javascript-es6/src/model/Order.js index f082668517f..ff704900bbc 100644 --- a/samples/client/petstore/javascript-es6/src/model/Order.js +++ b/samples/client/petstore/javascript-es6/src/model/Order.js @@ -7,140 +7,137 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + + + + +/** +* The Order model module. +* @module model/Order +* @version 1.0.0 +*/ +export default class Order { + /** + * Constructs a new Order. + * @alias module:model/Order + * @class + */ + + constructor() { + + + + + + + + } - root.SwaggerPetstore.Order = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; + /** + * Constructs a Order 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/Order} obj Optional instance to populate. + * @return {module:model/Order} The populated Order instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new Order(); + + + - - /** - * The Order model module. - * @module model/Order - * @version 1.0.0 - */ - - /** - * Constructs a new Order. - * @alias module:model/Order - * @class - */ - var exports = function() { - var _this = this; - - - - - - - - }; - - /** - * Constructs a Order 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/Order} obj Optional instance to populate. - * @return {module:model/Order} The populated Order instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - - if (data.hasOwnProperty('id')) { - obj['id'] = ApiClient.convertToType(data['id'], 'Number'); - } - if (data.hasOwnProperty('petId')) { - obj['petId'] = ApiClient.convertToType(data['petId'], 'Number'); - } - if (data.hasOwnProperty('quantity')) { - obj['quantity'] = ApiClient.convertToType(data['quantity'], 'Number'); - } - if (data.hasOwnProperty('shipDate')) { - obj['shipDate'] = ApiClient.convertToType(data['shipDate'], 'Date'); - } - if (data.hasOwnProperty('status')) { - obj['status'] = ApiClient.convertToType(data['status'], 'String'); - } - if (data.hasOwnProperty('complete')) { - obj['complete'] = ApiClient.convertToType(data['complete'], 'Boolean'); - } + if (data.hasOwnProperty('id')) { + obj['id'] = ApiClient.convertToType(data['id'], 'Number'); + } + if (data.hasOwnProperty('petId')) { + obj['petId'] = ApiClient.convertToType(data['petId'], 'Number'); + } + if (data.hasOwnProperty('quantity')) { + obj['quantity'] = ApiClient.convertToType(data['quantity'], 'Number'); + } + if (data.hasOwnProperty('shipDate')) { + obj['shipDate'] = ApiClient.convertToType(data['shipDate'], 'Date'); + } + if (data.hasOwnProperty('status')) { + obj['status'] = ApiClient.convertToType(data['status'], 'String'); + } + if (data.hasOwnProperty('complete')) { + obj['complete'] = ApiClient.convertToType(data['complete'], 'Boolean'); + } + } + return obj; } - return obj; - } - /** - * @member {Number} id - */ - exports.prototype['id'] = undefined; - /** - * @member {Number} petId - */ - exports.prototype['petId'] = undefined; - /** - * @member {Number} quantity - */ - exports.prototype['quantity'] = undefined; - /** - * @member {Date} shipDate - */ - exports.prototype['shipDate'] = undefined; - /** - * Order Status - * @member {module:model/Order.StatusEnum} status - */ - exports.prototype['status'] = undefined; - /** - * @member {Boolean} complete - * @default false - */ - exports.prototype['complete'] = false; - - - /** - * Allowed values for the status property. - * @enum {String} - * @readonly - */ - exports.StatusEnum = { /** - * value: "placed" - * @const - */ - "placed": "placed", + * @member {Number} id + */ + id = undefined; /** - * value: "approved" - * @const - */ - "approved": "approved", + * @member {Number} petId + */ + petId = undefined; /** - * value: "delivered" - * @const - */ - "delivered": "delivered" }; + * @member {Number} quantity + */ + quantity = undefined; + /** + * @member {Date} shipDate + */ + shipDate = undefined; + /** + * Order Status + * @member {module:model/Order.StatusEnum} status + */ + status = undefined; + /** + * @member {Boolean} complete + * @default false + */ + complete = false; - return exports; -})); + + + + + /** + * Allowed values for the status property. + * @enum {String} + * @readonly + */ + static StatusEnum = { + + /** + * value: "placed" + * @const + */ + "placed": "placed", + + /** + * value: "approved" + * @const + */ + "approved": "approved", + + /** + * value: "delivered" + * @const + */ + "delivered": "delivered" + }; + + + +} diff --git a/samples/client/petstore/javascript-es6/src/model/OuterBoolean.js b/samples/client/petstore/javascript-es6/src/model/OuterBoolean.js index 96b8b11d1bc..592a0b69864 100644 --- a/samples/client/petstore/javascript-es6/src/model/OuterBoolean.js +++ b/samples/client/petstore/javascript-es6/src/model/OuterBoolean.js @@ -7,68 +7,67 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + + + + +/** +* The OuterBoolean model module. +* @module model/OuterBoolean +* @version 1.0.0 +*/ +export default class OuterBoolean { + /** + * Constructs a new OuterBoolean. + * @alias module:model/OuterBoolean + * @class + */ + + constructor() { + + + + + + + + } - root.SwaggerPetstore.OuterBoolean = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; + /** + * Constructs a OuterBoolean 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/OuterBoolean} obj Optional instance to populate. + * @return {module:model/OuterBoolean} The populated OuterBoolean instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new OuterBoolean(); + + + - - /** - * The OuterBoolean model module. - * @module model/OuterBoolean - * @version 1.0.0 - */ - - /** - * Constructs a new OuterBoolean. - * @alias module:model/OuterBoolean - * @class - */ - var exports = function() { - var _this = this; - - }; - - /** - * Constructs a OuterBoolean 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/OuterBoolean} obj Optional instance to populate. - * @return {module:model/OuterBoolean} The populated OuterBoolean instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - + } + return obj; } - return obj; - } - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-es6/src/model/OuterComposite.js b/samples/client/petstore/javascript-es6/src/model/OuterComposite.js index 14e7775588b..327e303467a 100644 --- a/samples/client/petstore/javascript-es6/src/model/OuterComposite.js +++ b/samples/client/petstore/javascript-es6/src/model/OuterComposite.js @@ -7,92 +7,91 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(function(root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['ApiClient', 'model/OuterBoolean', 'model/OuterNumber', 'model/OuterString'], factory); - } else if (typeof module === 'object' && module.exports) { - // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('../ApiClient'), require('./OuterBoolean'), require('./OuterNumber'), require('./OuterString')); - } else { - // Browser globals (root is window) - if (!root.SwaggerPetstore) { - root.SwaggerPetstore = {}; + +import ApiClient from '../ApiClient'; +import OuterBoolean from './OuterBoolean'; +import OuterNumber from './OuterNumber'; +import OuterString from './OuterString'; + + + + + +/** +* The OuterComposite model module. +* @module model/OuterComposite +* @version 1.0.0 +*/ +export default class OuterComposite { + /** + * Constructs a new OuterComposite. + * @alias module:model/OuterComposite + * @class + */ + + constructor() { + + + + + + + + } - root.SwaggerPetstore.OuterComposite = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.OuterBoolean, root.SwaggerPetstore.OuterNumber, root.SwaggerPetstore.OuterString); - } -}(this, function(ApiClient, OuterBoolean, OuterNumber, OuterString) { - 'use strict'; + /** + * Constructs a OuterComposite 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/OuterComposite} obj Optional instance to populate. + * @return {module:model/OuterComposite} The populated OuterComposite instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new OuterComposite(); + + + - - /** - * The OuterComposite model module. - * @module model/OuterComposite - * @version 1.0.0 - */ - - /** - * Constructs a new OuterComposite. - * @alias module:model/OuterComposite - * @class - */ - var exports = function() { - var _this = this; - - - - - }; - - /** - * Constructs a OuterComposite 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/OuterComposite} obj Optional instance to populate. - * @return {module:model/OuterComposite} The populated OuterComposite instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - - if (data.hasOwnProperty('my_number')) { - obj['my_number'] = OuterNumber.constructFromObject(data['my_number']); - } - if (data.hasOwnProperty('my_string')) { - obj['my_string'] = OuterString.constructFromObject(data['my_string']); - } - if (data.hasOwnProperty('my_boolean')) { - obj['my_boolean'] = OuterBoolean.constructFromObject(data['my_boolean']); - } + if (data.hasOwnProperty('my_number')) { + obj['my_number'] = OuterNumber.constructFromObject(data['my_number']); + } + if (data.hasOwnProperty('my_string')) { + obj['my_string'] = OuterString.constructFromObject(data['my_string']); + } + if (data.hasOwnProperty('my_boolean')) { + obj['my_boolean'] = OuterBoolean.constructFromObject(data['my_boolean']); + } + } + return obj; } - return obj; - } - /** - * @member {module:model/OuterNumber} my_number - */ - exports.prototype['my_number'] = undefined; - /** - * @member {module:model/OuterString} my_string - */ - exports.prototype['my_string'] = undefined; - /** - * @member {module:model/OuterBoolean} my_boolean - */ - exports.prototype['my_boolean'] = undefined; + /** + * @member {module:model/OuterNumber} my_number + */ + my_number = undefined; + /** + * @member {module:model/OuterString} my_string + */ + my_string = undefined; + /** + * @member {module:model/OuterBoolean} my_boolean + */ + my_boolean = undefined; - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-es6/src/model/OuterEnum.js b/samples/client/petstore/javascript-es6/src/model/OuterEnum.js index cdd43098369..bf264fd8f64 100644 --- a/samples/client/petstore/javascript-es6/src/model/OuterEnum.js +++ b/samples/client/petstore/javascript-es6/src/model/OuterEnum.js @@ -7,63 +7,51 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + +/** +* Enum class OuterEnum. +* @enum {} +* @readonly +*/ +export default class OuterEnum { + + /** + * value: "placed" + * @const + */ + placed = "placed"; + + + /** + * value: "approved" + * @const + */ + approved = "approved"; + + + /** + * value: "delivered" + * @const + */ + delivered = "delivered"; + + + + /** + * Returns a OuterEnum enum value from a Javascript object name. + * @param {Object} data The plain JavaScript object containing the name of the enum value. + * @return {module:model/OuterEnum} The enum OuterEnum value. + */ + static constructFromObject(object) { + return object; } - root.SwaggerPetstore.OuterEnum = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; - - - /** - * Enum class OuterEnum. - * @enum {} - * @readonly - */ - var exports = { - /** - * value: "placed" - * @const - */ - "placed": "placed", - /** - * value: "approved" - * @const - */ - "approved": "approved", - /** - * value: "delivered" - * @const - */ - "delivered": "delivered" }; - - /** - * Returns a OuterEnum enum value from a Javascript object name. - * @param {Object} data The plain JavaScript object containing the name of the enum value. - * @return {module:model/OuterEnum} The enum OuterEnum value. - */ - exports.constructFromObject = function(object) { - return object; - } - - return exports; -})); +} diff --git a/samples/client/petstore/javascript-es6/src/model/OuterNumber.js b/samples/client/petstore/javascript-es6/src/model/OuterNumber.js index 1128dcb8afe..ff65b1588b7 100644 --- a/samples/client/petstore/javascript-es6/src/model/OuterNumber.js +++ b/samples/client/petstore/javascript-es6/src/model/OuterNumber.js @@ -7,68 +7,67 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + + + + +/** +* The OuterNumber model module. +* @module model/OuterNumber +* @version 1.0.0 +*/ +export default class OuterNumber { + /** + * Constructs a new OuterNumber. + * @alias module:model/OuterNumber + * @class + */ + + constructor() { + + + + + + + + } - root.SwaggerPetstore.OuterNumber = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; + /** + * Constructs a OuterNumber 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/OuterNumber} obj Optional instance to populate. + * @return {module:model/OuterNumber} The populated OuterNumber instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new OuterNumber(); + + + - - /** - * The OuterNumber model module. - * @module model/OuterNumber - * @version 1.0.0 - */ - - /** - * Constructs a new OuterNumber. - * @alias module:model/OuterNumber - * @class - */ - var exports = function() { - var _this = this; - - }; - - /** - * Constructs a OuterNumber 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/OuterNumber} obj Optional instance to populate. - * @return {module:model/OuterNumber} The populated OuterNumber instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - + } + return obj; } - return obj; - } - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-es6/src/model/OuterString.js b/samples/client/petstore/javascript-es6/src/model/OuterString.js index 3a012fbb0c9..6921029ede1 100644 --- a/samples/client/petstore/javascript-es6/src/model/OuterString.js +++ b/samples/client/petstore/javascript-es6/src/model/OuterString.js @@ -7,68 +7,67 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + + + + +/** +* The OuterString model module. +* @module model/OuterString +* @version 1.0.0 +*/ +export default class OuterString { + /** + * Constructs a new OuterString. + * @alias module:model/OuterString + * @class + */ + + constructor() { + + + + + + + + } - root.SwaggerPetstore.OuterString = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; + /** + * Constructs a OuterString 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/OuterString} obj Optional instance to populate. + * @return {module:model/OuterString} The populated OuterString instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new OuterString(); + + + - - /** - * The OuterString model module. - * @module model/OuterString - * @version 1.0.0 - */ - - /** - * Constructs a new OuterString. - * @alias module:model/OuterString - * @class - */ - var exports = function() { - var _this = this; - - }; - - /** - * Constructs a OuterString 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/OuterString} obj Optional instance to populate. - * @return {module:model/OuterString} The populated OuterString instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - + } + return obj; } - return obj; - } - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-es6/src/model/Pet.js b/samples/client/petstore/javascript-es6/src/model/Pet.js index 7edd65724ba..bb849152027 100644 --- a/samples/client/petstore/javascript-es6/src/model/Pet.js +++ b/samples/client/petstore/javascript-es6/src/model/Pet.js @@ -7,141 +7,140 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(function(root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['ApiClient', 'model/Category', 'model/Tag'], factory); - } else if (typeof module === 'object' && module.exports) { - // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('../ApiClient'), require('./Category'), require('./Tag')); - } else { - // Browser globals (root is window) - if (!root.SwaggerPetstore) { - root.SwaggerPetstore = {}; + +import ApiClient from '../ApiClient'; +import Category from './Category'; +import Tag from './Tag'; + + + + + +/** +* The Pet model module. +* @module model/Pet +* @version 1.0.0 +*/ +export default class Pet { + /** + * Constructs a new Pet. + * @alias module:model/Pet + * @class + * @param name {String} + * @param photoUrls {Array.} + */ + + constructor(name, photoUrls) { + + + + + + this['name'] = name;this['photoUrls'] = photoUrls; + + } - root.SwaggerPetstore.Pet = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.Category, root.SwaggerPetstore.Tag); - } -}(this, function(ApiClient, Category, Tag) { - 'use strict'; + /** + * Constructs a Pet 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/Pet} obj Optional instance to populate. + * @return {module:model/Pet} The populated Pet instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new Pet(); + + + - - /** - * The Pet model module. - * @module model/Pet - * @version 1.0.0 - */ - - /** - * Constructs a new Pet. - * @alias module:model/Pet - * @class - * @param name {String} - * @param photoUrls {Array.} - */ - var exports = function(name, photoUrls) { - var _this = this; - - - - _this['name'] = name; - _this['photoUrls'] = photoUrls; - - - }; - - /** - * Constructs a Pet 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/Pet} obj Optional instance to populate. - * @return {module:model/Pet} The populated Pet instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - - if (data.hasOwnProperty('id')) { - obj['id'] = ApiClient.convertToType(data['id'], 'Number'); - } - if (data.hasOwnProperty('category')) { - obj['category'] = Category.constructFromObject(data['category']); - } - if (data.hasOwnProperty('name')) { - obj['name'] = ApiClient.convertToType(data['name'], 'String'); - } - if (data.hasOwnProperty('photoUrls')) { - obj['photoUrls'] = ApiClient.convertToType(data['photoUrls'], ['String']); - } - if (data.hasOwnProperty('tags')) { - obj['tags'] = ApiClient.convertToType(data['tags'], [Tag]); - } - if (data.hasOwnProperty('status')) { - obj['status'] = ApiClient.convertToType(data['status'], 'String'); - } + if (data.hasOwnProperty('id')) { + obj['id'] = ApiClient.convertToType(data['id'], 'Number'); + } + if (data.hasOwnProperty('category')) { + obj['category'] = Category.constructFromObject(data['category']); + } + if (data.hasOwnProperty('name')) { + obj['name'] = ApiClient.convertToType(data['name'], 'String'); + } + if (data.hasOwnProperty('photoUrls')) { + obj['photoUrls'] = ApiClient.convertToType(data['photoUrls'], ['String']); + } + if (data.hasOwnProperty('tags')) { + obj['tags'] = ApiClient.convertToType(data['tags'], [Tag]); + } + if (data.hasOwnProperty('status')) { + obj['status'] = ApiClient.convertToType(data['status'], 'String'); + } + } + return obj; } - return obj; - } - /** - * @member {Number} id - */ - exports.prototype['id'] = undefined; - /** - * @member {module:model/Category} category - */ - exports.prototype['category'] = undefined; - /** - * @member {String} name - */ - exports.prototype['name'] = undefined; - /** - * @member {Array.} photoUrls - */ - exports.prototype['photoUrls'] = undefined; - /** - * @member {Array.} tags - */ - exports.prototype['tags'] = undefined; - /** - * pet status in the store - * @member {module:model/Pet.StatusEnum} status - */ - exports.prototype['status'] = undefined; - - - /** - * Allowed values for the status property. - * @enum {String} - * @readonly - */ - exports.StatusEnum = { /** - * value: "available" - * @const - */ - "available": "available", + * @member {Number} id + */ + id = undefined; /** - * value: "pending" - * @const - */ - "pending": "pending", + * @member {module:model/Category} category + */ + category = undefined; /** - * value: "sold" - * @const - */ - "sold": "sold" }; + * @member {String} name + */ + name = undefined; + /** + * @member {Array.} photoUrls + */ + photoUrls = undefined; + /** + * @member {Array.} tags + */ + tags = undefined; + /** + * pet status in the store + * @member {module:model/Pet.StatusEnum} status + */ + status = undefined; - return exports; -})); + + + + + /** + * Allowed values for the status property. + * @enum {String} + * @readonly + */ + static StatusEnum = { + + /** + * value: "available" + * @const + */ + "available": "available", + + /** + * value: "pending" + * @const + */ + "pending": "pending", + + /** + * value: "sold" + * @const + */ + "sold": "sold" + }; + + + +} diff --git a/samples/client/petstore/javascript-es6/src/model/ReadOnlyFirst.js b/samples/client/petstore/javascript-es6/src/model/ReadOnlyFirst.js index f6f0064fd96..143b34f3eb1 100644 --- a/samples/client/petstore/javascript-es6/src/model/ReadOnlyFirst.js +++ b/samples/client/petstore/javascript-es6/src/model/ReadOnlyFirst.js @@ -7,84 +7,81 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + + + + +/** +* The ReadOnlyFirst model module. +* @module model/ReadOnlyFirst +* @version 1.0.0 +*/ +export default class ReadOnlyFirst { + /** + * Constructs a new ReadOnlyFirst. + * @alias module:model/ReadOnlyFirst + * @class + */ + + constructor() { + + + + + + + + } - root.SwaggerPetstore.ReadOnlyFirst = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; + /** + * 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. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new ReadOnlyFirst(); + + + - - /** - * 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'); - } + if (data.hasOwnProperty('bar')) { + obj['bar'] = ApiClient.convertToType(data['bar'], 'String'); + } + if (data.hasOwnProperty('baz')) { + obj['baz'] = ApiClient.convertToType(data['baz'], 'String'); + } + } + return obj; } - return obj; - } - /** - * @member {String} bar - */ - exports.prototype['bar'] = undefined; - /** - * @member {String} baz - */ - exports.prototype['baz'] = undefined; + /** + * @member {String} bar + */ + bar = undefined; + /** + * @member {String} baz + */ + baz = undefined; - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-es6/src/model/SpecialModelName.js b/samples/client/petstore/javascript-es6/src/model/SpecialModelName.js index 921a1e87379..4e0dd379b19 100644 --- a/samples/client/petstore/javascript-es6/src/model/SpecialModelName.js +++ b/samples/client/petstore/javascript-es6/src/model/SpecialModelName.js @@ -7,76 +7,74 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + + + + +/** +* The SpecialModelName model module. +* @module model/SpecialModelName +* @version 1.0.0 +*/ +export default class SpecialModelName { + /** + * Constructs a new SpecialModelName. + * @alias module:model/SpecialModelName + * @class + */ + + constructor() { + + + + + + + + } - root.SwaggerPetstore.SpecialModelName = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; + /** + * Constructs a SpecialModelName 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/SpecialModelName} obj Optional instance to populate. + * @return {module:model/SpecialModelName} The populated SpecialModelName instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new SpecialModelName(); + + + - - /** - * The SpecialModelName model module. - * @module model/SpecialModelName - * @version 1.0.0 - */ - - /** - * Constructs a new SpecialModelName. - * @alias module:model/SpecialModelName - * @class - */ - var exports = function() { - var _this = this; - - - }; - - /** - * Constructs a SpecialModelName 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/SpecialModelName} obj Optional instance to populate. - * @return {module:model/SpecialModelName} The populated SpecialModelName instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - - if (data.hasOwnProperty('$special[property.name]')) { - obj['$special[property.name]'] = ApiClient.convertToType(data['$special[property.name]'], 'Number'); - } + if (data.hasOwnProperty('$special[property.name]')) { + obj['$special[property.name]'] = ApiClient.convertToType(data['$special[property.name]'], 'Number'); + } + } + return obj; } - return obj; - } - /** - * @member {Number} $special[property.name] - */ - exports.prototype['$special[property.name]'] = undefined; + /** + * @member {Number} $special[property.name] + */ + $special[property.name] = undefined; - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-es6/src/model/Tag.js b/samples/client/petstore/javascript-es6/src/model/Tag.js index 6308751e08f..759b3fa04e3 100644 --- a/samples/client/petstore/javascript-es6/src/model/Tag.js +++ b/samples/client/petstore/javascript-es6/src/model/Tag.js @@ -7,84 +7,81 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + + + + +/** +* The Tag model module. +* @module model/Tag +* @version 1.0.0 +*/ +export default class Tag { + /** + * Constructs a new Tag. + * @alias module:model/Tag + * @class + */ + + constructor() { + + + + + + + + } - root.SwaggerPetstore.Tag = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; + /** + * Constructs a Tag 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/Tag} obj Optional instance to populate. + * @return {module:model/Tag} The populated Tag instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new Tag(); + + + - - /** - * The Tag model module. - * @module model/Tag - * @version 1.0.0 - */ - - /** - * Constructs a new Tag. - * @alias module:model/Tag - * @class - */ - var exports = function() { - var _this = this; - - - - }; - - /** - * Constructs a Tag 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/Tag} obj Optional instance to populate. - * @return {module:model/Tag} The populated Tag instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - - if (data.hasOwnProperty('id')) { - obj['id'] = ApiClient.convertToType(data['id'], 'Number'); - } - if (data.hasOwnProperty('name')) { - obj['name'] = ApiClient.convertToType(data['name'], 'String'); - } + if (data.hasOwnProperty('id')) { + obj['id'] = ApiClient.convertToType(data['id'], 'Number'); + } + if (data.hasOwnProperty('name')) { + obj['name'] = ApiClient.convertToType(data['name'], 'String'); + } + } + return obj; } - return obj; - } - /** - * @member {Number} id - */ - exports.prototype['id'] = undefined; - /** - * @member {String} name - */ - exports.prototype['name'] = undefined; + /** + * @member {Number} id + */ + id = undefined; + /** + * @member {String} name + */ + name = undefined; - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-es6/src/model/User.js b/samples/client/petstore/javascript-es6/src/model/User.js index 1d251e22b3c..36311e75938 100644 --- a/samples/client/petstore/javascript-es6/src/model/User.js +++ b/samples/client/petstore/javascript-es6/src/model/User.js @@ -7,133 +7,124 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + + + + +/** +* The User model module. +* @module model/User +* @version 1.0.0 +*/ +export default class User { + /** + * Constructs a new User. + * @alias module:model/User + * @class + */ + + constructor() { + + + + + + + + } - root.SwaggerPetstore.User = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; + /** + * Constructs a User 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/User} obj Optional instance to populate. + * @return {module:model/User} The populated User instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new User(); + + + - - /** - * The User model module. - * @module model/User - * @version 1.0.0 - */ - - /** - * Constructs a new User. - * @alias module:model/User - * @class - */ - var exports = function() { - var _this = this; - - - - - - - - - - }; - - /** - * Constructs a User 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/User} obj Optional instance to populate. - * @return {module:model/User} The populated User instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - - if (data.hasOwnProperty('id')) { - obj['id'] = ApiClient.convertToType(data['id'], 'Number'); - } - if (data.hasOwnProperty('username')) { - obj['username'] = ApiClient.convertToType(data['username'], 'String'); - } - if (data.hasOwnProperty('firstName')) { - obj['firstName'] = ApiClient.convertToType(data['firstName'], 'String'); - } - if (data.hasOwnProperty('lastName')) { - obj['lastName'] = ApiClient.convertToType(data['lastName'], 'String'); - } - if (data.hasOwnProperty('email')) { - obj['email'] = ApiClient.convertToType(data['email'], 'String'); - } - if (data.hasOwnProperty('password')) { - obj['password'] = ApiClient.convertToType(data['password'], 'String'); - } - if (data.hasOwnProperty('phone')) { - obj['phone'] = ApiClient.convertToType(data['phone'], 'String'); - } - if (data.hasOwnProperty('userStatus')) { - obj['userStatus'] = ApiClient.convertToType(data['userStatus'], 'Number'); - } + if (data.hasOwnProperty('id')) { + obj['id'] = ApiClient.convertToType(data['id'], 'Number'); + } + if (data.hasOwnProperty('username')) { + obj['username'] = ApiClient.convertToType(data['username'], 'String'); + } + if (data.hasOwnProperty('firstName')) { + obj['firstName'] = ApiClient.convertToType(data['firstName'], 'String'); + } + if (data.hasOwnProperty('lastName')) { + obj['lastName'] = ApiClient.convertToType(data['lastName'], 'String'); + } + if (data.hasOwnProperty('email')) { + obj['email'] = ApiClient.convertToType(data['email'], 'String'); + } + if (data.hasOwnProperty('password')) { + obj['password'] = ApiClient.convertToType(data['password'], 'String'); + } + if (data.hasOwnProperty('phone')) { + obj['phone'] = ApiClient.convertToType(data['phone'], 'String'); + } + if (data.hasOwnProperty('userStatus')) { + obj['userStatus'] = ApiClient.convertToType(data['userStatus'], 'Number'); + } + } + return obj; } - return obj; - } - /** - * @member {Number} id - */ - exports.prototype['id'] = undefined; - /** - * @member {String} username - */ - exports.prototype['username'] = undefined; - /** - * @member {String} firstName - */ - exports.prototype['firstName'] = undefined; - /** - * @member {String} lastName - */ - exports.prototype['lastName'] = undefined; - /** - * @member {String} email - */ - exports.prototype['email'] = undefined; - /** - * @member {String} password - */ - exports.prototype['password'] = undefined; - /** - * @member {String} phone - */ - exports.prototype['phone'] = undefined; - /** - * User Status - * @member {Number} userStatus - */ - exports.prototype['userStatus'] = undefined; + /** + * @member {Number} id + */ + id = undefined; + /** + * @member {String} username + */ + username = undefined; + /** + * @member {String} firstName + */ + firstName = undefined; + /** + * @member {String} lastName + */ + lastName = undefined; + /** + * @member {String} email + */ + email = undefined; + /** + * @member {String} password + */ + password = undefined; + /** + * @member {String} phone + */ + phone = undefined; + /** + * User Status + * @member {Number} userStatus + */ + userStatus = undefined; - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-promise-es6/README.md b/samples/client/petstore/javascript-promise-es6/README.md index df887522c96..b6ceec1bbdd 100644 --- a/samples/client/petstore/javascript-promise-es6/README.md +++ b/samples/client/petstore/javascript-promise-es6/README.md @@ -79,6 +79,7 @@ Class | Method | HTTP request | Description *SwaggerPetstore.FakeApi* | [**testClientModel**](docs/FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model *SwaggerPetstore.FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *SwaggerPetstore.FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters +*SwaggerPetstore.FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data *SwaggerPetstore.Fake_classname_tags123Api* | [**testClassname**](docs/Fake_classname_tags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case *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 diff --git a/samples/client/petstore/javascript-promise-es6/docs/FakeApi.md b/samples/client/petstore/javascript-promise-es6/docs/FakeApi.md index 7bfea4df889..e48b5a77282 100644 --- a/samples/client/petstore/javascript-promise-es6/docs/FakeApi.md +++ b/samples/client/petstore/javascript-promise-es6/docs/FakeApi.md @@ -11,6 +11,7 @@ Method | HTTP request | Description [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters +[**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data @@ -23,16 +24,16 @@ Test serialization of outer boolean types ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); +import SwaggerPetstore from 'swagger_petstore'; -var apiInstance = new SwaggerPetstore.FakeApi(); +let apiInstance = new SwaggerPetstore.FakeApi(); -var opts = { +let opts = { 'body': new SwaggerPetstore.OuterBoolean() // OuterBoolean | Input boolean as post body }; -apiInstance.fakeOuterBooleanSerialize(opts).then(function(data) { +apiInstance.fakeOuterBooleanSerialize(opts).then((data) => { console.log('API called successfully. Returned data: ' + data); -}, function(error) { +}, (error) => { console.error(error); }); @@ -67,16 +68,16 @@ Test serialization of object with outer number type ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); +import SwaggerPetstore from 'swagger_petstore'; -var apiInstance = new SwaggerPetstore.FakeApi(); +let apiInstance = new SwaggerPetstore.FakeApi(); -var opts = { +let opts = { 'body': new SwaggerPetstore.OuterComposite() // OuterComposite | Input composite as post body }; -apiInstance.fakeOuterCompositeSerialize(opts).then(function(data) { +apiInstance.fakeOuterCompositeSerialize(opts).then((data) => { console.log('API called successfully. Returned data: ' + data); -}, function(error) { +}, (error) => { console.error(error); }); @@ -111,16 +112,16 @@ Test serialization of outer number types ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); +import SwaggerPetstore from 'swagger_petstore'; -var apiInstance = new SwaggerPetstore.FakeApi(); +let apiInstance = new SwaggerPetstore.FakeApi(); -var opts = { +let opts = { 'body': new SwaggerPetstore.OuterNumber() // OuterNumber | Input number as post body }; -apiInstance.fakeOuterNumberSerialize(opts).then(function(data) { +apiInstance.fakeOuterNumberSerialize(opts).then((data) => { console.log('API called successfully. Returned data: ' + data); -}, function(error) { +}, (error) => { console.error(error); }); @@ -155,16 +156,16 @@ Test serialization of outer string types ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); +import SwaggerPetstore from 'swagger_petstore'; -var apiInstance = new SwaggerPetstore.FakeApi(); +let apiInstance = new SwaggerPetstore.FakeApi(); -var opts = { +let opts = { 'body': new SwaggerPetstore.OuterString() // OuterString | Input string as post body }; -apiInstance.fakeOuterStringSerialize(opts).then(function(data) { +apiInstance.fakeOuterStringSerialize(opts).then((data) => { console.log('API called successfully. Returned data: ' + data); -}, function(error) { +}, (error) => { console.error(error); }); @@ -199,15 +200,15 @@ To test \"client\" model ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); +import SwaggerPetstore from 'swagger_petstore'; -var apiInstance = new SwaggerPetstore.FakeApi(); +let apiInstance = new SwaggerPetstore.FakeApi(); -var body = new SwaggerPetstore.Client(); // Client | client model +let body = new SwaggerPetstore.Client(); // Client | client model -apiInstance.testClientModel(body).then(function(data) { +apiInstance.testClientModel(body).then((data) => { console.log('API called successfully. Returned data: ' + data); -}, function(error) { +}, (error) => { console.error(error); }); @@ -242,25 +243,25 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); -var defaultClient = SwaggerPetstore.ApiClient.instance; +import SwaggerPetstore from 'swagger_petstore'; +let defaultClient = SwaggerPetstore.ApiClient.instance; // Configure HTTP basic authorization: http_basic_test -var http_basic_test = defaultClient.authentications['http_basic_test']; +let http_basic_test = defaultClient.authentications['http_basic_test']; http_basic_test.username = 'YOUR USERNAME'; http_basic_test.password = 'YOUR PASSWORD'; -var apiInstance = new SwaggerPetstore.FakeApi(); +let apiInstance = new SwaggerPetstore.FakeApi(); -var _number = 3.4; // Number | None +let _number = 3.4; // Number | None -var _double = 1.2; // Number | None +let _double = 1.2; // Number | None -var patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None +let patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None -var _byte = B; // Blob | None +let _byte = B; // Blob | None -var opts = { +let opts = { 'integer': 56, // Number | None 'int32': 56, // Number | None 'int64': 789, // Number | None @@ -272,9 +273,9 @@ var opts = { 'password': "password_example", // String | None 'callback': "callback_example" // String | None }; -apiInstance.testEndpointParameters(_number, _double, patternWithoutDelimiter, _byte, opts).then(function() { +apiInstance.testEndpointParameters(_number, _double, patternWithoutDelimiter, _byte, opts).then(() => { console.log('API called successfully.'); -}, function(error) { +}, (error) => { console.error(error); }); @@ -322,11 +323,11 @@ To test enum parameters ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); +import SwaggerPetstore from 'swagger_petstore'; -var apiInstance = new SwaggerPetstore.FakeApi(); +let apiInstance = new SwaggerPetstore.FakeApi(); -var opts = { +let opts = { 'enumFormStringArray': ["enumFormStringArray_example"], // [String] | Form parameter enum test (string array) 'enumFormString': "-efg", // String | Form parameter enum test (string) 'enumHeaderStringArray': ["enumHeaderStringArray_example"], // [String] | Header parameter enum test (string array) @@ -336,9 +337,9 @@ var opts = { 'enumQueryInteger': 56, // Number | Query parameter enum test (double) 'enumQueryDouble': 1.2 // Number | Query parameter enum test (double) }; -apiInstance.testEnumParameters(opts).then(function() { +apiInstance.testEnumParameters(opts).then(() => { console.log('API called successfully.'); -}, function(error) { +}, (error) => { console.error(error); }); @@ -370,3 +371,49 @@ No authorization required - **Content-Type**: */* - **Accept**: */* + +# **testJsonFormData** +> testJsonFormData(param, param2) + +test json serialization of form data + + + +### Example +```javascript +import SwaggerPetstore from 'swagger_petstore'; + +let apiInstance = new SwaggerPetstore.FakeApi(); + +let param = "param_example"; // String | field1 + +let param2 = "param2_example"; // String | field2 + +apiInstance.testJsonFormData(param, param2).then(() => { + console.log('API called successfully.'); +}, (error) => { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | **String**| field1 | + **param2** | **String**| field2 | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + diff --git a/samples/client/petstore/javascript-promise-es6/docs/Fake_classname_tags123Api.md b/samples/client/petstore/javascript-promise-es6/docs/Fake_classname_tags123Api.md index 6ba27ee832f..44a60363364 100644 --- a/samples/client/petstore/javascript-promise-es6/docs/Fake_classname_tags123Api.md +++ b/samples/client/petstore/javascript-promise-es6/docs/Fake_classname_tags123Api.md @@ -15,15 +15,15 @@ To test class name in snake case ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); +import SwaggerPetstore from 'swagger_petstore'; -var apiInstance = new SwaggerPetstore.Fake_classname_tags123Api(); +let apiInstance = new SwaggerPetstore.Fake_classname_tags123Api(); -var body = new SwaggerPetstore.Client(); // Client | client model +let body = new SwaggerPetstore.Client(); // Client | client model -apiInstance.testClassname(body).then(function(data) { +apiInstance.testClassname(body).then((data) => { console.log('API called successfully. Returned data: ' + data); -}, function(error) { +}, (error) => { console.error(error); }); diff --git a/samples/client/petstore/javascript-promise-es6/docs/PetApi.md b/samples/client/petstore/javascript-promise-es6/docs/PetApi.md index 8b88dab5f5c..1d5d78f6d7a 100644 --- a/samples/client/petstore/javascript-promise-es6/docs/PetApi.md +++ b/samples/client/petstore/javascript-promise-es6/docs/PetApi.md @@ -24,20 +24,20 @@ Add a new pet to the store ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); -var defaultClient = SwaggerPetstore.ApiClient.instance; +import SwaggerPetstore from 'swagger_petstore'; +let defaultClient = SwaggerPetstore.ApiClient.instance; // Configure OAuth2 access token for authorization: petstore_auth -var petstore_auth = defaultClient.authentications['petstore_auth']; +let petstore_auth = defaultClient.authentications['petstore_auth']; petstore_auth.accessToken = 'YOUR ACCESS TOKEN'; -var apiInstance = new SwaggerPetstore.PetApi(); +let apiInstance = new SwaggerPetstore.PetApi(); -var body = new SwaggerPetstore.Pet(); // Pet | Pet object that needs to be added to the store +let body = new SwaggerPetstore.Pet(); // Pet | Pet object that needs to be added to the store -apiInstance.addPet(body).then(function() { +apiInstance.addPet(body).then(() => { console.log('API called successfully.'); -}, function(error) { +}, (error) => { console.error(error); }); @@ -72,23 +72,23 @@ Deletes a pet ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); -var defaultClient = SwaggerPetstore.ApiClient.instance; +import SwaggerPetstore from 'swagger_petstore'; +let defaultClient = SwaggerPetstore.ApiClient.instance; // Configure OAuth2 access token for authorization: petstore_auth -var petstore_auth = defaultClient.authentications['petstore_auth']; +let petstore_auth = defaultClient.authentications['petstore_auth']; petstore_auth.accessToken = 'YOUR ACCESS TOKEN'; -var apiInstance = new SwaggerPetstore.PetApi(); +let apiInstance = new SwaggerPetstore.PetApi(); -var petId = 789; // Number | Pet id to delete +let petId = 789; // Number | Pet id to delete -var opts = { +let opts = { 'apiKey': "apiKey_example" // String | }; -apiInstance.deletePet(petId, opts).then(function() { +apiInstance.deletePet(petId, opts).then(() => { console.log('API called successfully.'); -}, function(error) { +}, (error) => { console.error(error); }); @@ -124,20 +124,20 @@ Multiple status values can be provided with comma separated strings ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); -var defaultClient = SwaggerPetstore.ApiClient.instance; +import SwaggerPetstore from 'swagger_petstore'; +let defaultClient = SwaggerPetstore.ApiClient.instance; // Configure OAuth2 access token for authorization: petstore_auth -var petstore_auth = defaultClient.authentications['petstore_auth']; +let petstore_auth = defaultClient.authentications['petstore_auth']; petstore_auth.accessToken = 'YOUR ACCESS TOKEN'; -var apiInstance = new SwaggerPetstore.PetApi(); +let apiInstance = new SwaggerPetstore.PetApi(); -var status = ["status_example"]; // [String] | Status values that need to be considered for filter +let status = ["status_example"]; // [String] | Status values that need to be considered for filter -apiInstance.findPetsByStatus(status).then(function(data) { +apiInstance.findPetsByStatus(status).then((data) => { console.log('API called successfully. Returned data: ' + data); -}, function(error) { +}, (error) => { console.error(error); }); @@ -172,20 +172,20 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); -var defaultClient = SwaggerPetstore.ApiClient.instance; +import SwaggerPetstore from 'swagger_petstore'; +let defaultClient = SwaggerPetstore.ApiClient.instance; // Configure OAuth2 access token for authorization: petstore_auth -var petstore_auth = defaultClient.authentications['petstore_auth']; +let petstore_auth = defaultClient.authentications['petstore_auth']; petstore_auth.accessToken = 'YOUR ACCESS TOKEN'; -var apiInstance = new SwaggerPetstore.PetApi(); +let apiInstance = new SwaggerPetstore.PetApi(); -var tags = ["tags_example"]; // [String] | Tags to filter by +let tags = ["tags_example"]; // [String] | Tags to filter by -apiInstance.findPetsByTags(tags).then(function(data) { +apiInstance.findPetsByTags(tags).then((data) => { console.log('API called successfully. Returned data: ' + data); -}, function(error) { +}, (error) => { console.error(error); }); @@ -220,22 +220,22 @@ Returns a single pet ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); -var defaultClient = SwaggerPetstore.ApiClient.instance; +import SwaggerPetstore from 'swagger_petstore'; +let defaultClient = SwaggerPetstore.ApiClient.instance; // Configure API key authorization: api_key -var api_key = defaultClient.authentications['api_key']; +let api_key = defaultClient.authentications['api_key']; api_key.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //api_key.apiKeyPrefix = 'Token'; -var apiInstance = new SwaggerPetstore.PetApi(); +let apiInstance = new SwaggerPetstore.PetApi(); -var petId = 789; // Number | ID of pet to return +let petId = 789; // Number | ID of pet to return -apiInstance.getPetById(petId).then(function(data) { +apiInstance.getPetById(petId).then((data) => { console.log('API called successfully. Returned data: ' + data); -}, function(error) { +}, (error) => { console.error(error); }); @@ -270,20 +270,20 @@ Update an existing pet ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); -var defaultClient = SwaggerPetstore.ApiClient.instance; +import SwaggerPetstore from 'swagger_petstore'; +let defaultClient = SwaggerPetstore.ApiClient.instance; // Configure OAuth2 access token for authorization: petstore_auth -var petstore_auth = defaultClient.authentications['petstore_auth']; +let petstore_auth = defaultClient.authentications['petstore_auth']; petstore_auth.accessToken = 'YOUR ACCESS TOKEN'; -var apiInstance = new SwaggerPetstore.PetApi(); +let apiInstance = new SwaggerPetstore.PetApi(); -var body = new SwaggerPetstore.Pet(); // Pet | Pet object that needs to be added to the store +let body = new SwaggerPetstore.Pet(); // Pet | Pet object that needs to be added to the store -apiInstance.updatePet(body).then(function() { +apiInstance.updatePet(body).then(() => { console.log('API called successfully.'); -}, function(error) { +}, (error) => { console.error(error); }); @@ -318,24 +318,24 @@ Updates a pet in the store with form data ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); -var defaultClient = SwaggerPetstore.ApiClient.instance; +import SwaggerPetstore from 'swagger_petstore'; +let defaultClient = SwaggerPetstore.ApiClient.instance; // Configure OAuth2 access token for authorization: petstore_auth -var petstore_auth = defaultClient.authentications['petstore_auth']; +let petstore_auth = defaultClient.authentications['petstore_auth']; petstore_auth.accessToken = 'YOUR ACCESS TOKEN'; -var apiInstance = new SwaggerPetstore.PetApi(); +let apiInstance = new SwaggerPetstore.PetApi(); -var petId = 789; // Number | ID of pet that needs to be updated +let petId = 789; // Number | ID of pet that needs to be updated -var opts = { +let opts = { 'name': "name_example", // String | Updated name of the pet 'status': "status_example" // String | Updated status of the pet }; -apiInstance.updatePetWithForm(petId, opts).then(function() { +apiInstance.updatePetWithForm(petId, opts).then(() => { console.log('API called successfully.'); -}, function(error) { +}, (error) => { console.error(error); }); @@ -372,24 +372,24 @@ uploads an image ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); -var defaultClient = SwaggerPetstore.ApiClient.instance; +import SwaggerPetstore from 'swagger_petstore'; +let defaultClient = SwaggerPetstore.ApiClient.instance; // Configure OAuth2 access token for authorization: petstore_auth -var petstore_auth = defaultClient.authentications['petstore_auth']; +let petstore_auth = defaultClient.authentications['petstore_auth']; petstore_auth.accessToken = 'YOUR ACCESS TOKEN'; -var apiInstance = new SwaggerPetstore.PetApi(); +let apiInstance = new SwaggerPetstore.PetApi(); -var petId = 789; // Number | ID of pet to update +let petId = 789; // Number | ID of pet to update -var opts = { +let opts = { 'additionalMetadata': "additionalMetadata_example", // String | Additional data to pass to server 'file': "/path/to/file.txt" // File | file to upload }; -apiInstance.uploadFile(petId, opts).then(function(data) { +apiInstance.uploadFile(petId, opts).then((data) => { console.log('API called successfully. Returned data: ' + data); -}, function(error) { +}, (error) => { console.error(error); }); diff --git a/samples/client/petstore/javascript-promise-es6/docs/StoreApi.md b/samples/client/petstore/javascript-promise-es6/docs/StoreApi.md index e0771378536..9f931097e03 100644 --- a/samples/client/petstore/javascript-promise-es6/docs/StoreApi.md +++ b/samples/client/petstore/javascript-promise-es6/docs/StoreApi.md @@ -20,15 +20,15 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); +import SwaggerPetstore from 'swagger_petstore'; -var apiInstance = new SwaggerPetstore.StoreApi(); +let apiInstance = new SwaggerPetstore.StoreApi(); -var orderId = "orderId_example"; // String | ID of the order that needs to be deleted +let orderId = "orderId_example"; // String | ID of the order that needs to be deleted -apiInstance.deleteOrder(orderId).then(function() { +apiInstance.deleteOrder(orderId).then(() => { console.log('API called successfully.'); -}, function(error) { +}, (error) => { console.error(error); }); @@ -63,19 +63,19 @@ Returns a map of status codes to quantities ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); -var defaultClient = SwaggerPetstore.ApiClient.instance; +import SwaggerPetstore from 'swagger_petstore'; +let defaultClient = SwaggerPetstore.ApiClient.instance; // Configure API key authorization: api_key -var api_key = defaultClient.authentications['api_key']; +let api_key = defaultClient.authentications['api_key']; api_key.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //api_key.apiKeyPrefix = 'Token'; -var apiInstance = new SwaggerPetstore.StoreApi(); -apiInstance.getInventory().then(function(data) { +let apiInstance = new SwaggerPetstore.StoreApi(); +apiInstance.getInventory().then((data) => { console.log('API called successfully. Returned data: ' + data); -}, function(error) { +}, (error) => { console.error(error); }); @@ -107,15 +107,15 @@ For valid response try integer IDs with value <= 5 or > 10. Other val ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); +import SwaggerPetstore from 'swagger_petstore'; -var apiInstance = new SwaggerPetstore.StoreApi(); +let apiInstance = new SwaggerPetstore.StoreApi(); -var orderId = 789; // Number | ID of pet that needs to be fetched +let orderId = 789; // Number | ID of pet that needs to be fetched -apiInstance.getOrderById(orderId).then(function(data) { +apiInstance.getOrderById(orderId).then((data) => { console.log('API called successfully. Returned data: ' + data); -}, function(error) { +}, (error) => { console.error(error); }); @@ -150,15 +150,15 @@ Place an order for a pet ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); +import SwaggerPetstore from 'swagger_petstore'; -var apiInstance = new SwaggerPetstore.StoreApi(); +let apiInstance = new SwaggerPetstore.StoreApi(); -var body = new SwaggerPetstore.Order(); // Order | order placed for purchasing the pet +let body = new SwaggerPetstore.Order(); // Order | order placed for purchasing the pet -apiInstance.placeOrder(body).then(function(data) { +apiInstance.placeOrder(body).then((data) => { console.log('API called successfully. Returned data: ' + data); -}, function(error) { +}, (error) => { console.error(error); }); diff --git a/samples/client/petstore/javascript-promise-es6/docs/UserApi.md b/samples/client/petstore/javascript-promise-es6/docs/UserApi.md index 3102a61d648..df53e06d15b 100644 --- a/samples/client/petstore/javascript-promise-es6/docs/UserApi.md +++ b/samples/client/petstore/javascript-promise-es6/docs/UserApi.md @@ -24,15 +24,15 @@ This can only be done by the logged in user. ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); +import SwaggerPetstore from 'swagger_petstore'; -var apiInstance = new SwaggerPetstore.UserApi(); +let apiInstance = new SwaggerPetstore.UserApi(); -var body = new SwaggerPetstore.User(); // User | Created user object +let body = new SwaggerPetstore.User(); // User | Created user object -apiInstance.createUser(body).then(function() { +apiInstance.createUser(body).then(() => { console.log('API called successfully.'); -}, function(error) { +}, (error) => { console.error(error); }); @@ -67,15 +67,15 @@ Creates list of users with given input array ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); +import SwaggerPetstore from 'swagger_petstore'; -var apiInstance = new SwaggerPetstore.UserApi(); +let apiInstance = new SwaggerPetstore.UserApi(); -var body = [new SwaggerPetstore.User()]; // [User] | List of user object +let body = [new SwaggerPetstore.User()]; // [User] | List of user object -apiInstance.createUsersWithArrayInput(body).then(function() { +apiInstance.createUsersWithArrayInput(body).then(() => { console.log('API called successfully.'); -}, function(error) { +}, (error) => { console.error(error); }); @@ -110,15 +110,15 @@ Creates list of users with given input array ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); +import SwaggerPetstore from 'swagger_petstore'; -var apiInstance = new SwaggerPetstore.UserApi(); +let apiInstance = new SwaggerPetstore.UserApi(); -var body = [new SwaggerPetstore.User()]; // [User] | List of user object +let body = [new SwaggerPetstore.User()]; // [User] | List of user object -apiInstance.createUsersWithListInput(body).then(function() { +apiInstance.createUsersWithListInput(body).then(() => { console.log('API called successfully.'); -}, function(error) { +}, (error) => { console.error(error); }); @@ -153,15 +153,15 @@ This can only be done by the logged in user. ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); +import SwaggerPetstore from 'swagger_petstore'; -var apiInstance = new SwaggerPetstore.UserApi(); +let apiInstance = new SwaggerPetstore.UserApi(); -var username = "username_example"; // String | The name that needs to be deleted +let username = "username_example"; // String | The name that needs to be deleted -apiInstance.deleteUser(username).then(function() { +apiInstance.deleteUser(username).then(() => { console.log('API called successfully.'); -}, function(error) { +}, (error) => { console.error(error); }); @@ -196,15 +196,15 @@ Get user by user name ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); +import SwaggerPetstore from 'swagger_petstore'; -var apiInstance = new SwaggerPetstore.UserApi(); +let apiInstance = new SwaggerPetstore.UserApi(); -var username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing. +let username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing. -apiInstance.getUserByName(username).then(function(data) { +apiInstance.getUserByName(username).then((data) => { console.log('API called successfully. Returned data: ' + data); -}, function(error) { +}, (error) => { console.error(error); }); @@ -239,17 +239,17 @@ Logs user into the system ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); +import SwaggerPetstore from 'swagger_petstore'; -var apiInstance = new SwaggerPetstore.UserApi(); +let apiInstance = new SwaggerPetstore.UserApi(); -var username = "username_example"; // String | The user name for login +let username = "username_example"; // String | The user name for login -var password = "password_example"; // String | The password for login in clear text +let password = "password_example"; // String | The password for login in clear text -apiInstance.loginUser(username, password).then(function(data) { +apiInstance.loginUser(username, password).then((data) => { console.log('API called successfully. Returned data: ' + data); -}, function(error) { +}, (error) => { console.error(error); }); @@ -285,12 +285,12 @@ Logs out current logged in user session ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); +import SwaggerPetstore from 'swagger_petstore'; -var apiInstance = new SwaggerPetstore.UserApi(); -apiInstance.logoutUser().then(function() { +let apiInstance = new SwaggerPetstore.UserApi(); +apiInstance.logoutUser().then(() => { console.log('API called successfully.'); -}, function(error) { +}, (error) => { console.error(error); }); @@ -322,17 +322,17 @@ This can only be done by the logged in user. ### Example ```javascript -var SwaggerPetstore = require('swagger_petstore'); +import SwaggerPetstore from 'swagger_petstore'; -var apiInstance = new SwaggerPetstore.UserApi(); +let apiInstance = new SwaggerPetstore.UserApi(); -var username = "username_example"; // String | name that need to be deleted +let username = "username_example"; // String | name that need to be deleted -var body = new SwaggerPetstore.User(); // User | Updated user object +let body = new SwaggerPetstore.User(); // User | Updated user object -apiInstance.updateUser(username, body).then(function() { +apiInstance.updateUser(username, body).then(() => { console.log('API called successfully.'); -}, function(error) { +}, (error) => { console.error(error); }); diff --git a/samples/client/petstore/javascript-promise-es6/package.json b/samples/client/petstore/javascript-promise-es6/package.json index 881163c02f4..0332217891a 100644 --- a/samples/client/petstore/javascript-promise-es6/package.json +++ b/samples/client/petstore/javascript-promise-es6/package.json @@ -5,17 +5,22 @@ "license": "Unlicense", "main": "src/index.js", "scripts": { - "test": "./node_modules/mocha/bin/mocha --recursive" + "test": "mocha --compilers js:babel-core/register --recursive" }, "browser": { "fs": false }, "dependencies": { + "babel": "^6.23.0", + "babel-cli": "^6.24.1", "superagent": "3.5.2" }, "devDependencies": { + "babel-core": "6.18.0", + "babel-preset-es2015": "^6.24.1", + "babel-preset-stage-0": "^6.24.1", + "expect.js": "~0.3.1", "mocha": "~2.3.4", - "sinon": "1.17.3", - "expect.js": "~0.3.1" + "sinon": "1.17.3" } } diff --git a/samples/client/petstore/javascript-promise-es6/src/ApiClient.js b/samples/client/petstore/javascript-promise-es6/src/ApiClient.js index 91ef1e6b5ee..c7dcea0de86 100644 --- a/samples/client/petstore/javascript-promise-es6/src/ApiClient.js +++ b/samples/client/petstore/javascript-promise-es6/src/ApiClient.js @@ -7,573 +7,562 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(function(root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['superagent', 'querystring'], factory); - } else if (typeof module === 'object' && module.exports) { - // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('superagent'), require('querystring')); - } else { - // Browser globals (root is window) - if (!root.SwaggerPetstore) { - root.SwaggerPetstore = {}; + +import superagent from "superagent"; +import querystring from "querystring"; + +/** +* @module ApiClient +* @version 1.0.0 +*/ + +/** +* Manages low level client-server communications, parameter marshalling, etc. There should not be any need for an +* application to use this class directly - the *Api and model classes provide the public API for the service. The +* contents of this file should be regarded as internal but are documented for completeness. +* @alias module:ApiClient +* @class +*/ +export default class ApiClient { + constructor() { + /** + * The base URL against which to resolve every API call's (relative) path. + * @type {String} + * @default http://petstore.swagger.io:80/v2 + */ + this.basePath = 'http://petstore.swagger.io:80/v2'.replace(/\/+$/, ''); + + /** + * The authentication methods to be included for all API calls. + * @type {Array.} + */ + this.authentications = { + 'api_key': {type: 'apiKey', 'in': 'header', name: 'api_key'}, + 'http_basic_test': {type: 'basic'}, + 'petstore_auth': {type: 'oauth2'} + } + + /** + * The default HTTP headers to be included for all API calls. + * @type {Array.} + * @default {} + */ + this.defaultHeaders = {}; + + /** + * The default HTTP timeout for all API calls. + * @type {Number} + * @default 60000 + */ + this.timeout = 60000; + + /** + * If set to false an additional timestamp parameter is added to all API GET calls to + * prevent browser caching + * @type {Boolean} + * @default true + */ + this.cache = true; + + /** + * If set to true, the client will save the cookies from each server + * response, and return them in the next request. + * @default false + */ + this.enableCookies = false; + + /* + * Used to save and return cookies in a node.js (non-browser) setting, + * if this.enableCookies is set to true. + */ + if (typeof window === 'undefined') { + this.agent = new superagent.agent(); + } } - root.SwaggerPetstore.ApiClient = factory(root.superagent, root.querystring); - } -}(this, function(superagent, querystring) { - 'use strict'; - - /** - * @module ApiClient - * @version 1.0.0 - */ - - /** - * Manages low level client-server communications, parameter marshalling, etc. There should not be any need for an - * application to use this class directly - the *Api and model classes provide the public API for the service. The - * contents of this file should be regarded as internal but are documented for completeness. - * @alias module:ApiClient - * @class - */ - var exports = function() { - /** - * The base URL against which to resolve every API call's (relative) path. - * @type {String} - * @default http://petstore.swagger.io:80/v2 - */ - this.basePath = 'http://petstore.swagger.io:80/v2'.replace(/\/+$/, ''); /** - * The authentication methods to be included for all API calls. - * @type {Array.} - */ - this.authentications = { - 'api_key': {type: 'apiKey', 'in': 'header', name: 'api_key'}, - 'http_basic_test': {type: 'basic'}, - 'petstore_auth': {type: 'oauth2'} + * Returns a string representation for an actual parameter. + * @param param The actual parameter. + * @returns {String} The string representation of param. + */ + paramToString(param) { + if (param == undefined || param == null) { + return ''; + } + if (param instanceof Date) { + return param.toJSON(); + } + + return param.toString(); + } + + /** + * Builds full URL by appending the given path to the base URL and replacing path parameter place-holders with parameter values. + * NOTE: query parameters are not handled here. + * @param {String} path The path to append to the base URL. + * @param {Object} pathParams The parameter values to append. + * @returns {String} The encoded path with parameter values substituted. + */ + buildUrl(path, pathParams) { + if (!path.match(/^\//)) { + path = '/' + path; + } + + var url = this.basePath + path; + url = url.replace(/\{([\w-]+)\}/g, (fullMatch, key) => { + var value; + if (pathParams.hasOwnProperty(key)) { + value = this.paramToString(pathParams[key]); + } else { + value = fullMatch; + } + + return encodeURIComponent(value); + }); + + return url; + } + + /** + * Checks whether the given content type represents JSON.
+ * JSON content type examples:
+ *
    + *
  • application/json
  • + *
  • application/json; charset=UTF8
  • + *
  • APPLICATION/JSON
  • + *
+ * @param {String} contentType The MIME content type to check. + * @returns {Boolean} true if contentType represents JSON, otherwise false. + */ + isJsonMime(contentType) { + return Boolean(contentType != null && contentType.match(/^application\/json(;.*)?$/i)); + } + + /** + * Chooses a content type from the given array, with JSON preferred; i.e. return JSON if included, otherwise return the first. + * @param {Array.} contentTypes + * @returns {String} The chosen content type, preferring JSON. + */ + jsonPreferredMime(contentTypes) { + for (var i = 0; i < contentTypes.length; i++) { + if (this.isJsonMime(contentTypes[i])) { + return contentTypes[i]; + } + } + + return contentTypes[0]; + } + + /** + * Checks whether the given parameter value represents file-like content. + * @param param The parameter to check. + * @returns {Boolean} true if param represents a file. + */ + isFileParam(param) { + // fs.ReadStream in Node.js and Electron (but not in runtime like browserify) + if (typeof require === 'function') { + let fs; + try { + fs = require('fs'); + } catch (err) {} + if (fs && fs.ReadStream && param instanceof fs.ReadStream) { + return true; + } + } + + // Buffer in Node.js + if (typeof Buffer === 'function' && param instanceof Buffer) { + return true; + } + + // Blob in browser + if (typeof Blob === 'function' && param instanceof Blob) { + return true; + } + + // File in browser (it seems File object is also instance of Blob, but keep this for safe) + if (typeof File === 'function' && param instanceof File) { + return true; + } + + return false; + } + + /** + * Normalizes parameter values: + *
    + *
  • remove nils
  • + *
  • keep files and arrays
  • + *
  • format to string with `paramToString` for other cases
  • + *
+ * @param {Object.} params The parameters as object properties. + * @returns {Object.} normalized parameters. + */ + normalizeParams(params) { + var newParams = {}; + for (var key in params) { + if (params.hasOwnProperty(key) && params[key] != undefined && params[key] != null) { + var value = params[key]; + if (this.isFileParam(value) || Array.isArray(value)) { + newParams[key] = value; + } else { + newParams[key] = this.paramToString(value); + } + } + } + + return newParams; + } + + /** + * Enumeration of collection format separator strategies. + * @enum {String} + * @readonly + */ + static CollectionFormatEnum = { + /** + * Comma-separated values. Value: csv + * @const + */ + CSV: ',', + + /** + * Space-separated values. Value: ssv + * @const + */ + SSV: ' ', + + /** + * Tab-separated values. Value: tsv + * @const + */ + TSV: '\t', + + /** + * Pipe(|)-separated values. Value: pipes + * @const + */ + PIPES: '|', + + /** + * Native array. Value: multi + * @const + */ + MULTI: 'multi' }; - /** - * The default HTTP headers to be included for all API calls. - * @type {Array.} - * @default {} - */ - this.defaultHeaders = {}; /** - * The default HTTP timeout for all API calls. - * @type {Number} - * @default 60000 - */ - this.timeout = 60000; + * Builds a string representation of an array-type actual parameter, according to the given collection format. + * @param {Array} param An array parameter. + * @param {module:ApiClient.CollectionFormatEnum} collectionFormat The array element separator strategy. + * @returns {String|Array} A string representation of the supplied collection, using the specified delimiter. Returns + * param as is if collectionFormat is multi. + */ + buildCollectionParam(param, collectionFormat) { + if (param == null) { + return null; + } + switch (collectionFormat) { + case 'csv': + return param.map(this.paramToString).join(','); + case 'ssv': + return param.map(this.paramToString).join(' '); + case 'tsv': + return param.map(this.paramToString).join('\t'); + case 'pipes': + return param.map(this.paramToString).join('|'); + case 'multi': + //return the array directly as SuperAgent will handle it as expected + return param.map(this.paramToString); + default: + throw new Error('Unknown collection format: ' + collectionFormat); + } + } /** - * If set to false an additional timestamp parameter is added to all API GET calls to - * prevent browser caching - * @type {Boolean} - * @default true - */ - this.cache = true; + * Applies authentication headers to the request. + * @param {Object} request The request object created by a superagent() call. + * @param {Array.} authNames An array of authentication method names. + */ + applyAuthToRequest(request, authNames) { + authNames.forEach((authName) => { + var auth = this.authentications[authName]; + switch (auth.type) { + case 'basic': + if (auth.username || auth.password) { + request.auth(auth.username || '', auth.password || ''); + } + + break; + case 'apiKey': + if (auth.apiKey) { + var data = {}; + if (auth.apiKeyPrefix) { + data[auth.name] = auth.apiKeyPrefix + ' ' + auth.apiKey; + } else { + data[auth.name] = auth.apiKey; + } + + if (auth['in'] === 'header') { + request.set(data); + } else { + request.query(data); + } + } + + break; + case 'oauth2': + if (auth.accessToken) { + request.set({'Authorization': 'Bearer ' + auth.accessToken}); + } + + break; + default: + throw new Error('Unknown authentication type: ' + auth.type); + } + }); + } /** - * If set to true, the client will save the cookies from each server - * response, and return them in the next request. - * @default false - */ - this.enableCookies = false; + * Deserializes an HTTP response body into a value of the specified type. + * @param {Object} response A SuperAgent response object. + * @param {(String|Array.|Object.|Function)} returnType The type to return. Pass a string for simple types + * or the constructor function for a complex type. Pass an array containing the type name to return an array of that type. To + * return an object, pass an object with one property whose name is the key type and whose value is the corresponding value type: + * all properties on data will be converted to this type. + * @returns A value of the specified type. + */ + deserialize(response, returnType) { + if (response == null || returnType == null || response.status == 204) { + return null; + } - /* - * Used to save and return cookies in a node.js (non-browser) setting, - * if this.enableCookies is set to true. - */ - if (typeof window === 'undefined') { - this.agent = new superagent.agent(); + // Rely on SuperAgent for parsing response body. + // See http://visionmedia.github.io/superagent/#parsing-response-bodies + var data = response.body; + if (data == null || (typeof data === 'object' && typeof data.length === 'undefined' && !Object.keys(data).length)) { + // SuperAgent does not always produce a body; use the unparsed response as a fallback + data = response.text; + } + + return ApiClient.convertToType(data, returnType); } - }; + - /** - * Returns a string representation for an actual parameter. - * @param param The actual parameter. - * @returns {String} The string representation of param. - */ - exports.prototype.paramToString = function(param) { - if (param == undefined || param == null) { - return ''; - } - if (param instanceof Date) { - return param.toJSON(); - } - return param.toString(); - }; + /** + * Invokes the REST service using the supplied settings and parameters. + * @param {String} path The base URL to invoke. + * @param {String} httpMethod The HTTP method to use. + * @param {Object.} pathParams A map of path parameters and their values. + * @param {Object.} queryParams A map of query parameters and their values. + * @param {Object.} headerParams A map of header parameters and their values. + * @param {Object.} formParams A map of form parameters and their values. + * @param {Object} bodyParam The value to pass as the request body. + * @param {Array.} authNames An array of authentication type names. + * @param {Array.} contentTypes An array of request MIME types. + * @param {Array.} accepts An array of acceptable response MIME types. + * @param {(String|Array|ObjectFunction)} returnType The required type to return; can be a string for simple types or the + * constructor for a complex type. + * @returns {Promise} A {@link https://www.promisejs.org/|Promise} object. + */ + callApi(path, httpMethod, pathParams, + queryParams, headerParams, formParams, bodyParam, authNames, contentTypes, accepts, + returnType) { - /** - * Builds full URL by appending the given path to the base URL and replacing path parameter place-holders with parameter values. - * NOTE: query parameters are not handled here. - * @param {String} path The path to append to the base URL. - * @param {Object} pathParams The parameter values to append. - * @returns {String} The encoded path with parameter values substituted. - */ - exports.prototype.buildUrl = function(path, pathParams) { - if (!path.match(/^\//)) { - path = '/' + path; - } - var url = this.basePath + path; - var _this = this; - url = url.replace(/\{([\w-]+)\}/g, function(fullMatch, key) { - var value; - if (pathParams.hasOwnProperty(key)) { - value = _this.paramToString(pathParams[key]); - } else { - value = fullMatch; - } - return encodeURIComponent(value); - }); - return url; - }; + var url = this.buildUrl(path, pathParams); + var request = superagent(httpMethod, url); - /** - * Checks whether the given content type represents JSON.
- * JSON content type examples:
- *
    - *
  • application/json
  • - *
  • application/json; charset=UTF8
  • - *
  • APPLICATION/JSON
  • - *
- * @param {String} contentType The MIME content type to check. - * @returns {Boolean} true if contentType represents JSON, otherwise false. - */ - exports.prototype.isJsonMime = function(contentType) { - return Boolean(contentType != null && contentType.match(/^application\/json(;.*)?$/i)); - }; + // apply authentications + this.applyAuthToRequest(request, authNames); - /** - * Chooses a content type from the given array, with JSON preferred; i.e. return JSON if included, otherwise return the first. - * @param {Array.} contentTypes - * @returns {String} The chosen content type, preferring JSON. - */ - exports.prototype.jsonPreferredMime = function(contentTypes) { - for (var i = 0; i < contentTypes.length; i++) { - if (this.isJsonMime(contentTypes[i])) { - return contentTypes[i]; - } - } - return contentTypes[0]; - }; + // set query parameters + if (httpMethod.toUpperCase() === 'GET' && this.cache === false) { + queryParams['_'] = new Date().getTime(); + } - /** - * Checks whether the given parameter value represents file-like content. - * @param param The parameter to check. - * @returns {Boolean} true if param represents a file. - */ - exports.prototype.isFileParam = function(param) { - // fs.ReadStream in Node.js and Electron (but not in runtime like browserify) - if (typeof require === 'function') { - var fs; - try { - fs = require('fs'); - } catch (err) {} - if (fs && fs.ReadStream && param instanceof fs.ReadStream) { - return true; - } - } - // Buffer in Node.js - if (typeof Buffer === 'function' && param instanceof Buffer) { - return true; - } - // Blob in browser - if (typeof Blob === 'function' && param instanceof Blob) { - return true; - } - // File in browser (it seems File object is also instance of Blob, but keep this for safe) - if (typeof File === 'function' && param instanceof File) { - return true; - } - return false; - }; + request.query(this.normalizeParams(queryParams)); - /** - * Normalizes parameter values: - *
    - *
  • remove nils
  • - *
  • keep files and arrays
  • - *
  • format to string with `paramToString` for other cases
  • - *
- * @param {Object.} params The parameters as object properties. - * @returns {Object.} normalized parameters. - */ - exports.prototype.normalizeParams = function(params) { - var newParams = {}; - for (var key in params) { - if (params.hasOwnProperty(key) && params[key] != undefined && params[key] != null) { - var value = params[key]; - if (this.isFileParam(value) || Array.isArray(value)) { - newParams[key] = value; + // set header parameters + request.set(this.defaultHeaders).set(this.normalizeParams(headerParams)); + + // set request timeout + request.timeout(this.timeout); + + var contentType = this.jsonPreferredMime(contentTypes); + if (contentType) { + // Issue with superagent and multipart/form-data (https://github.com/visionmedia/superagent/issues/746) + if(contentType != 'multipart/form-data') { + request.type(contentType); + } + } else if (!request.header['Content-Type']) { + request.type('application/json'); + } + + if (contentType === 'application/x-www-form-urlencoded') { + request.send(querystring.stringify(this.normalizeParams(formParams))); + } else if (contentType == 'multipart/form-data') { + var _formParams = this.normalizeParams(formParams); + for (var key in _formParams) { + if (_formParams.hasOwnProperty(key)) { + if (this.isFileParam(_formParams[key])) { + // file field + request.attach(key, _formParams[key]); + } else { + request.field(key, _formParams[key]); + } + } + } + } else if (bodyParam) { + request.send(bodyParam); + } + + var accept = this.jsonPreferredMime(accepts); + if (accept) { + request.accept(accept); + } + + if (returnType === 'Blob') { + request.responseType('blob'); + } else if (returnType === 'String') { + request.responseType('string'); + } + + // Attach previously saved cookies, if enabled + if (this.enableCookies){ + if (typeof window === 'undefined') { + this.agent.attachCookies(request); + } + else { + request.withCredentials(); + } + } + + return new Promise((resolve, reject) => { + request.end((error, response) => { + if (error) { + reject(error); + } else { + try { + var data = this.deserialize(response, returnType); + if (this.enableCookies && typeof window === 'undefined'){ + this.agent.saveCookies(response); + } + + resolve({data, response}); + } catch (err) { + reject(err); + } + } + }); + }); + + + } + + /** + * Parses an ISO-8601 string representation of a date value. + * @param {String} str The date value as a string. + * @returns {Date} The parsed date object. + */ + static parseDate(str) { + return new Date(str.replace(/T/i, ' ')); + } + + /** + * Converts a value to the specified type. + * @param {(String|Object)} data The data to convert, as a string or object. + * @param {(String|Array.|Object.|Function)} type The type to return. Pass a string for simple types + * or the constructor function for a complex type. Pass an array containing the type name to return an array of that type. To + * return an object, pass an object with one property whose name is the key type and whose value is the corresponding value type: + * all properties on data will be converted to this type. + * @returns An instance of the specified type or null or undefined if data is null or undefined. + */ + static convertToType(data, type) { + if (data === null || data === undefined) + return data + + switch (type) { + case 'Boolean': + return Boolean(data); + case 'Integer': + return parseInt(data, 10); + case 'Number': + return parseFloat(data); + case 'String': + return String(data); + case 'Date': + return ApiClient.parseDate(String(data)); + case 'Blob': + return data; + default: + if (type === Object) { + // generic object, return directly + return data; + } else if (typeof type === 'function') { + // for model type like: User + return type.constructFromObject(data); + } else if (Array.isArray(type)) { + // for array type like: ['String'] + var itemType = type[0]; + + return data.map((item) => { + return ApiClient.convertToType(item, itemType); + }); + } else if (typeof type === 'object') { + // for plain object type like: {'String': 'Integer'} + var keyType, valueType; + for (var k in type) { + if (type.hasOwnProperty(k)) { + keyType = k; + valueType = type[k]; + break; + } + } + + var result = {}; + for (var k in data) { + if (data.hasOwnProperty(k)) { + var key = ApiClient.convertToType(k, keyType); + var value = ApiClient.convertToType(data[k], valueType); + result[key] = value; + } + } + + return result; + } else { + // for unknown type, return the data directly + return data; + } + } + } + + /** + * Constructs a new map or array model from REST data. + * @param data {Object|Array} The REST data. + * @param obj {Object|Array} The target object or array. + */ + static constructFromObject(data, obj, itemType) { + if (Array.isArray(data)) { + for (var i = 0; i < data.length; i++) { + if (data.hasOwnProperty(i)) + obj[i] = ApiClient.convertToType(data[i], itemType); + } } else { - newParams[key] = this.paramToString(value); - } - } - } - return newParams; - }; - - /** - * Enumeration of collection format separator strategies. - * @enum {String} - * @readonly - */ - exports.CollectionFormatEnum = { - /** - * Comma-separated values. Value: csv - * @const - */ - CSV: ',', - /** - * Space-separated values. Value: ssv - * @const - */ - SSV: ' ', - /** - * Tab-separated values. Value: tsv - * @const - */ - TSV: '\t', - /** - * Pipe(|)-separated values. Value: pipes - * @const - */ - PIPES: '|', - /** - * Native array. Value: multi - * @const - */ - MULTI: 'multi' - }; - - /** - * Builds a string representation of an array-type actual parameter, according to the given collection format. - * @param {Array} param An array parameter. - * @param {module:ApiClient.CollectionFormatEnum} collectionFormat The array element separator strategy. - * @returns {String|Array} A string representation of the supplied collection, using the specified delimiter. Returns - * param as is if collectionFormat is multi. - */ - exports.prototype.buildCollectionParam = function buildCollectionParam(param, collectionFormat) { - if (param == null) { - return null; - } - switch (collectionFormat) { - case 'csv': - return param.map(this.paramToString).join(','); - case 'ssv': - return param.map(this.paramToString).join(' '); - case 'tsv': - return param.map(this.paramToString).join('\t'); - case 'pipes': - return param.map(this.paramToString).join('|'); - case 'multi': - // return the array directly as SuperAgent will handle it as expected - return param.map(this.paramToString); - default: - throw new Error('Unknown collection format: ' + collectionFormat); - } - }; - - /** - * Applies authentication headers to the request. - * @param {Object} request The request object created by a superagent() call. - * @param {Array.} authNames An array of authentication method names. - */ - exports.prototype.applyAuthToRequest = function(request, authNames) { - var _this = this; - authNames.forEach(function(authName) { - var auth = _this.authentications[authName]; - switch (auth.type) { - case 'basic': - if (auth.username || auth.password) { - request.auth(auth.username || '', auth.password || ''); - } - break; - case 'apiKey': - if (auth.apiKey) { - var data = {}; - if (auth.apiKeyPrefix) { - data[auth.name] = auth.apiKeyPrefix + ' ' + auth.apiKey; - } else { - data[auth.name] = auth.apiKey; + for (var k in data) { + if (data.hasOwnProperty(k)) + obj[k] = ApiClient.convertToType(data[k], itemType); } - if (auth['in'] === 'header') { - request.set(data); - } else { - request.query(data); - } - } - break; - case 'oauth2': - if (auth.accessToken) { - request.set({'Authorization': 'Bearer ' + auth.accessToken}); - } - break; - default: - throw new Error('Unknown authentication type: ' + auth.type); - } - }); - }; - - /** - * Deserializes an HTTP response body into a value of the specified type. - * @param {Object} response A SuperAgent response object. - * @param {(String|Array.|Object.|Function)} returnType The type to return. Pass a string for simple types - * or the constructor function for a complex type. Pass an array containing the type name to return an array of that type. To - * return an object, pass an object with one property whose name is the key type and whose value is the corresponding value type: - * all properties on data will be converted to this type. - * @returns A value of the specified type. - */ - exports.prototype.deserialize = function deserialize(response, returnType) { - if (response == null || returnType == null || response.status == 204) { - return null; - } - // Rely on SuperAgent for parsing response body. - // See http://visionmedia.github.io/superagent/#parsing-response-bodies - var data = response.body; - if (data == null || (typeof data === 'object' && typeof data.length === 'undefined' && !Object.keys(data).length)) { - // SuperAgent does not always produce a body; use the unparsed response as a fallback - data = response.text; - } - return exports.convertToType(data, returnType); - }; - - /** - * Invokes the REST service using the supplied settings and parameters. - * @param {String} path The base URL to invoke. - * @param {String} httpMethod The HTTP method to use. - * @param {Object.} pathParams A map of path parameters and their values. - * @param {Object.} queryParams A map of query parameters and their values. - * @param {Object.} collectionQueryParams A map of collection query parameters and their values. - * @param {Object.} headerParams A map of header parameters and their values. - * @param {Object.} formParams A map of form parameters and their values. - * @param {Object} bodyParam The value to pass as the request body. - * @param {Array.} authNames An array of authentication type names. - * @param {Array.} contentTypes An array of request MIME types. - * @param {Array.} accepts An array of acceptable response MIME types. - * @param {(String|Array|ObjectFunction)} returnType The required type to return; can be a string for simple types or the - * constructor for a complex type. - * @returns {Promise} A {@link https://www.promisejs.org/|Promise} object. - */ - exports.prototype.callApi = function callApi(path, httpMethod, pathParams, - queryParams, collectionQueryParams, headerParams, formParams, bodyParam, authNames, contentTypes, accepts, - returnType) { - - var _this = this; - var url = this.buildUrl(path, pathParams); - var request = superagent(httpMethod, url); - - // apply authentications - this.applyAuthToRequest(request, authNames); - - // set collection query parameters - for (var key in collectionQueryParams) { - if (collectionQueryParams.hasOwnProperty(key)) { - var param = collectionQueryParams[key]; - if (param.collectionFormat === 'csv') { - // SuperAgent normally percent-encodes all reserved characters in a query parameter. However, - // commas are used as delimiters for the 'csv' collectionFormat so they must not be encoded. We - // must therefore construct and encode 'csv' collection query parameters manually. - if (param.value != null) { - var value = param.value.map(this.paramToString).map(encodeURIComponent).join(','); - request.query(encodeURIComponent(key) + "=" + value); - } - } else { - // All other collection query parameters should be treated as ordinary query parameters. - queryParams[key] = this.buildCollectionParam(param.value, param.collectionFormat); } - } - } + }; +} - // set query parameters - if (httpMethod.toUpperCase() === 'GET' && this.cache === false) { - queryParams['_'] = new Date().getTime(); - } - request.query(this.normalizeParams(queryParams)); - - // set header parameters - request.set(this.defaultHeaders).set(this.normalizeParams(headerParams)); - - // set request timeout - request.timeout(this.timeout); - - var contentType = this.jsonPreferredMime(contentTypes); - if (contentType) { - // Issue with superagent and multipart/form-data (https://github.com/visionmedia/superagent/issues/746) - if(contentType != 'multipart/form-data') { - request.type(contentType); - } - } else if (!request.header['Content-Type']) { - request.type('application/json'); - } - - if (contentType === 'application/x-www-form-urlencoded') { - request.send(querystring.stringify(this.normalizeParams(formParams))); - } else if (contentType == 'multipart/form-data') { - var _formParams = this.normalizeParams(formParams); - for (var key in _formParams) { - if (_formParams.hasOwnProperty(key)) { - if (this.isFileParam(_formParams[key])) { - // file field - request.attach(key, _formParams[key]); - } else { - request.field(key, _formParams[key]); - } - } - } - } else if (bodyParam) { - request.send(bodyParam); - } - - var accept = this.jsonPreferredMime(accepts); - if (accept) { - request.accept(accept); - } - - if (returnType === 'Blob') { - request.responseType('blob'); - } else if (returnType === 'String') { - request.responseType('string'); - } - - // Attach previously saved cookies, if enabled - if (this.enableCookies){ - if (typeof window === 'undefined') { - this.agent.attachCookies(request); - } - else { - request.withCredentials(); - } - } - - return new Promise(function(resolve, reject) { - request.end(function(error, response) { - if (error) { - reject(error); - } else { - try { - var data = _this.deserialize(response, returnType); - if (_this.enableCookies && typeof window === 'undefined'){ - _this.agent.saveCookies(response); - } - resolve({data, response}); - } catch (err) { - reject(err); - } - } - }); - }); - }; - - /** - * Parses an ISO-8601 string representation of a date value. - * @param {String} str The date value as a string. - * @returns {Date} The parsed date object. - */ - exports.parseDate = function(str) { - return new Date(str.replace(/T/i, ' ')); - }; - - /** - * Converts a value to the specified type. - * @param {(String|Object)} data The data to convert, as a string or object. - * @param {(String|Array.|Object.|Function)} type The type to return. Pass a string for simple types - * or the constructor function for a complex type. Pass an array containing the type name to return an array of that type. To - * return an object, pass an object with one property whose name is the key type and whose value is the corresponding value type: - * all properties on data will be converted to this type. - * @returns An instance of the specified type or null or undefined if data is null or undefined. - */ - exports.convertToType = function(data, type) { - if (data === null || data === undefined) - return data - - switch (type) { - case 'Boolean': - return Boolean(data); - case 'Integer': - return parseInt(data, 10); - case 'Number': - return parseFloat(data); - case 'String': - return String(data); - case 'Date': - return this.parseDate(String(data)); - case 'Blob': - return data; - default: - if (type === Object) { - // generic object, return directly - return data; - } else if (typeof type === 'function') { - // for model type like: User - return type.constructFromObject(data); - } else if (Array.isArray(type)) { - // for array type like: ['String'] - var itemType = type[0]; - return data.map(function(item) { - return exports.convertToType(item, itemType); - }); - } else if (typeof type === 'object') { - // for plain object type like: {'String': 'Integer'} - var keyType, valueType; - for (var k in type) { - if (type.hasOwnProperty(k)) { - keyType = k; - valueType = type[k]; - break; - } - } - var result = {}; - for (var k in data) { - if (data.hasOwnProperty(k)) { - var key = exports.convertToType(k, keyType); - var value = exports.convertToType(data[k], valueType); - result[key] = value; - } - } - return result; - } else { - // for unknown type, return the data directly - return data; - } - } - }; - - /** - * Constructs a new map or array model from REST data. - * @param data {Object|Array} The REST data. - * @param obj {Object|Array} The target object or array. - */ - exports.constructFromObject = function(data, obj, itemType) { - if (Array.isArray(data)) { - for (var i = 0; i < data.length; i++) { - if (data.hasOwnProperty(i)) - obj[i] = exports.convertToType(data[i], itemType); - } - } else { - for (var k in data) { - if (data.hasOwnProperty(k)) - obj[k] = exports.convertToType(data[k], itemType); - } - } - }; - - /** - * The default API client implementation. - * @type {module:ApiClient} - */ - exports.instance = new exports(); - - return exports; -})); +/** +* The default API client implementation. +* @type {module:ApiClient} +*/ +ApiClient.instance = new ApiClient(); diff --git a/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js b/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js index 74a03d71017..a199f908642 100644 --- a/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js +++ b/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js @@ -7,45 +7,35 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(function(root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['ApiClient', 'model/Client', 'model/OuterBoolean', 'model/OuterComposite', 'model/OuterNumber', 'model/OuterString'], factory); - } else if (typeof module === 'object' && module.exports) { - // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('../ApiClient'), require('../model/Client'), require('../model/OuterBoolean'), require('../model/OuterComposite'), require('../model/OuterNumber'), require('../model/OuterString')); - } else { - // Browser globals (root is window) - if (!root.SwaggerPetstore) { - root.SwaggerPetstore = {}; + +import ApiClient from "../ApiClient"; +import Client from '../model/Client'; +import OuterBoolean from '../model/OuterBoolean'; +import OuterComposite from '../model/OuterComposite'; +import OuterNumber from '../model/OuterNumber'; +import OuterString from '../model/OuterString'; + +/** +* Fake service. +* @module api/FakeApi +* @version 1.0.0 +*/ +export default class FakeApi { + + /** + * Constructs a new FakeApi. + * @alias module:api/FakeApi + * @class + * @param {module:ApiClient} apiClient Optional API client implementation to use, + * default to {@link module:ApiClient#instance} if unspecified. + */ + constructor(apiClient) { + this.apiClient = apiClient || ApiClient.instance; } - root.SwaggerPetstore.FakeApi = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.Client, root.SwaggerPetstore.OuterBoolean, root.SwaggerPetstore.OuterComposite, root.SwaggerPetstore.OuterNumber, root.SwaggerPetstore.OuterString); - } -}(this, function(ApiClient, Client, OuterBoolean, OuterComposite, OuterNumber, OuterString) { - 'use strict'; - - /** - * Fake service. - * @module api/FakeApi - * @version 1.0.0 - */ - - /** - * Constructs a new FakeApi. - * @alias module:api/FakeApi - * @class - * @param {module:ApiClient} apiClient Optional API client implementation to use, - * default to {@link module:ApiClient#instance} if unspecified. - */ - var exports = function(apiClient) { - this.apiClient = apiClient || ApiClient.instance; @@ -55,30 +45,28 @@ * @param {module:model/OuterBoolean} opts.body Input boolean as post body * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/OuterBoolean} and HTTP response */ - this.fakeOuterBooleanSerializeWithHttpInfo = function(opts) { + fakeOuterBooleanSerializeWithHttpInfo(opts) { opts = opts || {}; - var postBody = opts['body']; + let postBody = opts['body']; - var pathParams = { + let pathParams = { }; - var queryParams = { + let queryParams = { }; - var collectionQueryParams = { + let headerParams = { }; - var headerParams = { - }; - var formParams = { + let formParams = { }; - var authNames = []; - var contentTypes = []; - var accepts = []; - var returnType = OuterBoolean; + let authNames = []; + let contentTypes = []; + let accepts = []; + let returnType = OuterBoolean; return this.apiClient.callApi( '/fake/outer/boolean', 'POST', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType ); } @@ -89,7 +77,7 @@ * @param {module:model/OuterBoolean} opts.body Input boolean as post body * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/OuterBoolean} */ - this.fakeOuterBooleanSerialize = function(opts) { + fakeOuterBooleanSerialize(opts) { return this.fakeOuterBooleanSerializeWithHttpInfo(opts) .then(function(response_and_data) { return response_and_data.data; @@ -103,30 +91,28 @@ * @param {module:model/OuterComposite} opts.body Input composite as post body * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/OuterComposite} and HTTP response */ - this.fakeOuterCompositeSerializeWithHttpInfo = function(opts) { + fakeOuterCompositeSerializeWithHttpInfo(opts) { opts = opts || {}; - var postBody = opts['body']; + let postBody = opts['body']; - var pathParams = { + let pathParams = { }; - var queryParams = { + let queryParams = { }; - var collectionQueryParams = { + let headerParams = { }; - var headerParams = { - }; - var formParams = { + let formParams = { }; - var authNames = []; - var contentTypes = []; - var accepts = []; - var returnType = OuterComposite; + let authNames = []; + let contentTypes = []; + let accepts = []; + let returnType = OuterComposite; return this.apiClient.callApi( '/fake/outer/composite', 'POST', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType ); } @@ -137,7 +123,7 @@ * @param {module:model/OuterComposite} opts.body Input composite as post body * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/OuterComposite} */ - this.fakeOuterCompositeSerialize = function(opts) { + fakeOuterCompositeSerialize(opts) { return this.fakeOuterCompositeSerializeWithHttpInfo(opts) .then(function(response_and_data) { return response_and_data.data; @@ -151,30 +137,28 @@ * @param {module:model/OuterNumber} opts.body Input number as post body * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/OuterNumber} and HTTP response */ - this.fakeOuterNumberSerializeWithHttpInfo = function(opts) { + fakeOuterNumberSerializeWithHttpInfo(opts) { opts = opts || {}; - var postBody = opts['body']; + let postBody = opts['body']; - var pathParams = { + let pathParams = { }; - var queryParams = { + let queryParams = { }; - var collectionQueryParams = { + let headerParams = { }; - var headerParams = { - }; - var formParams = { + let formParams = { }; - var authNames = []; - var contentTypes = []; - var accepts = []; - var returnType = OuterNumber; + let authNames = []; + let contentTypes = []; + let accepts = []; + let returnType = OuterNumber; return this.apiClient.callApi( '/fake/outer/number', 'POST', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType ); } @@ -185,7 +169,7 @@ * @param {module:model/OuterNumber} opts.body Input number as post body * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/OuterNumber} */ - this.fakeOuterNumberSerialize = function(opts) { + fakeOuterNumberSerialize(opts) { return this.fakeOuterNumberSerializeWithHttpInfo(opts) .then(function(response_and_data) { return response_and_data.data; @@ -199,30 +183,28 @@ * @param {module:model/OuterString} opts.body Input string as post body * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/OuterString} and HTTP response */ - this.fakeOuterStringSerializeWithHttpInfo = function(opts) { + fakeOuterStringSerializeWithHttpInfo(opts) { opts = opts || {}; - var postBody = opts['body']; + let postBody = opts['body']; - var pathParams = { + let pathParams = { }; - var queryParams = { + let queryParams = { }; - var collectionQueryParams = { + let headerParams = { }; - var headerParams = { - }; - var formParams = { + let formParams = { }; - var authNames = []; - var contentTypes = []; - var accepts = []; - var returnType = OuterString; + let authNames = []; + let contentTypes = []; + let accepts = []; + let returnType = OuterString; return this.apiClient.callApi( '/fake/outer/string', 'POST', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType ); } @@ -233,7 +215,7 @@ * @param {module:model/OuterString} opts.body Input string as post body * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/OuterString} */ - this.fakeOuterStringSerialize = function(opts) { + fakeOuterStringSerialize(opts) { return this.fakeOuterStringSerializeWithHttpInfo(opts) .then(function(response_and_data) { return response_and_data.data; @@ -247,8 +229,8 @@ * @param {module:model/Client} body client model * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Client} and HTTP response */ - this.testClientModelWithHttpInfo = function(body) { - var postBody = body; + testClientModelWithHttpInfo(body) { + let postBody = body; // verify the required parameter 'body' is set if (body === undefined || body === null) { @@ -256,25 +238,23 @@ } - var pathParams = { + let pathParams = { }; - var queryParams = { + let queryParams = { }; - var collectionQueryParams = { + let headerParams = { }; - var headerParams = { - }; - var formParams = { + let formParams = { }; - var authNames = []; - var contentTypes = ['application/json']; - var accepts = ['application/json']; - var returnType = Client; + let authNames = []; + let contentTypes = ['application/json']; + let accepts = ['application/json']; + let returnType = Client; return this.apiClient.callApi( '/fake', 'PATCH', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType ); } @@ -285,7 +265,7 @@ * @param {module:model/Client} body client model * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Client} */ - this.testClientModel = function(body) { + testClientModel(body) { return this.testClientModelWithHttpInfo(body) .then(function(response_and_data) { return response_and_data.data; @@ -313,9 +293,9 @@ * @param {String} opts.callback None * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ - this.testEndpointParametersWithHttpInfo = function(_number, _double, patternWithoutDelimiter, _byte, opts) { + testEndpointParametersWithHttpInfo(_number, _double, patternWithoutDelimiter, _byte, opts) { opts = opts || {}; - var postBody = null; + let postBody = null; // verify the required parameter '_number' is set if (_number === undefined || _number === null) { @@ -338,15 +318,13 @@ } - var pathParams = { + let pathParams = { }; - var queryParams = { + let queryParams = { }; - var collectionQueryParams = { + let headerParams = { }; - var headerParams = { - }; - var formParams = { + let formParams = { 'integer': opts['integer'], 'int32': opts['int32'], 'int64': opts['int64'], @@ -363,14 +341,14 @@ 'callback': opts['callback'] }; - var authNames = ['http_basic_test']; - 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; + let authNames = ['http_basic_test']; + let contentTypes = ['application/xml; charset=utf-8', 'application/json; charset=utf-8']; + let accepts = ['application/xml; charset=utf-8', 'application/json; charset=utf-8']; + let returnType = null; return this.apiClient.callApi( '/fake', 'POST', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType ); } @@ -395,7 +373,7 @@ * @param {String} opts.callback None * @return {Promise} a {@link https://www.promisejs.org/|Promise} */ - this.testEndpointParameters = function(_number, _double, patternWithoutDelimiter, _byte, opts) { + testEndpointParameters(_number, _double, patternWithoutDelimiter, _byte, opts) { return this.testEndpointParametersWithHttpInfo(_number, _double, patternWithoutDelimiter, _byte, opts) .then(function(response_and_data) { return response_and_data.data; @@ -417,41 +395,36 @@ * @param {module:model/Number} opts.enumQueryDouble Query parameter enum test (double) * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ - this.testEnumParametersWithHttpInfo = function(opts) { + testEnumParametersWithHttpInfo(opts) { opts = opts || {}; - var postBody = null; + let postBody = null; - var pathParams = { + let pathParams = { }; - var queryParams = { + let queryParams = { + 'enum_query_string_array': this.apiClient.buildCollectionParam(opts['enumQueryStringArray'], 'csv'), 'enum_query_string': opts['enumQueryString'], - 'enum_query_integer': opts['enumQueryInteger'], + 'enum_query_integer': opts['enumQueryInteger'] }; - var collectionQueryParams = { - 'enum_query_string_array': { - value: opts['enumQueryStringArray'], - collectionFormat: 'csv' - }, - }; - var headerParams = { + let headerParams = { 'enum_header_string_array': opts['enumHeaderStringArray'], 'enum_header_string': opts['enumHeaderString'] }; - var formParams = { + let formParams = { 'enum_form_string_array': this.apiClient.buildCollectionParam(opts['enumFormStringArray'], 'csv'), 'enum_form_string': opts['enumFormString'], 'enum_query_double': opts['enumQueryDouble'] }; - var authNames = []; - var contentTypes = ['*/*']; - var accepts = ['*/*']; - var returnType = null; + let authNames = []; + let contentTypes = ['*/*']; + let accepts = ['*/*']; + let returnType = null; return this.apiClient.callApi( '/fake', 'GET', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType ); } @@ -470,13 +443,71 @@ * @param {module:model/Number} opts.enumQueryDouble Query parameter enum test (double) * @return {Promise} a {@link https://www.promisejs.org/|Promise} */ - this.testEnumParameters = function(opts) { + testEnumParameters(opts) { return this.testEnumParametersWithHttpInfo(opts) .then(function(response_and_data) { return response_and_data.data; }); } - }; - return exports; -})); + + /** + * test json serialization of form data + * + * @param {String} param field1 + * @param {String} param2 field2 + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response + */ + testJsonFormDataWithHttpInfo(param, param2) { + let postBody = null; + + // verify the required parameter 'param' is set + if (param === undefined || param === null) { + throw new Error("Missing the required parameter 'param' when calling testJsonFormData"); + } + + // verify the required parameter 'param2' is set + if (param2 === undefined || param2 === null) { + throw new Error("Missing the required parameter 'param2' when calling testJsonFormData"); + } + + + let pathParams = { + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + 'param': param, + 'param2': param2 + }; + + let authNames = []; + let contentTypes = ['application/json']; + let accepts = []; + let returnType = null; + + return this.apiClient.callApi( + '/fake/jsonFormData', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType + ); + } + + /** + * test json serialization of form data + * + * @param {String} param field1 + * @param {String} param2 field2 + * @return {Promise} a {@link https://www.promisejs.org/|Promise} + */ + testJsonFormData(param, param2) { + return this.testJsonFormDataWithHttpInfo(param, param2) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + +} diff --git a/samples/client/petstore/javascript-promise-es6/src/api/Fake_classname_tags123Api.js b/samples/client/petstore/javascript-promise-es6/src/api/Fake_classname_tags123Api.js index 7d9a624e19e..fae03ec6568 100644 --- a/samples/client/petstore/javascript-promise-es6/src/api/Fake_classname_tags123Api.js +++ b/samples/client/petstore/javascript-promise-es6/src/api/Fake_classname_tags123Api.js @@ -7,45 +7,31 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(function(root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['ApiClient', 'model/Client'], factory); - } else if (typeof module === 'object' && module.exports) { - // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('../ApiClient'), require('../model/Client')); - } else { - // Browser globals (root is window) - if (!root.SwaggerPetstore) { - root.SwaggerPetstore = {}; + +import ApiClient from "../ApiClient"; +import Client from '../model/Client'; + +/** +* Fake_classname_tags123 service. +* @module api/Fake_classname_tags123Api +* @version 1.0.0 +*/ +export default class Fake_classname_tags123Api { + + /** + * Constructs a new Fake_classname_tags123Api. + * @alias module:api/Fake_classname_tags123Api + * @class + * @param {module:ApiClient} apiClient Optional API client implementation to use, + * default to {@link module:ApiClient#instance} if unspecified. + */ + constructor(apiClient) { + this.apiClient = apiClient || ApiClient.instance; } - root.SwaggerPetstore.Fake_classname_tags123Api = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.Client); - } -}(this, function(ApiClient, Client) { - 'use strict'; - - /** - * Fake_classname_tags123 service. - * @module api/Fake_classname_tags123Api - * @version 1.0.0 - */ - - /** - * Constructs a new Fake_classname_tags123Api. - * @alias module:api/Fake_classname_tags123Api - * @class - * @param {module:ApiClient} apiClient Optional API client implementation to use, - * default to {@link module:ApiClient#instance} if unspecified. - */ - var exports = function(apiClient) { - this.apiClient = apiClient || ApiClient.instance; @@ -54,8 +40,8 @@ * @param {module:model/Client} body client model * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Client} and HTTP response */ - this.testClassnameWithHttpInfo = function(body) { - var postBody = body; + testClassnameWithHttpInfo(body) { + let postBody = body; // verify the required parameter 'body' is set if (body === undefined || body === null) { @@ -63,25 +49,23 @@ } - var pathParams = { + let pathParams = { }; - var queryParams = { + let queryParams = { }; - var collectionQueryParams = { + let headerParams = { }; - var headerParams = { - }; - var formParams = { + let formParams = { }; - var authNames = []; - var contentTypes = ['application/json']; - var accepts = ['application/json']; - var returnType = Client; + let authNames = []; + let contentTypes = ['application/json']; + let accepts = ['application/json']; + let returnType = Client; return this.apiClient.callApi( '/fake_classname_test', 'PATCH', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType ); } @@ -91,13 +75,12 @@ * @param {module:model/Client} body client model * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Client} */ - this.testClassname = function(body) { + testClassname(body) { return this.testClassnameWithHttpInfo(body) .then(function(response_and_data) { return response_and_data.data; }); } - }; - return exports; -})); + +} diff --git a/samples/client/petstore/javascript-promise-es6/src/api/PetApi.js b/samples/client/petstore/javascript-promise-es6/src/api/PetApi.js index 6aada6cbc14..53e385ef2cd 100644 --- a/samples/client/petstore/javascript-promise-es6/src/api/PetApi.js +++ b/samples/client/petstore/javascript-promise-es6/src/api/PetApi.js @@ -7,45 +7,32 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(function(root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['ApiClient', 'model/ApiResponse', 'model/Pet'], factory); - } else if (typeof module === 'object' && module.exports) { - // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('../ApiClient'), require('../model/ApiResponse'), require('../model/Pet')); - } else { - // Browser globals (root is window) - if (!root.SwaggerPetstore) { - root.SwaggerPetstore = {}; + +import ApiClient from "../ApiClient"; +import ApiResponse from '../model/ApiResponse'; +import Pet from '../model/Pet'; + +/** +* Pet service. +* @module api/PetApi +* @version 1.0.0 +*/ +export default class PetApi { + + /** + * Constructs a new PetApi. + * @alias module:api/PetApi + * @class + * @param {module:ApiClient} apiClient Optional API client implementation to use, + * default to {@link module:ApiClient#instance} if unspecified. + */ + constructor(apiClient) { + this.apiClient = apiClient || ApiClient.instance; } - root.SwaggerPetstore.PetApi = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.ApiResponse, root.SwaggerPetstore.Pet); - } -}(this, function(ApiClient, ApiResponse, Pet) { - 'use strict'; - - /** - * Pet service. - * @module api/PetApi - * @version 1.0.0 - */ - - /** - * Constructs a new PetApi. - * @alias module:api/PetApi - * @class - * @param {module:ApiClient} apiClient Optional API client implementation to use, - * default to {@link module:ApiClient#instance} if unspecified. - */ - var exports = function(apiClient) { - this.apiClient = apiClient || ApiClient.instance; @@ -55,8 +42,8 @@ * @param {module:model/Pet} body Pet object that needs to be added to the store * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ - this.addPetWithHttpInfo = function(body) { - var postBody = body; + addPetWithHttpInfo(body) { + let postBody = body; // verify the required parameter 'body' is set if (body === undefined || body === null) { @@ -64,25 +51,23 @@ } - var pathParams = { + let pathParams = { }; - var queryParams = { + let queryParams = { }; - var collectionQueryParams = { + let headerParams = { }; - var headerParams = { - }; - var formParams = { + let formParams = { }; - var authNames = ['petstore_auth']; - var contentTypes = ['application/json', 'application/xml']; - var accepts = ['application/xml', 'application/json']; - var returnType = null; + let authNames = ['petstore_auth']; + let contentTypes = ['application/json', 'application/xml']; + let accepts = ['application/xml', 'application/json']; + let returnType = null; return this.apiClient.callApi( '/pet', 'POST', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType ); } @@ -93,7 +78,7 @@ * @param {module:model/Pet} body Pet object that needs to be added to the store * @return {Promise} a {@link https://www.promisejs.org/|Promise} */ - this.addPet = function(body) { + addPet(body) { return this.addPetWithHttpInfo(body) .then(function(response_and_data) { return response_and_data.data; @@ -109,9 +94,9 @@ * @param {String} opts.apiKey * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ - this.deletePetWithHttpInfo = function(petId, opts) { + deletePetWithHttpInfo(petId, opts) { opts = opts || {}; - var postBody = null; + let postBody = null; // verify the required parameter 'petId' is set if (petId === undefined || petId === null) { @@ -119,27 +104,25 @@ } - var pathParams = { + let pathParams = { 'petId': petId }; - var queryParams = { + let queryParams = { }; - var collectionQueryParams = { - }; - var headerParams = { + let headerParams = { 'api_key': opts['apiKey'] }; - var formParams = { + let formParams = { }; - var authNames = ['petstore_auth']; - var contentTypes = []; - var accepts = ['application/xml', 'application/json']; - var returnType = null; + let authNames = ['petstore_auth']; + let contentTypes = []; + let accepts = ['application/xml', 'application/json']; + let returnType = null; return this.apiClient.callApi( '/pet/{petId}', 'DELETE', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType ); } @@ -152,7 +135,7 @@ * @param {String} opts.apiKey * @return {Promise} a {@link https://www.promisejs.org/|Promise} */ - this.deletePet = function(petId, opts) { + deletePet(petId, opts) { return this.deletePetWithHttpInfo(petId, opts) .then(function(response_and_data) { return response_and_data.data; @@ -166,8 +149,8 @@ * @param {Array.} status Status values that need to be considered for filter * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Array.} and HTTP response */ - this.findPetsByStatusWithHttpInfo = function(status) { - var postBody = null; + findPetsByStatusWithHttpInfo(status) { + let postBody = null; // verify the required parameter 'status' is set if (status === undefined || status === null) { @@ -175,29 +158,24 @@ } - var pathParams = { + let pathParams = { }; - var queryParams = { + let queryParams = { + 'status': this.apiClient.buildCollectionParam(status, 'csv') }; - var collectionQueryParams = { - 'status': { - value: status, - collectionFormat: 'csv' - }, + let headerParams = { }; - var headerParams = { - }; - var formParams = { + let formParams = { }; - var authNames = ['petstore_auth']; - var contentTypes = []; - var accepts = ['application/xml', 'application/json']; - var returnType = [Pet]; + let authNames = ['petstore_auth']; + let contentTypes = []; + let accepts = ['application/xml', 'application/json']; + let returnType = [Pet]; return this.apiClient.callApi( '/pet/findByStatus', 'GET', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType ); } @@ -208,7 +186,7 @@ * @param {Array.} status Status values that need to be considered for filter * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Array.} */ - this.findPetsByStatus = function(status) { + findPetsByStatus(status) { return this.findPetsByStatusWithHttpInfo(status) .then(function(response_and_data) { return response_and_data.data; @@ -222,8 +200,8 @@ * @param {Array.} tags Tags to filter by * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Array.} and HTTP response */ - this.findPetsByTagsWithHttpInfo = function(tags) { - var postBody = null; + findPetsByTagsWithHttpInfo(tags) { + let postBody = null; // verify the required parameter 'tags' is set if (tags === undefined || tags === null) { @@ -231,29 +209,24 @@ } - var pathParams = { + let pathParams = { }; - var queryParams = { + let queryParams = { + 'tags': this.apiClient.buildCollectionParam(tags, 'csv') }; - var collectionQueryParams = { - 'tags': { - value: tags, - collectionFormat: 'csv' - }, + let headerParams = { }; - var headerParams = { - }; - var formParams = { + let formParams = { }; - var authNames = ['petstore_auth']; - var contentTypes = []; - var accepts = ['application/xml', 'application/json']; - var returnType = [Pet]; + let authNames = ['petstore_auth']; + let contentTypes = []; + let accepts = ['application/xml', 'application/json']; + let returnType = [Pet]; return this.apiClient.callApi( '/pet/findByTags', 'GET', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType ); } @@ -264,7 +237,7 @@ * @param {Array.} tags Tags to filter by * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Array.} */ - this.findPetsByTags = function(tags) { + findPetsByTags(tags) { return this.findPetsByTagsWithHttpInfo(tags) .then(function(response_and_data) { return response_and_data.data; @@ -278,8 +251,8 @@ * @param {Number} petId ID of pet to return * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Pet} and HTTP response */ - this.getPetByIdWithHttpInfo = function(petId) { - var postBody = null; + getPetByIdWithHttpInfo(petId) { + let postBody = null; // verify the required parameter 'petId' is set if (petId === undefined || petId === null) { @@ -287,26 +260,24 @@ } - var pathParams = { + let pathParams = { 'petId': petId }; - var queryParams = { + let queryParams = { }; - var collectionQueryParams = { + let headerParams = { }; - var headerParams = { - }; - var formParams = { + let formParams = { }; - var authNames = ['api_key']; - var contentTypes = []; - var accepts = ['application/xml', 'application/json']; - var returnType = Pet; + let authNames = ['api_key']; + let contentTypes = []; + let accepts = ['application/xml', 'application/json']; + let returnType = Pet; return this.apiClient.callApi( '/pet/{petId}', 'GET', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType ); } @@ -317,7 +288,7 @@ * @param {Number} petId ID of pet to return * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Pet} */ - this.getPetById = function(petId) { + getPetById(petId) { return this.getPetByIdWithHttpInfo(petId) .then(function(response_and_data) { return response_and_data.data; @@ -331,8 +302,8 @@ * @param {module:model/Pet} body Pet object that needs to be added to the store * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ - this.updatePetWithHttpInfo = function(body) { - var postBody = body; + updatePetWithHttpInfo(body) { + let postBody = body; // verify the required parameter 'body' is set if (body === undefined || body === null) { @@ -340,25 +311,23 @@ } - var pathParams = { + let pathParams = { }; - var queryParams = { + let queryParams = { }; - var collectionQueryParams = { + let headerParams = { }; - var headerParams = { - }; - var formParams = { + let formParams = { }; - var authNames = ['petstore_auth']; - var contentTypes = ['application/json', 'application/xml']; - var accepts = ['application/xml', 'application/json']; - var returnType = null; + let authNames = ['petstore_auth']; + let contentTypes = ['application/json', 'application/xml']; + let accepts = ['application/xml', 'application/json']; + let returnType = null; return this.apiClient.callApi( '/pet', 'PUT', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType ); } @@ -369,7 +338,7 @@ * @param {module:model/Pet} body Pet object that needs to be added to the store * @return {Promise} a {@link https://www.promisejs.org/|Promise} */ - this.updatePet = function(body) { + updatePet(body) { return this.updatePetWithHttpInfo(body) .then(function(response_and_data) { return response_and_data.data; @@ -386,9 +355,9 @@ * @param {String} opts.status Updated status of the pet * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ - this.updatePetWithFormWithHttpInfo = function(petId, opts) { + updatePetWithFormWithHttpInfo(petId, opts) { opts = opts || {}; - var postBody = null; + let postBody = null; // verify the required parameter 'petId' is set if (petId === undefined || petId === null) { @@ -396,28 +365,26 @@ } - var pathParams = { + let pathParams = { 'petId': petId }; - var queryParams = { + let queryParams = { }; - var collectionQueryParams = { + let headerParams = { }; - var headerParams = { - }; - var formParams = { + let formParams = { 'name': opts['name'], 'status': opts['status'] }; - var authNames = ['petstore_auth']; - var contentTypes = ['application/x-www-form-urlencoded']; - var accepts = ['application/xml', 'application/json']; - var returnType = null; + let authNames = ['petstore_auth']; + let contentTypes = ['application/x-www-form-urlencoded']; + let accepts = ['application/xml', 'application/json']; + let returnType = null; return this.apiClient.callApi( '/pet/{petId}', 'POST', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType ); } @@ -431,7 +398,7 @@ * @param {String} opts.status Updated status of the pet * @return {Promise} a {@link https://www.promisejs.org/|Promise} */ - this.updatePetWithForm = function(petId, opts) { + updatePetWithForm(petId, opts) { return this.updatePetWithFormWithHttpInfo(petId, opts) .then(function(response_and_data) { return response_and_data.data; @@ -448,9 +415,9 @@ * @param {File} opts.file file to upload * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiResponse} and HTTP response */ - this.uploadFileWithHttpInfo = function(petId, opts) { + uploadFileWithHttpInfo(petId, opts) { opts = opts || {}; - var postBody = null; + let postBody = null; // verify the required parameter 'petId' is set if (petId === undefined || petId === null) { @@ -458,28 +425,26 @@ } - var pathParams = { + let pathParams = { 'petId': petId }; - var queryParams = { + let queryParams = { }; - var collectionQueryParams = { + let headerParams = { }; - var headerParams = { - }; - var formParams = { + let formParams = { 'additionalMetadata': opts['additionalMetadata'], 'file': opts['file'] }; - var authNames = ['petstore_auth']; - var contentTypes = ['multipart/form-data']; - var accepts = ['application/json']; - var returnType = ApiResponse; + let authNames = ['petstore_auth']; + let contentTypes = ['multipart/form-data']; + let accepts = ['application/json']; + let returnType = ApiResponse; return this.apiClient.callApi( '/pet/{petId}/uploadImage', 'POST', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType ); } @@ -493,13 +458,12 @@ * @param {File} opts.file file to upload * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiResponse} */ - this.uploadFile = function(petId, opts) { + uploadFile(petId, opts) { return this.uploadFileWithHttpInfo(petId, opts) .then(function(response_and_data) { return response_and_data.data; }); } - }; - return exports; -})); + +} diff --git a/samples/client/petstore/javascript-promise-es6/src/api/StoreApi.js b/samples/client/petstore/javascript-promise-es6/src/api/StoreApi.js index 48f7bbfce43..0b55929a8a4 100644 --- a/samples/client/petstore/javascript-promise-es6/src/api/StoreApi.js +++ b/samples/client/petstore/javascript-promise-es6/src/api/StoreApi.js @@ -7,45 +7,31 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(function(root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['ApiClient', 'model/Order'], factory); - } else if (typeof module === 'object' && module.exports) { - // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('../ApiClient'), require('../model/Order')); - } else { - // Browser globals (root is window) - if (!root.SwaggerPetstore) { - root.SwaggerPetstore = {}; + +import ApiClient from "../ApiClient"; +import Order from '../model/Order'; + +/** +* Store service. +* @module api/StoreApi +* @version 1.0.0 +*/ +export default class StoreApi { + + /** + * Constructs a new StoreApi. + * @alias module:api/StoreApi + * @class + * @param {module:ApiClient} apiClient Optional API client implementation to use, + * default to {@link module:ApiClient#instance} if unspecified. + */ + constructor(apiClient) { + this.apiClient = apiClient || ApiClient.instance; } - root.SwaggerPetstore.StoreApi = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.Order); - } -}(this, function(ApiClient, Order) { - 'use strict'; - - /** - * Store service. - * @module api/StoreApi - * @version 1.0.0 - */ - - /** - * Constructs a new StoreApi. - * @alias module:api/StoreApi - * @class - * @param {module:ApiClient} apiClient Optional API client implementation to use, - * default to {@link module:ApiClient#instance} if unspecified. - */ - var exports = function(apiClient) { - this.apiClient = apiClient || ApiClient.instance; @@ -55,8 +41,8 @@ * @param {String} orderId ID of the order that needs to be deleted * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ - this.deleteOrderWithHttpInfo = function(orderId) { - var postBody = null; + deleteOrderWithHttpInfo(orderId) { + let postBody = null; // verify the required parameter 'orderId' is set if (orderId === undefined || orderId === null) { @@ -64,26 +50,24 @@ } - var pathParams = { + let pathParams = { 'order_id': orderId }; - var queryParams = { + let queryParams = { }; - var collectionQueryParams = { + let headerParams = { }; - var headerParams = { - }; - var formParams = { + let formParams = { }; - var authNames = []; - var contentTypes = []; - var accepts = ['application/xml', 'application/json']; - var returnType = null; + let authNames = []; + let contentTypes = []; + let accepts = ['application/xml', 'application/json']; + let returnType = null; return this.apiClient.callApi( '/store/order/{order_id}', 'DELETE', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType ); } @@ -94,7 +78,7 @@ * @param {String} orderId ID of the order that needs to be deleted * @return {Promise} a {@link https://www.promisejs.org/|Promise} */ - this.deleteOrder = function(orderId) { + deleteOrder(orderId) { return this.deleteOrderWithHttpInfo(orderId) .then(function(response_and_data) { return response_and_data.data; @@ -107,29 +91,27 @@ * Returns a map of status codes to quantities * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object.} and HTTP response */ - this.getInventoryWithHttpInfo = function() { - var postBody = null; + getInventoryWithHttpInfo() { + let postBody = null; - var pathParams = { + let pathParams = { }; - var queryParams = { + let queryParams = { }; - var collectionQueryParams = { + let headerParams = { }; - var headerParams = { - }; - var formParams = { + let formParams = { }; - var authNames = ['api_key']; - var contentTypes = []; - var accepts = ['application/json']; - var returnType = {'String': 'Number'}; + let authNames = ['api_key']; + let contentTypes = []; + let accepts = ['application/json']; + let returnType = {'String': 'Number'}; return this.apiClient.callApi( '/store/inventory', 'GET', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType ); } @@ -139,7 +121,7 @@ * Returns a map of status codes to quantities * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object.} */ - this.getInventory = function() { + getInventory() { return this.getInventoryWithHttpInfo() .then(function(response_and_data) { return response_and_data.data; @@ -153,8 +135,8 @@ * @param {Number} orderId ID of pet that needs to be fetched * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Order} and HTTP response */ - this.getOrderByIdWithHttpInfo = function(orderId) { - var postBody = null; + getOrderByIdWithHttpInfo(orderId) { + let postBody = null; // verify the required parameter 'orderId' is set if (orderId === undefined || orderId === null) { @@ -162,26 +144,24 @@ } - var pathParams = { + let pathParams = { 'order_id': orderId }; - var queryParams = { + let queryParams = { }; - var collectionQueryParams = { + let headerParams = { }; - var headerParams = { - }; - var formParams = { + let formParams = { }; - var authNames = []; - var contentTypes = []; - var accepts = ['application/xml', 'application/json']; - var returnType = Order; + let authNames = []; + let contentTypes = []; + let accepts = ['application/xml', 'application/json']; + let returnType = Order; return this.apiClient.callApi( '/store/order/{order_id}', 'GET', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType ); } @@ -192,7 +172,7 @@ * @param {Number} orderId ID of pet that needs to be fetched * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Order} */ - this.getOrderById = function(orderId) { + getOrderById(orderId) { return this.getOrderByIdWithHttpInfo(orderId) .then(function(response_and_data) { return response_and_data.data; @@ -206,8 +186,8 @@ * @param {module:model/Order} body order placed for purchasing the pet * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Order} and HTTP response */ - this.placeOrderWithHttpInfo = function(body) { - var postBody = body; + placeOrderWithHttpInfo(body) { + let postBody = body; // verify the required parameter 'body' is set if (body === undefined || body === null) { @@ -215,25 +195,23 @@ } - var pathParams = { + let pathParams = { }; - var queryParams = { + let queryParams = { }; - var collectionQueryParams = { + let headerParams = { }; - var headerParams = { - }; - var formParams = { + let formParams = { }; - var authNames = []; - var contentTypes = []; - var accepts = ['application/xml', 'application/json']; - var returnType = Order; + let authNames = []; + let contentTypes = []; + let accepts = ['application/xml', 'application/json']; + let returnType = Order; return this.apiClient.callApi( '/store/order', 'POST', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType ); } @@ -244,13 +222,12 @@ * @param {module:model/Order} body order placed for purchasing the pet * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Order} */ - this.placeOrder = function(body) { + placeOrder(body) { return this.placeOrderWithHttpInfo(body) .then(function(response_and_data) { return response_and_data.data; }); } - }; - return exports; -})); + +} diff --git a/samples/client/petstore/javascript-promise-es6/src/api/UserApi.js b/samples/client/petstore/javascript-promise-es6/src/api/UserApi.js index 05f37528d95..1c1fe593e26 100644 --- a/samples/client/petstore/javascript-promise-es6/src/api/UserApi.js +++ b/samples/client/petstore/javascript-promise-es6/src/api/UserApi.js @@ -7,45 +7,31 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(function(root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['ApiClient', 'model/User'], factory); - } else if (typeof module === 'object' && module.exports) { - // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('../ApiClient'), require('../model/User')); - } else { - // Browser globals (root is window) - if (!root.SwaggerPetstore) { - root.SwaggerPetstore = {}; + +import ApiClient from "../ApiClient"; +import User from '../model/User'; + +/** +* User service. +* @module api/UserApi +* @version 1.0.0 +*/ +export default class UserApi { + + /** + * Constructs a new UserApi. + * @alias module:api/UserApi + * @class + * @param {module:ApiClient} apiClient Optional API client implementation to use, + * default to {@link module:ApiClient#instance} if unspecified. + */ + constructor(apiClient) { + this.apiClient = apiClient || ApiClient.instance; } - root.SwaggerPetstore.UserApi = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.User); - } -}(this, function(ApiClient, User) { - 'use strict'; - - /** - * User service. - * @module api/UserApi - * @version 1.0.0 - */ - - /** - * Constructs a new UserApi. - * @alias module:api/UserApi - * @class - * @param {module:ApiClient} apiClient Optional API client implementation to use, - * default to {@link module:ApiClient#instance} if unspecified. - */ - var exports = function(apiClient) { - this.apiClient = apiClient || ApiClient.instance; @@ -55,8 +41,8 @@ * @param {module:model/User} body Created user object * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ - this.createUserWithHttpInfo = function(body) { - var postBody = body; + createUserWithHttpInfo(body) { + let postBody = body; // verify the required parameter 'body' is set if (body === undefined || body === null) { @@ -64,25 +50,23 @@ } - var pathParams = { + let pathParams = { }; - var queryParams = { + let queryParams = { }; - var collectionQueryParams = { + let headerParams = { }; - var headerParams = { - }; - var formParams = { + let formParams = { }; - var authNames = []; - var contentTypes = []; - var accepts = ['application/xml', 'application/json']; - var returnType = null; + let authNames = []; + let contentTypes = []; + let accepts = ['application/xml', 'application/json']; + let returnType = null; return this.apiClient.callApi( '/user', 'POST', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType ); } @@ -93,7 +77,7 @@ * @param {module:model/User} body Created user object * @return {Promise} a {@link https://www.promisejs.org/|Promise} */ - this.createUser = function(body) { + createUser(body) { return this.createUserWithHttpInfo(body) .then(function(response_and_data) { return response_and_data.data; @@ -107,8 +91,8 @@ * @param {Array.} body List of user object * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ - this.createUsersWithArrayInputWithHttpInfo = function(body) { - var postBody = body; + createUsersWithArrayInputWithHttpInfo(body) { + let postBody = body; // verify the required parameter 'body' is set if (body === undefined || body === null) { @@ -116,25 +100,23 @@ } - var pathParams = { + let pathParams = { }; - var queryParams = { + let queryParams = { }; - var collectionQueryParams = { + let headerParams = { }; - var headerParams = { - }; - var formParams = { + let formParams = { }; - var authNames = []; - var contentTypes = []; - var accepts = ['application/xml', 'application/json']; - var returnType = null; + let authNames = []; + let contentTypes = []; + let accepts = ['application/xml', 'application/json']; + let returnType = null; return this.apiClient.callApi( '/user/createWithArray', 'POST', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType ); } @@ -145,7 +127,7 @@ * @param {Array.} body List of user object * @return {Promise} a {@link https://www.promisejs.org/|Promise} */ - this.createUsersWithArrayInput = function(body) { + createUsersWithArrayInput(body) { return this.createUsersWithArrayInputWithHttpInfo(body) .then(function(response_and_data) { return response_and_data.data; @@ -159,8 +141,8 @@ * @param {Array.} body List of user object * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ - this.createUsersWithListInputWithHttpInfo = function(body) { - var postBody = body; + createUsersWithListInputWithHttpInfo(body) { + let postBody = body; // verify the required parameter 'body' is set if (body === undefined || body === null) { @@ -168,25 +150,23 @@ } - var pathParams = { + let pathParams = { }; - var queryParams = { + let queryParams = { }; - var collectionQueryParams = { + let headerParams = { }; - var headerParams = { - }; - var formParams = { + let formParams = { }; - var authNames = []; - var contentTypes = []; - var accepts = ['application/xml', 'application/json']; - var returnType = null; + let authNames = []; + let contentTypes = []; + let accepts = ['application/xml', 'application/json']; + let returnType = null; return this.apiClient.callApi( '/user/createWithList', 'POST', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType ); } @@ -197,7 +177,7 @@ * @param {Array.} body List of user object * @return {Promise} a {@link https://www.promisejs.org/|Promise} */ - this.createUsersWithListInput = function(body) { + createUsersWithListInput(body) { return this.createUsersWithListInputWithHttpInfo(body) .then(function(response_and_data) { return response_and_data.data; @@ -211,8 +191,8 @@ * @param {String} username The name that needs to be deleted * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ - this.deleteUserWithHttpInfo = function(username) { - var postBody = null; + deleteUserWithHttpInfo(username) { + let postBody = null; // verify the required parameter 'username' is set if (username === undefined || username === null) { @@ -220,26 +200,24 @@ } - var pathParams = { + let pathParams = { 'username': username }; - var queryParams = { + let queryParams = { }; - var collectionQueryParams = { + let headerParams = { }; - var headerParams = { - }; - var formParams = { + let formParams = { }; - var authNames = []; - var contentTypes = []; - var accepts = ['application/xml', 'application/json']; - var returnType = null; + let authNames = []; + let contentTypes = []; + let accepts = ['application/xml', 'application/json']; + let returnType = null; return this.apiClient.callApi( '/user/{username}', 'DELETE', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType ); } @@ -250,7 +228,7 @@ * @param {String} username The name that needs to be deleted * @return {Promise} a {@link https://www.promisejs.org/|Promise} */ - this.deleteUser = function(username) { + deleteUser(username) { return this.deleteUserWithHttpInfo(username) .then(function(response_and_data) { return response_and_data.data; @@ -264,8 +242,8 @@ * @param {String} username The name that needs to be fetched. Use user1 for testing. * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/User} and HTTP response */ - this.getUserByNameWithHttpInfo = function(username) { - var postBody = null; + getUserByNameWithHttpInfo(username) { + let postBody = null; // verify the required parameter 'username' is set if (username === undefined || username === null) { @@ -273,26 +251,24 @@ } - var pathParams = { + let pathParams = { 'username': username }; - var queryParams = { + let queryParams = { }; - var collectionQueryParams = { + let headerParams = { }; - var headerParams = { - }; - var formParams = { + let formParams = { }; - var authNames = []; - var contentTypes = []; - var accepts = ['application/xml', 'application/json']; - var returnType = User; + let authNames = []; + let contentTypes = []; + let accepts = ['application/xml', 'application/json']; + let returnType = User; return this.apiClient.callApi( '/user/{username}', 'GET', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType ); } @@ -303,7 +279,7 @@ * @param {String} username The name that needs to be fetched. Use user1 for testing. * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/User} */ - this.getUserByName = function(username) { + getUserByName(username) { return this.getUserByNameWithHttpInfo(username) .then(function(response_and_data) { return response_and_data.data; @@ -318,8 +294,8 @@ * @param {String} password The password for login in clear text * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link 'String'} and HTTP response */ - this.loginUserWithHttpInfo = function(username, password) { - var postBody = null; + loginUserWithHttpInfo(username, password) { + let postBody = null; // verify the required parameter 'username' is set if (username === undefined || username === null) { @@ -332,27 +308,25 @@ } - var pathParams = { + let pathParams = { }; - var queryParams = { + let queryParams = { 'username': username, - 'password': password, + 'password': password }; - var collectionQueryParams = { + let headerParams = { }; - var headerParams = { - }; - var formParams = { + let formParams = { }; - var authNames = []; - var contentTypes = []; - var accepts = ['application/xml', 'application/json']; - var returnType = 'String'; + let authNames = []; + let contentTypes = []; + let accepts = ['application/xml', 'application/json']; + let returnType = 'String'; return this.apiClient.callApi( '/user/login', 'GET', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType ); } @@ -364,7 +338,7 @@ * @param {String} password The password for login in clear text * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link 'String'} */ - this.loginUser = function(username, password) { + loginUser(username, password) { return this.loginUserWithHttpInfo(username, password) .then(function(response_and_data) { return response_and_data.data; @@ -377,29 +351,27 @@ * * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ - this.logoutUserWithHttpInfo = function() { - var postBody = null; + logoutUserWithHttpInfo() { + let postBody = null; - var pathParams = { + let pathParams = { }; - var queryParams = { + let queryParams = { }; - var collectionQueryParams = { + let headerParams = { }; - var headerParams = { - }; - var formParams = { + let formParams = { }; - var authNames = []; - var contentTypes = []; - var accepts = ['application/xml', 'application/json']; - var returnType = null; + let authNames = []; + let contentTypes = []; + let accepts = ['application/xml', 'application/json']; + let returnType = null; return this.apiClient.callApi( '/user/logout', 'GET', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType ); } @@ -409,7 +381,7 @@ * * @return {Promise} a {@link https://www.promisejs.org/|Promise} */ - this.logoutUser = function() { + logoutUser() { return this.logoutUserWithHttpInfo() .then(function(response_and_data) { return response_and_data.data; @@ -424,8 +396,8 @@ * @param {module:model/User} body Updated user object * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ - this.updateUserWithHttpInfo = function(username, body) { - var postBody = body; + updateUserWithHttpInfo(username, body) { + let postBody = body; // verify the required parameter 'username' is set if (username === undefined || username === null) { @@ -438,26 +410,24 @@ } - var pathParams = { + let pathParams = { 'username': username }; - var queryParams = { + let queryParams = { }; - var collectionQueryParams = { + let headerParams = { }; - var headerParams = { - }; - var formParams = { + let formParams = { }; - var authNames = []; - var contentTypes = []; - var accepts = ['application/xml', 'application/json']; - var returnType = null; + let authNames = []; + let contentTypes = []; + let accepts = ['application/xml', 'application/json']; + let returnType = null; return this.apiClient.callApi( '/user/{username}', 'PUT', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType ); } @@ -469,13 +439,12 @@ * @param {module:model/User} body Updated user object * @return {Promise} a {@link https://www.promisejs.org/|Promise} */ - this.updateUser = function(username, body) { + updateUser(username, body) { return this.updateUserWithHttpInfo(username, body) .then(function(response_and_data) { return response_and_data.data; }); } - }; - return exports; -})); + +} diff --git a/samples/client/petstore/javascript-promise-es6/src/index.js b/samples/client/petstore/javascript-promise-es6/src/index.js index afc840ce758..9a8ff8e2e42 100644 --- a/samples/client/petstore/javascript-promise-es6/src/index.js +++ b/samples/client/petstore/javascript-promise-es6/src/index.js @@ -7,267 +7,336 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(function(factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['ApiClient', 'model/AdditionalPropertiesClass', 'model/Animal', 'model/AnimalFarm', 'model/ApiResponse', 'model/ArrayOfArrayOfNumberOnly', 'model/ArrayOfNumberOnly', 'model/ArrayTest', 'model/Capitalization', 'model/Category', 'model/ClassModel', 'model/Client', 'model/EnumArrays', 'model/EnumClass', 'model/EnumTest', 'model/FormatTest', 'model/HasOnlyReadOnly', 'model/List', 'model/MapTest', 'model/MixedPropertiesAndAdditionalPropertiesClass', 'model/Model200Response', 'model/ModelReturn', 'model/Name', 'model/NumberOnly', 'model/Order', 'model/OuterBoolean', 'model/OuterComposite', 'model/OuterEnum', 'model/OuterNumber', 'model/OuterString', 'model/Pet', 'model/ReadOnlyFirst', 'model/SpecialModelName', 'model/Tag', 'model/User', 'model/Cat', 'model/Dog', 'api/FakeApi', 'api/Fake_classname_tags123Api', '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/AdditionalPropertiesClass'), require('./model/Animal'), require('./model/AnimalFarm'), require('./model/ApiResponse'), require('./model/ArrayOfArrayOfNumberOnly'), require('./model/ArrayOfNumberOnly'), require('./model/ArrayTest'), require('./model/Capitalization'), require('./model/Category'), require('./model/ClassModel'), require('./model/Client'), require('./model/EnumArrays'), require('./model/EnumClass'), require('./model/EnumTest'), require('./model/FormatTest'), require('./model/HasOnlyReadOnly'), require('./model/List'), require('./model/MapTest'), require('./model/MixedPropertiesAndAdditionalPropertiesClass'), require('./model/Model200Response'), require('./model/ModelReturn'), require('./model/Name'), require('./model/NumberOnly'), require('./model/Order'), require('./model/OuterBoolean'), require('./model/OuterComposite'), require('./model/OuterEnum'), require('./model/OuterNumber'), require('./model/OuterString'), require('./model/Pet'), require('./model/ReadOnlyFirst'), require('./model/SpecialModelName'), require('./model/Tag'), require('./model/User'), require('./model/Cat'), require('./model/Dog'), require('./api/FakeApi'), require('./api/Fake_classname_tags123Api'), require('./api/PetApi'), require('./api/StoreApi'), require('./api/UserApi')); - } -}(function(ApiClient, AdditionalPropertiesClass, Animal, AnimalFarm, ApiResponse, ArrayOfArrayOfNumberOnly, ArrayOfNumberOnly, ArrayTest, Capitalization, Category, ClassModel, Client, EnumArrays, EnumClass, EnumTest, FormatTest, HasOnlyReadOnly, List, MapTest, MixedPropertiesAndAdditionalPropertiesClass, Model200Response, ModelReturn, Name, NumberOnly, Order, OuterBoolean, OuterComposite, OuterEnum, OuterNumber, OuterString, Pet, ReadOnlyFirst, SpecialModelName, Tag, User, Cat, Dog, FakeApi, Fake_classname_tags123Api, 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__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: - *

-   * var SwaggerPetstore = require('index'); // See note below*.
-   * var xxxSvc = new SwaggerPetstore.XxxApi(); // Allocate the API class we're going to use.
-   * var yyyModel = new SwaggerPetstore.Yyy(); // Construct a model instance.
-   * yyyModel.someProperty = 'someValue';
-   * ...
-   * var zzz = xxxSvc.doSomething(yyyModel); // Invoke the service.
-   * ...
-   * 
- * *NOTE: For a top-level AMD script, use require(['index'], function(){...}) - * and put the application logic within the callback function. - *

- *

- * A non-AMD browser application (discouraged) might do something like this: - *

-   * var xxxSvc = new SwaggerPetstore.XxxApi(); // Allocate the API class we're going to use.
-   * var yyy = new SwaggerPetstore.Yyy(); // Construct a model instance.
-   * yyyModel.someProperty = 'someValue';
-   * ...
-   * var zzz = xxxSvc.doSomething(yyyModel); // Invoke the service.
-   * ...
-   * 
- *

- * @module index - * @version 1.0.0 - */ - var exports = { +import ApiClient from './ApiClient'; +import AdditionalPropertiesClass from './model/AdditionalPropertiesClass'; +import Animal from './model/Animal'; +import AnimalFarm from './model/AnimalFarm'; +import ApiResponse from './model/ApiResponse'; +import ArrayOfArrayOfNumberOnly from './model/ArrayOfArrayOfNumberOnly'; +import ArrayOfNumberOnly from './model/ArrayOfNumberOnly'; +import ArrayTest from './model/ArrayTest'; +import Capitalization from './model/Capitalization'; +import Category from './model/Category'; +import ClassModel from './model/ClassModel'; +import Client from './model/Client'; +import EnumArrays from './model/EnumArrays'; +import EnumClass from './model/EnumClass'; +import EnumTest from './model/EnumTest'; +import FormatTest from './model/FormatTest'; +import HasOnlyReadOnly from './model/HasOnlyReadOnly'; +import List from './model/List'; +import MapTest from './model/MapTest'; +import MixedPropertiesAndAdditionalPropertiesClass from './model/MixedPropertiesAndAdditionalPropertiesClass'; +import Model200Response from './model/Model200Response'; +import ModelReturn from './model/ModelReturn'; +import Name from './model/Name'; +import NumberOnly from './model/NumberOnly'; +import Order from './model/Order'; +import OuterBoolean from './model/OuterBoolean'; +import OuterComposite from './model/OuterComposite'; +import OuterEnum from './model/OuterEnum'; +import OuterNumber from './model/OuterNumber'; +import OuterString from './model/OuterString'; +import Pet from './model/Pet'; +import ReadOnlyFirst from './model/ReadOnlyFirst'; +import SpecialModelName from './model/SpecialModelName'; +import Tag from './model/Tag'; +import User from './model/User'; +import Cat from './model/Cat'; +import Dog from './model/Dog'; +import FakeApi from './api/FakeApi'; +import Fake_classname_tags123Api from './api/Fake_classname_tags123Api'; +import PetApi from './api/PetApi'; +import StoreApi from './api/StoreApi'; +import UserApi from './api/UserApi'; + + +/** +* This_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: +*

+* var SwaggerPetstore = require('index'); // See note below*.
+* var xxxSvc = new SwaggerPetstore.XxxApi(); // Allocate the API class we're going to use.
+* var yyyModel = new SwaggerPetstore.Yyy(); // Construct a model instance.
+* yyyModel.someProperty = 'someValue';
+* ...
+* var zzz = xxxSvc.doSomething(yyyModel); // Invoke the service.
+* ...
+* 
+* *NOTE: For a top-level AMD script, use require(['index'], function(){...}) +* and put the application logic within the callback function. +*

+*

+* A non-AMD browser application (discouraged) might do something like this: +*

+* var xxxSvc = new SwaggerPetstore.XxxApi(); // Allocate the API class we're going to use.
+* var yyy = new SwaggerPetstore.Yyy(); // Construct a model instance.
+* yyyModel.someProperty = 'someValue';
+* ...
+* var zzz = xxxSvc.doSomething(yyyModel); // Invoke the service.
+* ...
+* 
+*

+* @module index +* @version 1.0.0 +*/ +export { /** * The ApiClient constructor. * @property {module:ApiClient} */ - ApiClient: ApiClient, + ApiClient, + /** * The AdditionalPropertiesClass model constructor. * @property {module:model/AdditionalPropertiesClass} */ - AdditionalPropertiesClass: AdditionalPropertiesClass, + AdditionalPropertiesClass, + /** * The Animal model constructor. * @property {module:model/Animal} */ - Animal: Animal, + Animal, + /** * The AnimalFarm model constructor. * @property {module:model/AnimalFarm} */ - AnimalFarm: AnimalFarm, + AnimalFarm, + /** * The ApiResponse model constructor. * @property {module:model/ApiResponse} */ - ApiResponse: ApiResponse, + ApiResponse, + /** * The ArrayOfArrayOfNumberOnly model constructor. * @property {module:model/ArrayOfArrayOfNumberOnly} */ - ArrayOfArrayOfNumberOnly: ArrayOfArrayOfNumberOnly, + ArrayOfArrayOfNumberOnly, + /** * The ArrayOfNumberOnly model constructor. * @property {module:model/ArrayOfNumberOnly} */ - ArrayOfNumberOnly: ArrayOfNumberOnly, + ArrayOfNumberOnly, + /** * The ArrayTest model constructor. * @property {module:model/ArrayTest} */ - ArrayTest: ArrayTest, + ArrayTest, + /** * The Capitalization model constructor. * @property {module:model/Capitalization} */ - Capitalization: Capitalization, + Capitalization, + /** * The Category model constructor. * @property {module:model/Category} */ - Category: Category, + Category, + /** * The ClassModel model constructor. * @property {module:model/ClassModel} */ - ClassModel: ClassModel, + ClassModel, + /** * The Client model constructor. * @property {module:model/Client} */ - Client: Client, + Client, + /** * The EnumArrays model constructor. * @property {module:model/EnumArrays} */ - EnumArrays: EnumArrays, + EnumArrays, + /** * The EnumClass model constructor. * @property {module:model/EnumClass} */ - EnumClass: EnumClass, + EnumClass, + /** * The EnumTest model constructor. * @property {module:model/EnumTest} */ - EnumTest: EnumTest, + EnumTest, + /** * The FormatTest model constructor. * @property {module:model/FormatTest} */ - FormatTest: FormatTest, + FormatTest, + /** * The HasOnlyReadOnly model constructor. * @property {module:model/HasOnlyReadOnly} */ - HasOnlyReadOnly: HasOnlyReadOnly, + HasOnlyReadOnly, + /** * The List model constructor. * @property {module:model/List} */ - List: List, + List, + /** * The MapTest model constructor. * @property {module:model/MapTest} */ - MapTest: MapTest, + MapTest, + /** * The MixedPropertiesAndAdditionalPropertiesClass model constructor. * @property {module:model/MixedPropertiesAndAdditionalPropertiesClass} */ - MixedPropertiesAndAdditionalPropertiesClass: MixedPropertiesAndAdditionalPropertiesClass, + MixedPropertiesAndAdditionalPropertiesClass, + /** * The Model200Response model constructor. * @property {module:model/Model200Response} */ - Model200Response: Model200Response, + Model200Response, + /** * The ModelReturn model constructor. * @property {module:model/ModelReturn} */ - ModelReturn: ModelReturn, + ModelReturn, + /** * The Name model constructor. * @property {module:model/Name} */ - Name: Name, + Name, + /** * The NumberOnly model constructor. * @property {module:model/NumberOnly} */ - NumberOnly: NumberOnly, + NumberOnly, + /** * The Order model constructor. * @property {module:model/Order} */ - Order: Order, + Order, + /** * The OuterBoolean model constructor. * @property {module:model/OuterBoolean} */ - OuterBoolean: OuterBoolean, + OuterBoolean, + /** * The OuterComposite model constructor. * @property {module:model/OuterComposite} */ - OuterComposite: OuterComposite, + OuterComposite, + /** * The OuterEnum model constructor. * @property {module:model/OuterEnum} */ - OuterEnum: OuterEnum, + OuterEnum, + /** * The OuterNumber model constructor. * @property {module:model/OuterNumber} */ - OuterNumber: OuterNumber, + OuterNumber, + /** * The OuterString model constructor. * @property {module:model/OuterString} */ - OuterString: OuterString, + OuterString, + /** * The Pet model constructor. * @property {module:model/Pet} */ - Pet: Pet, + Pet, + /** * The ReadOnlyFirst model constructor. * @property {module:model/ReadOnlyFirst} */ - ReadOnlyFirst: ReadOnlyFirst, + ReadOnlyFirst, + /** * The SpecialModelName model constructor. * @property {module:model/SpecialModelName} */ - SpecialModelName: SpecialModelName, + SpecialModelName, + /** * The Tag model constructor. * @property {module:model/Tag} */ - Tag: Tag, + Tag, + /** * The User model constructor. * @property {module:model/User} */ - User: User, + User, + /** * The Cat model constructor. * @property {module:model/Cat} */ - Cat: Cat, + Cat, + /** * The Dog model constructor. * @property {module:model/Dog} */ - Dog: Dog, - /** - * The FakeApi service constructor. - * @property {module:api/FakeApi} - */ - FakeApi: FakeApi, - /** - * The Fake_classname_tags123Api service constructor. - * @property {module:api/Fake_classname_tags123Api} - */ - Fake_classname_tags123Api: Fake_classname_tags123Api, - /** - * The PetApi service constructor. - * @property {module:api/PetApi} - */ - PetApi: PetApi, - /** - * The StoreApi service constructor. - * @property {module:api/StoreApi} - */ - StoreApi: StoreApi, - /** - * The UserApi service constructor. - * @property {module:api/UserApi} - */ - UserApi: UserApi - }; + Dog, - return exports; -})); + /** + * The FakeApi service constructor. + * @property {module:api/FakeApi} + */ + FakeApi, + + /** + * The Fake_classname_tags123Api service constructor. + * @property {module:api/Fake_classname_tags123Api} + */ + Fake_classname_tags123Api, + + /** + * The PetApi service constructor. + * @property {module:api/PetApi} + */ + PetApi, + + /** + * The StoreApi service constructor. + * @property {module:api/StoreApi} + */ + StoreApi, + + /** + * The UserApi service constructor. + * @property {module:api/UserApi} + */ + UserApi +}; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/AdditionalPropertiesClass.js b/samples/client/petstore/javascript-promise-es6/src/model/AdditionalPropertiesClass.js index 4399d89bdc3..088cbb29b35 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/AdditionalPropertiesClass.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/AdditionalPropertiesClass.js @@ -7,84 +7,81 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + + + + +/** +* The AdditionalPropertiesClass model module. +* @module model/AdditionalPropertiesClass +* @version 1.0.0 +*/ +export default class AdditionalPropertiesClass { + /** + * Constructs a new AdditionalPropertiesClass. + * @alias module:model/AdditionalPropertiesClass + * @class + */ + + constructor() { + + + + + + + + } - root.SwaggerPetstore.AdditionalPropertiesClass = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; + /** + * 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. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new AdditionalPropertiesClass(); + + + - - /** - * The AdditionalPropertiesClass model module. - * @module model/AdditionalPropertiesClass - * @version 1.0.0 - */ - - /** - * Constructs a new AdditionalPropertiesClass. - * @alias module:model/AdditionalPropertiesClass - * @class - */ - var exports = function() { - var _this = 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(); - - if (data.hasOwnProperty('map_property')) { - obj['map_property'] = ApiClient.convertToType(data['map_property'], {'String': 'String'}); - } - if (data.hasOwnProperty('map_of_map_property')) { - obj['map_of_map_property'] = ApiClient.convertToType(data['map_of_map_property'], {'String': {'String': 'String'}}); - } + if (data.hasOwnProperty('map_property')) { + obj['map_property'] = ApiClient.convertToType(data['map_property'], {'String': 'String'}); + } + if (data.hasOwnProperty('map_of_map_property')) { + obj['map_of_map_property'] = ApiClient.convertToType(data['map_of_map_property'], {'String': {'String': 'String'}}); + } + } + return obj; } - return obj; - } - /** - * @member {Object.} map_property - */ - exports.prototype['map_property'] = undefined; - /** - * @member {Object.>} map_of_map_property - */ - exports.prototype['map_of_map_property'] = undefined; + /** + * @member {Object.} map_property + */ + map_property = undefined; + /** + * @member {Object.>} map_of_map_property + */ + map_of_map_property = undefined; - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-promise-es6/src/model/Animal.js b/samples/client/petstore/javascript-promise-es6/src/model/Animal.js index eee2768eeb6..b3fb1a63f32 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/Animal.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/Animal.js @@ -7,86 +7,83 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + + + + +/** +* The Animal model module. +* @module model/Animal +* @version 1.0.0 +*/ +export default class Animal { + /** + * Constructs a new Animal. + * @alias module:model/Animal + * @class + * @param className {String} + */ + + constructor(className) { + + + + + + this['className'] = className; + + } - root.SwaggerPetstore.Animal = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; + /** + * Constructs a Animal 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/Animal} obj Optional instance to populate. + * @return {module:model/Animal} The populated Animal instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new Animal(); + + + - - /** - * The Animal model module. - * @module model/Animal - * @version 1.0.0 - */ - - /** - * Constructs a new Animal. - * @alias module:model/Animal - * @class - * @param className {String} - */ - var exports = function(className) { - var _this = this; - - _this['className'] = className; - - }; - - /** - * Constructs a Animal 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/Animal} obj Optional instance to populate. - * @return {module:model/Animal} The populated Animal instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - - if (data.hasOwnProperty('className')) { - obj['className'] = ApiClient.convertToType(data['className'], 'String'); - } - if (data.hasOwnProperty('color')) { - obj['color'] = ApiClient.convertToType(data['color'], 'String'); - } + if (data.hasOwnProperty('className')) { + obj['className'] = ApiClient.convertToType(data['className'], 'String'); + } + if (data.hasOwnProperty('color')) { + obj['color'] = ApiClient.convertToType(data['color'], 'String'); + } + } + return obj; } - return obj; - } - /** - * @member {String} className - */ - exports.prototype['className'] = undefined; - /** - * @member {String} color - * @default 'red' - */ - exports.prototype['color'] = 'red'; + /** + * @member {String} className + */ + className = undefined; + /** + * @member {String} color + * @default 'red' + */ + color = 'red'; - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-promise-es6/src/model/AnimalFarm.js b/samples/client/petstore/javascript-promise-es6/src/model/AnimalFarm.js index b24078dee2a..8dc9f00cadb 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/AnimalFarm.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/AnimalFarm.js @@ -7,73 +7,72 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; +import Animal from './Animal'; + + + + + +/** +* The AnimalFarm model module. +* @module model/AnimalFarm +* @version 1.0.0 +*/ +export default class AnimalFarm { + /** + * Constructs a new AnimalFarm. + * @alias module:model/AnimalFarm + * @class + * @extends Array + */ + + constructor() { + + this = new Array(); + Object.setPrototypeOf(this, AnimalFarm); + + + + + + + return this; } - root.SwaggerPetstore.AnimalFarm = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.Animal); - } -}(this, function(ApiClient, Animal) { - 'use strict'; + /** + * Constructs a AnimalFarm 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/AnimalFarm} obj Optional instance to populate. + * @return {module:model/AnimalFarm} The populated AnimalFarm instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new AnimalFarm(); + ApiClient.constructFromObject(data, obj, 'Animal'); + + - /** - * The AnimalFarm model module. - * @module model/AnimalFarm - * @version 1.0.0 - */ - - /** - * Constructs a new AnimalFarm. - * @alias module:model/AnimalFarm - * @class - * @extends Array - */ - var exports = function() { - var _this = this; - _this = new Array(); - Object.setPrototypeOf(_this, exports); - - return _this; - }; - - /** - * Constructs a AnimalFarm 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/AnimalFarm} obj Optional instance to populate. - * @return {module:model/AnimalFarm} The populated AnimalFarm instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - ApiClient.constructFromObject(data, obj, 'Animal'); - + } + return obj; } - return obj; - } - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-promise-es6/src/model/ApiResponse.js b/samples/client/petstore/javascript-promise-es6/src/model/ApiResponse.js index 9588ce4cf31..49ddd1ac27f 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/ApiResponse.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/ApiResponse.js @@ -7,92 +7,88 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + + + + +/** +* The ApiResponse model module. +* @module model/ApiResponse +* @version 1.0.0 +*/ +export default class ApiResponse { + /** + * Constructs a new ApiResponse. + * @alias module:model/ApiResponse + * @class + */ + + constructor() { + + + + + + + + } - root.SwaggerPetstore.ApiResponse = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; + /** + * Constructs a ApiResponse 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/ApiResponse} obj Optional instance to populate. + * @return {module:model/ApiResponse} The populated ApiResponse instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new ApiResponse(); + + + - - /** - * The ApiResponse model module. - * @module model/ApiResponse - * @version 1.0.0 - */ - - /** - * Constructs a new ApiResponse. - * @alias module:model/ApiResponse - * @class - */ - var exports = function() { - var _this = this; - - - - - }; - - /** - * Constructs a ApiResponse 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/ApiResponse} obj Optional instance to populate. - * @return {module:model/ApiResponse} The populated ApiResponse instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - - if (data.hasOwnProperty('code')) { - obj['code'] = ApiClient.convertToType(data['code'], 'Number'); - } - if (data.hasOwnProperty('type')) { - obj['type'] = ApiClient.convertToType(data['type'], 'String'); - } - if (data.hasOwnProperty('message')) { - obj['message'] = ApiClient.convertToType(data['message'], 'String'); - } + if (data.hasOwnProperty('code')) { + obj['code'] = ApiClient.convertToType(data['code'], 'Number'); + } + if (data.hasOwnProperty('type')) { + obj['type'] = ApiClient.convertToType(data['type'], 'String'); + } + if (data.hasOwnProperty('message')) { + obj['message'] = ApiClient.convertToType(data['message'], 'String'); + } + } + return obj; } - return obj; - } - /** - * @member {Number} code - */ - exports.prototype['code'] = undefined; - /** - * @member {String} type - */ - exports.prototype['type'] = undefined; - /** - * @member {String} message - */ - exports.prototype['message'] = undefined; + /** + * @member {Number} code + */ + code = undefined; + /** + * @member {String} type + */ + type = undefined; + /** + * @member {String} message + */ + message = undefined; - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-promise-es6/src/model/ArrayOfArrayOfNumberOnly.js b/samples/client/petstore/javascript-promise-es6/src/model/ArrayOfArrayOfNumberOnly.js index 0b91fc04338..1dfd4487c62 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/ArrayOfArrayOfNumberOnly.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/ArrayOfArrayOfNumberOnly.js @@ -7,76 +7,74 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + + + + +/** +* The ArrayOfArrayOfNumberOnly model module. +* @module model/ArrayOfArrayOfNumberOnly +* @version 1.0.0 +*/ +export default class ArrayOfArrayOfNumberOnly { + /** + * Constructs a new ArrayOfArrayOfNumberOnly. + * @alias module:model/ArrayOfArrayOfNumberOnly + * @class + */ + + constructor() { + + + + + + + + } - root.SwaggerPetstore.ArrayOfArrayOfNumberOnly = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; + /** + * Constructs a ArrayOfArrayOfNumberOnly 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/ArrayOfArrayOfNumberOnly} obj Optional instance to populate. + * @return {module:model/ArrayOfArrayOfNumberOnly} The populated ArrayOfArrayOfNumberOnly instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new ArrayOfArrayOfNumberOnly(); + + + - - /** - * The ArrayOfArrayOfNumberOnly model module. - * @module model/ArrayOfArrayOfNumberOnly - * @version 1.0.0 - */ - - /** - * Constructs a new ArrayOfArrayOfNumberOnly. - * @alias module:model/ArrayOfArrayOfNumberOnly - * @class - */ - var exports = function() { - var _this = this; - - - }; - - /** - * Constructs a ArrayOfArrayOfNumberOnly 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/ArrayOfArrayOfNumberOnly} obj Optional instance to populate. - * @return {module:model/ArrayOfArrayOfNumberOnly} The populated ArrayOfArrayOfNumberOnly instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - - if (data.hasOwnProperty('ArrayArrayNumber')) { - obj['ArrayArrayNumber'] = ApiClient.convertToType(data['ArrayArrayNumber'], [['Number']]); - } + if (data.hasOwnProperty('ArrayArrayNumber')) { + obj['ArrayArrayNumber'] = ApiClient.convertToType(data['ArrayArrayNumber'], [['Number']]); + } + } + return obj; } - return obj; - } - /** - * @member {Array.>} ArrayArrayNumber - */ - exports.prototype['ArrayArrayNumber'] = undefined; + /** + * @member {Array.>} ArrayArrayNumber + */ + ArrayArrayNumber = undefined; - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-promise-es6/src/model/ArrayOfNumberOnly.js b/samples/client/petstore/javascript-promise-es6/src/model/ArrayOfNumberOnly.js index f79ab37c076..379a19ba3ff 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/ArrayOfNumberOnly.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/ArrayOfNumberOnly.js @@ -7,76 +7,74 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + + + + +/** +* The ArrayOfNumberOnly model module. +* @module model/ArrayOfNumberOnly +* @version 1.0.0 +*/ +export default class ArrayOfNumberOnly { + /** + * Constructs a new ArrayOfNumberOnly. + * @alias module:model/ArrayOfNumberOnly + * @class + */ + + constructor() { + + + + + + + + } - root.SwaggerPetstore.ArrayOfNumberOnly = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; + /** + * Constructs a ArrayOfNumberOnly 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/ArrayOfNumberOnly} obj Optional instance to populate. + * @return {module:model/ArrayOfNumberOnly} The populated ArrayOfNumberOnly instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new ArrayOfNumberOnly(); + + + - - /** - * The ArrayOfNumberOnly model module. - * @module model/ArrayOfNumberOnly - * @version 1.0.0 - */ - - /** - * Constructs a new ArrayOfNumberOnly. - * @alias module:model/ArrayOfNumberOnly - * @class - */ - var exports = function() { - var _this = this; - - - }; - - /** - * Constructs a ArrayOfNumberOnly 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/ArrayOfNumberOnly} obj Optional instance to populate. - * @return {module:model/ArrayOfNumberOnly} The populated ArrayOfNumberOnly instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - - if (data.hasOwnProperty('ArrayNumber')) { - obj['ArrayNumber'] = ApiClient.convertToType(data['ArrayNumber'], ['Number']); - } + if (data.hasOwnProperty('ArrayNumber')) { + obj['ArrayNumber'] = ApiClient.convertToType(data['ArrayNumber'], ['Number']); + } + } + return obj; } - return obj; - } - /** - * @member {Array.} ArrayNumber - */ - exports.prototype['ArrayNumber'] = undefined; + /** + * @member {Array.} ArrayNumber + */ + ArrayNumber = undefined; - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-promise-es6/src/model/ArrayTest.js b/samples/client/petstore/javascript-promise-es6/src/model/ArrayTest.js index 8698b21a153..58e9ac58840 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/ArrayTest.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/ArrayTest.js @@ -7,92 +7,89 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(function(root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['ApiClient', 'model/ReadOnlyFirst'], factory); - } else if (typeof module === 'object' && module.exports) { - // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('../ApiClient'), require('./ReadOnlyFirst')); - } else { - // Browser globals (root is window) - if (!root.SwaggerPetstore) { - root.SwaggerPetstore = {}; + +import ApiClient from '../ApiClient'; +import ReadOnlyFirst from './ReadOnlyFirst'; + + + + + +/** +* The ArrayTest model module. +* @module model/ArrayTest +* @version 1.0.0 +*/ +export default class ArrayTest { + /** + * Constructs a new ArrayTest. + * @alias module:model/ArrayTest + * @class + */ + + constructor() { + + + + + + + + } - root.SwaggerPetstore.ArrayTest = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.ReadOnlyFirst); - } -}(this, function(ApiClient, ReadOnlyFirst) { - 'use strict'; + /** + * 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. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new ArrayTest(); + + + - - /** - * 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(); - - if (data.hasOwnProperty('array_of_string')) { - obj['array_of_string'] = ApiClient.convertToType(data['array_of_string'], ['String']); - } - if (data.hasOwnProperty('array_array_of_integer')) { - obj['array_array_of_integer'] = ApiClient.convertToType(data['array_array_of_integer'], [['Number']]); - } - if (data.hasOwnProperty('array_array_of_model')) { - obj['array_array_of_model'] = ApiClient.convertToType(data['array_array_of_model'], [[ReadOnlyFirst]]); - } + if (data.hasOwnProperty('array_of_string')) { + obj['array_of_string'] = ApiClient.convertToType(data['array_of_string'], ['String']); + } + if (data.hasOwnProperty('array_array_of_integer')) { + obj['array_array_of_integer'] = ApiClient.convertToType(data['array_array_of_integer'], [['Number']]); + } + if (data.hasOwnProperty('array_array_of_model')) { + obj['array_array_of_model'] = ApiClient.convertToType(data['array_array_of_model'], [[ReadOnlyFirst]]); + } + } + return obj; } - return obj; - } - /** - * @member {Array.} array_of_string - */ - exports.prototype['array_of_string'] = undefined; - /** - * @member {Array.>} array_array_of_integer - */ - exports.prototype['array_array_of_integer'] = undefined; - /** - * @member {Array.>} array_array_of_model - */ - exports.prototype['array_array_of_model'] = undefined; + /** + * @member {Array.} array_of_string + */ + array_of_string = undefined; + /** + * @member {Array.>} array_array_of_integer + */ + array_array_of_integer = undefined; + /** + * @member {Array.>} array_array_of_model + */ + array_array_of_model = undefined; - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-promise-es6/src/model/Capitalization.js b/samples/client/petstore/javascript-promise-es6/src/model/Capitalization.js index e4d1cce1e92..12f3f3f5593 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/Capitalization.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/Capitalization.js @@ -7,117 +7,110 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + + + + +/** +* The Capitalization model module. +* @module model/Capitalization +* @version 1.0.0 +*/ +export default class Capitalization { + /** + * Constructs a new Capitalization. + * @alias module:model/Capitalization + * @class + */ + + constructor() { + + + + + + + + } - root.SwaggerPetstore.Capitalization = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; + /** + * Constructs a Capitalization 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/Capitalization} obj Optional instance to populate. + * @return {module:model/Capitalization} The populated Capitalization instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new Capitalization(); + + + - - /** - * The Capitalization model module. - * @module model/Capitalization - * @version 1.0.0 - */ - - /** - * Constructs a new Capitalization. - * @alias module:model/Capitalization - * @class - */ - var exports = function() { - var _this = this; - - - - - - - - }; - - /** - * Constructs a Capitalization 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/Capitalization} obj Optional instance to populate. - * @return {module:model/Capitalization} The populated Capitalization instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - - if (data.hasOwnProperty('smallCamel')) { - obj['smallCamel'] = ApiClient.convertToType(data['smallCamel'], 'String'); - } - if (data.hasOwnProperty('CapitalCamel')) { - obj['CapitalCamel'] = ApiClient.convertToType(data['CapitalCamel'], 'String'); - } - if (data.hasOwnProperty('small_Snake')) { - obj['small_Snake'] = ApiClient.convertToType(data['small_Snake'], 'String'); - } - if (data.hasOwnProperty('Capital_Snake')) { - obj['Capital_Snake'] = ApiClient.convertToType(data['Capital_Snake'], 'String'); - } - if (data.hasOwnProperty('SCA_ETH_Flow_Points')) { - obj['SCA_ETH_Flow_Points'] = ApiClient.convertToType(data['SCA_ETH_Flow_Points'], 'String'); - } - if (data.hasOwnProperty('ATT_NAME')) { - obj['ATT_NAME'] = ApiClient.convertToType(data['ATT_NAME'], 'String'); - } + if (data.hasOwnProperty('smallCamel')) { + obj['smallCamel'] = ApiClient.convertToType(data['smallCamel'], 'String'); + } + if (data.hasOwnProperty('CapitalCamel')) { + obj['CapitalCamel'] = ApiClient.convertToType(data['CapitalCamel'], 'String'); + } + if (data.hasOwnProperty('small_Snake')) { + obj['small_Snake'] = ApiClient.convertToType(data['small_Snake'], 'String'); + } + if (data.hasOwnProperty('Capital_Snake')) { + obj['Capital_Snake'] = ApiClient.convertToType(data['Capital_Snake'], 'String'); + } + if (data.hasOwnProperty('SCA_ETH_Flow_Points')) { + obj['SCA_ETH_Flow_Points'] = ApiClient.convertToType(data['SCA_ETH_Flow_Points'], 'String'); + } + if (data.hasOwnProperty('ATT_NAME')) { + obj['ATT_NAME'] = ApiClient.convertToType(data['ATT_NAME'], 'String'); + } + } + return obj; } - return obj; - } - /** - * @member {String} smallCamel - */ - exports.prototype['smallCamel'] = undefined; - /** - * @member {String} CapitalCamel - */ - exports.prototype['CapitalCamel'] = undefined; - /** - * @member {String} small_Snake - */ - exports.prototype['small_Snake'] = undefined; - /** - * @member {String} Capital_Snake - */ - exports.prototype['Capital_Snake'] = undefined; - /** - * @member {String} SCA_ETH_Flow_Points - */ - exports.prototype['SCA_ETH_Flow_Points'] = undefined; - /** - * Name of the pet - * @member {String} ATT_NAME - */ - exports.prototype['ATT_NAME'] = undefined; + /** + * @member {String} smallCamel + */ + smallCamel = undefined; + /** + * @member {String} CapitalCamel + */ + CapitalCamel = undefined; + /** + * @member {String} small_Snake + */ + small_Snake = undefined; + /** + * @member {String} Capital_Snake + */ + Capital_Snake = undefined; + /** + * @member {String} SCA_ETH_Flow_Points + */ + SCA_ETH_Flow_Points = undefined; + /** + * Name of the pet + * @member {String} ATT_NAME + */ + ATT_NAME = undefined; - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-promise-es6/src/model/Cat.js b/samples/client/petstore/javascript-promise-es6/src/model/Cat.js index 55f0a0c9834..da946664d08 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/Cat.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/Cat.js @@ -7,81 +7,78 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; +import Animal from './Animal'; + + + + + +/** +* The Cat model module. +* @module model/Cat +* @version 1.0.0 +*/ +export default class Cat { + /** + * Constructs a new Cat. + * @alias module:model/Cat + * @class + * @extends module:model/Animal + * @param className {String} + */ + + constructor(className) { + + + Animal.call(this, className); + + + + + } - root.SwaggerPetstore.Cat = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.Animal); - } -}(this, function(ApiClient, Animal) { - 'use strict'; + /** + * Constructs a Cat 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/Cat} obj Optional instance to populate. + * @return {module:model/Cat} The populated Cat instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new Cat(); + + Animal.constructFromObject(data, obj); + - /** - * The Cat model module. - * @module model/Cat - * @version 1.0.0 - */ - - /** - * Constructs a new Cat. - * @alias module:model/Cat - * @class - * @extends module:model/Animal - * @param className {String} - */ - var exports = function(className) { - var _this = this; - Animal.call(_this, className); - - }; - - /** - * Constructs a Cat 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/Cat} obj Optional instance to populate. - * @return {module:model/Cat} The populated Cat instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - Animal.constructFromObject(data, obj); - if (data.hasOwnProperty('declawed')) { - obj['declawed'] = ApiClient.convertToType(data['declawed'], 'Boolean'); - } + if (data.hasOwnProperty('declawed')) { + obj['declawed'] = ApiClient.convertToType(data['declawed'], 'Boolean'); + } + } + return obj; } - return obj; - } - exports.prototype = Object.create(Animal.prototype); - exports.prototype.constructor = exports; - - /** - * @member {Boolean} declawed - */ - exports.prototype['declawed'] = undefined; + /** + * @member {Boolean} declawed + */ + declawed = undefined; - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-promise-es6/src/model/Category.js b/samples/client/petstore/javascript-promise-es6/src/model/Category.js index 37f547c79a1..a281817b72f 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/Category.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/Category.js @@ -7,84 +7,81 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + + + + +/** +* The Category model module. +* @module model/Category +* @version 1.0.0 +*/ +export default class Category { + /** + * Constructs a new Category. + * @alias module:model/Category + * @class + */ + + constructor() { + + + + + + + + } - root.SwaggerPetstore.Category = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; + /** + * Constructs a Category 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/Category} obj Optional instance to populate. + * @return {module:model/Category} The populated Category instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new Category(); + + + - - /** - * The Category model module. - * @module model/Category - * @version 1.0.0 - */ - - /** - * Constructs a new Category. - * @alias module:model/Category - * @class - */ - var exports = function() { - var _this = this; - - - - }; - - /** - * Constructs a Category 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/Category} obj Optional instance to populate. - * @return {module:model/Category} The populated Category instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - - if (data.hasOwnProperty('id')) { - obj['id'] = ApiClient.convertToType(data['id'], 'Number'); - } - if (data.hasOwnProperty('name')) { - obj['name'] = ApiClient.convertToType(data['name'], 'String'); - } + if (data.hasOwnProperty('id')) { + obj['id'] = ApiClient.convertToType(data['id'], 'Number'); + } + if (data.hasOwnProperty('name')) { + obj['name'] = ApiClient.convertToType(data['name'], 'String'); + } + } + return obj; } - return obj; - } - /** - * @member {Number} id - */ - exports.prototype['id'] = undefined; - /** - * @member {String} name - */ - exports.prototype['name'] = undefined; + /** + * @member {Number} id + */ + id = undefined; + /** + * @member {String} name + */ + name = undefined; - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-promise-es6/src/model/ClassModel.js b/samples/client/petstore/javascript-promise-es6/src/model/ClassModel.js index bd390a22524..6a558444ade 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/ClassModel.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/ClassModel.js @@ -7,77 +7,75 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + + + + +/** +* The ClassModel model module. +* @module model/ClassModel +* @version 1.0.0 +*/ +export default class ClassModel { + /** + * Constructs a new ClassModel. + * Model for testing model with \"_class\" property + * @alias module:model/ClassModel + * @class + */ + + constructor() { + + + + + + + + } - root.SwaggerPetstore.ClassModel = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; + /** + * Constructs a ClassModel 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/ClassModel} obj Optional instance to populate. + * @return {module:model/ClassModel} The populated ClassModel instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new ClassModel(); + + + - - /** - * The ClassModel model module. - * @module model/ClassModel - * @version 1.0.0 - */ - - /** - * Constructs a new ClassModel. - * Model for testing model with \"_class\" property - * @alias module:model/ClassModel - * @class - */ - var exports = function() { - var _this = this; - - - }; - - /** - * Constructs a ClassModel 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/ClassModel} obj Optional instance to populate. - * @return {module:model/ClassModel} The populated ClassModel instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - - if (data.hasOwnProperty('_class')) { - obj['_class'] = ApiClient.convertToType(data['_class'], 'String'); - } + if (data.hasOwnProperty('_class')) { + obj['_class'] = ApiClient.convertToType(data['_class'], 'String'); + } + } + return obj; } - return obj; - } - /** - * @member {String} _class - */ - exports.prototype['_class'] = undefined; + /** + * @member {String} _class + */ + _class = undefined; - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-promise-es6/src/model/Client.js b/samples/client/petstore/javascript-promise-es6/src/model/Client.js index 21add8d7f98..a4f9b235154 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/Client.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/Client.js @@ -7,76 +7,74 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + + + + +/** +* The Client model module. +* @module model/Client +* @version 1.0.0 +*/ +export default class Client { + /** + * Constructs a new Client. + * @alias module:model/Client + * @class + */ + + constructor() { + + + + + + + + } - root.SwaggerPetstore.Client = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; + /** + * Constructs a Client 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/Client} obj Optional instance to populate. + * @return {module:model/Client} The populated Client instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new Client(); + + + - - /** - * The Client model module. - * @module model/Client - * @version 1.0.0 - */ - - /** - * Constructs a new Client. - * @alias module:model/Client - * @class - */ - var exports = function() { - var _this = this; - - - }; - - /** - * Constructs a Client 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/Client} obj Optional instance to populate. - * @return {module:model/Client} The populated Client instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - - if (data.hasOwnProperty('client')) { - obj['client'] = ApiClient.convertToType(data['client'], 'String'); - } + if (data.hasOwnProperty('client')) { + obj['client'] = ApiClient.convertToType(data['client'], 'String'); + } + } + return obj; } - return obj; - } - /** - * @member {String} client - */ - exports.prototype['client'] = undefined; + /** + * @member {String} client + */ + client = undefined; - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-promise-es6/src/model/Dog.js b/samples/client/petstore/javascript-promise-es6/src/model/Dog.js index f567953b625..e5bc0d3cecf 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/Dog.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/Dog.js @@ -7,81 +7,78 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; +import Animal from './Animal'; + + + + + +/** +* The Dog model module. +* @module model/Dog +* @version 1.0.0 +*/ +export default class Dog { + /** + * Constructs a new Dog. + * @alias module:model/Dog + * @class + * @extends module:model/Animal + * @param className {String} + */ + + constructor(className) { + + + Animal.call(this, className); + + + + + } - root.SwaggerPetstore.Dog = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.Animal); - } -}(this, function(ApiClient, Animal) { - 'use strict'; + /** + * Constructs a Dog 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/Dog} obj Optional instance to populate. + * @return {module:model/Dog} The populated Dog instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new Dog(); + + Animal.constructFromObject(data, obj); + - /** - * The Dog model module. - * @module model/Dog - * @version 1.0.0 - */ - - /** - * Constructs a new Dog. - * @alias module:model/Dog - * @class - * @extends module:model/Animal - * @param className {String} - */ - var exports = function(className) { - var _this = this; - Animal.call(_this, className); - - }; - - /** - * Constructs a Dog 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/Dog} obj Optional instance to populate. - * @return {module:model/Dog} The populated Dog instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - Animal.constructFromObject(data, obj); - if (data.hasOwnProperty('breed')) { - obj['breed'] = ApiClient.convertToType(data['breed'], 'String'); - } + if (data.hasOwnProperty('breed')) { + obj['breed'] = ApiClient.convertToType(data['breed'], 'String'); + } + } + return obj; } - return obj; - } - exports.prototype = Object.create(Animal.prototype); - exports.prototype.constructor = exports; - - /** - * @member {String} breed - */ - exports.prototype['breed'] = undefined; + /** + * @member {String} breed + */ + breed = undefined; - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-promise-es6/src/model/EnumArrays.js b/samples/client/petstore/javascript-promise-es6/src/model/EnumArrays.js index 00036542ba7..20a74f0d883 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/EnumArrays.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/EnumArrays.js @@ -7,118 +7,121 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + + + + +/** +* The EnumArrays model module. +* @module model/EnumArrays +* @version 1.0.0 +*/ +export default class EnumArrays { + /** + * Constructs a new EnumArrays. + * @alias module:model/EnumArrays + * @class + */ + + constructor() { + + + + + + + + } - root.SwaggerPetstore.EnumArrays = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; + /** + * Constructs a EnumArrays 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/EnumArrays} obj Optional instance to populate. + * @return {module:model/EnumArrays} The populated EnumArrays instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new EnumArrays(); + + + - - /** - * The EnumArrays model module. - * @module model/EnumArrays - * @version 1.0.0 - */ - - /** - * Constructs a new EnumArrays. - * @alias module:model/EnumArrays - * @class - */ - var exports = function() { - var _this = this; - - - - }; - - /** - * Constructs a EnumArrays 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/EnumArrays} obj Optional instance to populate. - * @return {module:model/EnumArrays} The populated EnumArrays instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - - if (data.hasOwnProperty('just_symbol')) { - obj['just_symbol'] = ApiClient.convertToType(data['just_symbol'], 'String'); - } - if (data.hasOwnProperty('array_enum')) { - obj['array_enum'] = ApiClient.convertToType(data['array_enum'], ['String']); - } + if (data.hasOwnProperty('just_symbol')) { + obj['just_symbol'] = ApiClient.convertToType(data['just_symbol'], 'String'); + } + if (data.hasOwnProperty('array_enum')) { + obj['array_enum'] = ApiClient.convertToType(data['array_enum'], ['String']); + } + } + return obj; } - return obj; - } - /** - * @member {module:model/EnumArrays.JustSymbolEnum} just_symbol - */ - exports.prototype['just_symbol'] = undefined; - /** - * @member {Array.} array_enum - */ - exports.prototype['array_enum'] = undefined; - - - /** - * Allowed values for the just_symbol property. - * @enum {String} - * @readonly - */ - exports.JustSymbolEnum = { /** - * value: ">=" - * @const - */ - "GREATER_THAN_OR_EQUAL_TO": ">=", + * @member {module:model/EnumArrays.JustSymbolEnum} just_symbol + */ + just_symbol = undefined; /** - * value: "$" - * @const - */ - "DOLLAR": "$" }; + * @member {Array.} array_enum + */ + array_enum = undefined; + + + + + - /** - * Allowed values for the arrayEnum property. - * @enum {String} - * @readonly - */ - exports.ArrayEnumEnum = { /** - * value: "fish" - * @const - */ - "fish": "fish", + * Allowed values for the just_symbol property. + * @enum {String} + * @readonly + */ + static JustSymbolEnum = { + + /** + * value: ">=" + * @const + */ + "GREATER_THAN_OR_EQUAL_TO": ">=", + + /** + * value: "$" + * @const + */ + "DOLLAR": "$" + }; + /** - * value: "crab" - * @const - */ - "crab": "crab" }; + * Allowed values for the arrayEnum property. + * @enum {String} + * @readonly + */ + static ArrayEnumEnum = { + + /** + * value: "fish" + * @const + */ + "fish": "fish", + + /** + * value: "crab" + * @const + */ + "crab": "crab" + }; - return exports; -})); + +} diff --git a/samples/client/petstore/javascript-promise-es6/src/model/EnumClass.js b/samples/client/petstore/javascript-promise-es6/src/model/EnumClass.js index f03ab350d2f..eeb08ca2864 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/EnumClass.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/EnumClass.js @@ -7,63 +7,51 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + +/** +* Enum class EnumClass. +* @enum {} +* @readonly +*/ +export default class EnumClass { + + /** + * value: "_abc" + * @const + */ + _abc = "_abc"; + + + /** + * value: "-efg" + * @const + */ + -efg = "-efg"; + + + /** + * value: "(xyz)" + * @const + */ + (xyz) = "(xyz)"; + + + + /** + * Returns a EnumClass enum value from a Javascript object name. + * @param {Object} data The plain JavaScript object containing the name of the enum value. + * @return {module:model/EnumClass} The enum EnumClass value. + */ + static constructFromObject(object) { + return object; } - root.SwaggerPetstore.EnumClass = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; - - - /** - * Enum class EnumClass. - * @enum {} - * @readonly - */ - var exports = { - /** - * value: "_abc" - * @const - */ - "_abc": "_abc", - /** - * value: "-efg" - * @const - */ - "-efg": "-efg", - /** - * value: "(xyz)" - * @const - */ - "(xyz)": "(xyz)" }; - - /** - * Returns a EnumClass enum value from a Javascript object name. - * @param {Object} data The plain JavaScript object containing the name of the enum value. - * @return {module:model/EnumClass} The enum EnumClass value. - */ - exports.constructFromObject = function(object) { - return object; - } - - return exports; -})); +} diff --git a/samples/client/petstore/javascript-promise-es6/src/model/EnumTest.js b/samples/client/petstore/javascript-promise-es6/src/model/EnumTest.js index 3e7c9311aaf..b1f9b0b6c69 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/EnumTest.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/EnumTest.js @@ -7,156 +7,162 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(function(root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['ApiClient', 'model/OuterEnum'], factory); - } else if (typeof module === 'object' && module.exports) { - // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('../ApiClient'), require('./OuterEnum')); - } else { - // Browser globals (root is window) - if (!root.SwaggerPetstore) { - root.SwaggerPetstore = {}; + +import ApiClient from '../ApiClient'; +import OuterEnum from './OuterEnum'; + + + + + +/** +* The EnumTest model module. +* @module model/EnumTest +* @version 1.0.0 +*/ +export default class EnumTest { + /** + * Constructs a new EnumTest. + * @alias module:model/EnumTest + * @class + */ + + constructor() { + + + + + + + + } - root.SwaggerPetstore.EnumTest = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.OuterEnum); - } -}(this, function(ApiClient, OuterEnum) { - 'use strict'; + /** + * Constructs a EnumTest 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/EnumTest} obj Optional instance to populate. + * @return {module:model/EnumTest} The populated EnumTest instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new EnumTest(); + + + - - /** - * The EnumTest model module. - * @module model/EnumTest - * @version 1.0.0 - */ - - /** - * Constructs a new EnumTest. - * @alias module:model/EnumTest - * @class - */ - var exports = function() { - var _this = this; - - - - - - }; - - /** - * Constructs a EnumTest 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/EnumTest} obj Optional instance to populate. - * @return {module:model/EnumTest} The populated EnumTest instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - - if (data.hasOwnProperty('enum_string')) { - obj['enum_string'] = ApiClient.convertToType(data['enum_string'], 'String'); - } - if (data.hasOwnProperty('enum_integer')) { - obj['enum_integer'] = ApiClient.convertToType(data['enum_integer'], 'Number'); - } - if (data.hasOwnProperty('enum_number')) { - obj['enum_number'] = ApiClient.convertToType(data['enum_number'], 'Number'); - } - if (data.hasOwnProperty('outerEnum')) { - obj['outerEnum'] = OuterEnum.constructFromObject(data['outerEnum']); - } + if (data.hasOwnProperty('enum_string')) { + obj['enum_string'] = ApiClient.convertToType(data['enum_string'], 'String'); + } + if (data.hasOwnProperty('enum_integer')) { + obj['enum_integer'] = ApiClient.convertToType(data['enum_integer'], 'Number'); + } + if (data.hasOwnProperty('enum_number')) { + obj['enum_number'] = ApiClient.convertToType(data['enum_number'], 'Number'); + } + if (data.hasOwnProperty('outerEnum')) { + obj['outerEnum'] = OuterEnum.constructFromObject(data['outerEnum']); + } + } + return obj; } - return obj; - } - /** - * @member {module:model/EnumTest.EnumStringEnum} enum_string - */ - exports.prototype['enum_string'] = undefined; - /** - * @member {module:model/EnumTest.EnumIntegerEnum} enum_integer - */ - exports.prototype['enum_integer'] = undefined; - /** - * @member {module:model/EnumTest.EnumNumberEnum} enum_number - */ - exports.prototype['enum_number'] = undefined; - /** - * @member {module:model/OuterEnum} outerEnum - */ - exports.prototype['outerEnum'] = undefined; - - - /** - * Allowed values for the enum_string property. - * @enum {String} - * @readonly - */ - exports.EnumStringEnum = { /** - * value: "UPPER" - * @const - */ - "UPPER": "UPPER", + * @member {module:model/EnumTest.EnumStringEnum} enum_string + */ + enum_string = undefined; /** - * value: "lower" - * @const - */ - "lower": "lower", + * @member {module:model/EnumTest.EnumIntegerEnum} enum_integer + */ + enum_integer = undefined; /** - * value: "" - * @const - */ - "empty": "" }; - - /** - * Allowed values for the enum_integer property. - * @enum {Number} - * @readonly - */ - exports.EnumIntegerEnum = { + * @member {module:model/EnumTest.EnumNumberEnum} enum_number + */ + enum_number = undefined; /** - * value: 1 - * @const - */ - "1": 1, - /** - * value: -1 - * @const - */ - "-1": -1 }; - - /** - * Allowed values for the enum_number property. - * @enum {Number} - * @readonly - */ - exports.EnumNumberEnum = { - /** - * value: 1.1 - * @const - */ - "1.1": 1.1, - /** - * value: -1.2 - * @const - */ - "-1.2": -1.2 }; + * @member {module:model/OuterEnum} outerEnum + */ + outerEnum = undefined; - return exports; -})); + + + + + /** + * Allowed values for the enum_string property. + * @enum {String} + * @readonly + */ + static EnumStringEnum = { + + /** + * value: "UPPER" + * @const + */ + "UPPER": "UPPER", + + /** + * value: "lower" + * @const + */ + "lower": "lower", + + /** + * value: "" + * @const + */ + "empty": "" + }; + + /** + * Allowed values for the enum_integer property. + * @enum {Number} + * @readonly + */ + static EnumIntegerEnum = { + + /** + * value: 1 + * @const + */ + "1": 1, + + /** + * value: -1 + * @const + */ + "-1": -1 + }; + + /** + * Allowed values for the enum_number property. + * @enum {Number} + * @readonly + */ + static EnumNumberEnum = { + + /** + * value: 1.1 + * @const + */ + "1.1": 1.1, + + /** + * value: -1.2 + * @const + */ + "-1.2": -1.2 + }; + + + +} diff --git a/samples/client/petstore/javascript-promise-es6/src/model/FormatTest.js b/samples/client/petstore/javascript-promise-es6/src/model/FormatTest.js index 9b93b06b7ca..8773a3a7755 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/FormatTest.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/FormatTest.js @@ -7,176 +7,162 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + + + + +/** +* The FormatTest model module. +* @module model/FormatTest +* @version 1.0.0 +*/ +export default class FormatTest { + /** + * Constructs a new FormatTest. + * @alias module:model/FormatTest + * @class + * @param _number {Number} + * @param _byte {Blob} + * @param _date {Date} + * @param password {String} + */ + + constructor(_number, _byte, _date, password) { + + + + + + this['number'] = _number;this['byte'] = _byte;this['date'] = _date;this['password'] = password; + + } - root.SwaggerPetstore.FormatTest = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; + /** + * Constructs a FormatTest 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/FormatTest} obj Optional instance to populate. + * @return {module:model/FormatTest} The populated FormatTest instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new FormatTest(); + + + - - /** - * The FormatTest model module. - * @module model/FormatTest - * @version 1.0.0 - */ - - /** - * Constructs a new FormatTest. - * @alias module:model/FormatTest - * @class - * @param _number {Number} - * @param _byte {Blob} - * @param _date {Date} - * @param password {String} - */ - var exports = function(_number, _byte, _date, password) { - var _this = this; - - - - - _this['number'] = _number; - - - - _this['byte'] = _byte; - - _this['date'] = _date; - - - _this['password'] = password; - }; - - /** - * Constructs a FormatTest 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/FormatTest} obj Optional instance to populate. - * @return {module:model/FormatTest} The populated FormatTest instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - - if (data.hasOwnProperty('integer')) { - obj['integer'] = ApiClient.convertToType(data['integer'], 'Number'); - } - if (data.hasOwnProperty('int32')) { - obj['int32'] = ApiClient.convertToType(data['int32'], 'Number'); - } - if (data.hasOwnProperty('int64')) { - obj['int64'] = ApiClient.convertToType(data['int64'], 'Number'); - } - if (data.hasOwnProperty('number')) { - obj['number'] = ApiClient.convertToType(data['number'], 'Number'); - } - if (data.hasOwnProperty('float')) { - obj['float'] = ApiClient.convertToType(data['float'], 'Number'); - } - if (data.hasOwnProperty('double')) { - obj['double'] = ApiClient.convertToType(data['double'], 'Number'); - } - if (data.hasOwnProperty('string')) { - obj['string'] = ApiClient.convertToType(data['string'], 'String'); - } - if (data.hasOwnProperty('byte')) { - obj['byte'] = ApiClient.convertToType(data['byte'], 'Blob'); - } - if (data.hasOwnProperty('binary')) { - obj['binary'] = ApiClient.convertToType(data['binary'], 'Blob'); - } - if (data.hasOwnProperty('date')) { - obj['date'] = ApiClient.convertToType(data['date'], 'Date'); - } - if (data.hasOwnProperty('dateTime')) { - obj['dateTime'] = ApiClient.convertToType(data['dateTime'], 'Date'); - } - if (data.hasOwnProperty('uuid')) { - obj['uuid'] = ApiClient.convertToType(data['uuid'], 'String'); - } - if (data.hasOwnProperty('password')) { - obj['password'] = ApiClient.convertToType(data['password'], 'String'); - } + if (data.hasOwnProperty('integer')) { + obj['integer'] = ApiClient.convertToType(data['integer'], 'Number'); + } + if (data.hasOwnProperty('int32')) { + obj['int32'] = ApiClient.convertToType(data['int32'], 'Number'); + } + if (data.hasOwnProperty('int64')) { + obj['int64'] = ApiClient.convertToType(data['int64'], 'Number'); + } + if (data.hasOwnProperty('number')) { + obj['number'] = ApiClient.convertToType(data['number'], 'Number'); + } + if (data.hasOwnProperty('float')) { + obj['float'] = ApiClient.convertToType(data['float'], 'Number'); + } + if (data.hasOwnProperty('double')) { + obj['double'] = ApiClient.convertToType(data['double'], 'Number'); + } + if (data.hasOwnProperty('string')) { + obj['string'] = ApiClient.convertToType(data['string'], 'String'); + } + if (data.hasOwnProperty('byte')) { + obj['byte'] = ApiClient.convertToType(data['byte'], 'Blob'); + } + if (data.hasOwnProperty('binary')) { + obj['binary'] = ApiClient.convertToType(data['binary'], 'Blob'); + } + if (data.hasOwnProperty('date')) { + obj['date'] = ApiClient.convertToType(data['date'], 'Date'); + } + if (data.hasOwnProperty('dateTime')) { + obj['dateTime'] = ApiClient.convertToType(data['dateTime'], 'Date'); + } + if (data.hasOwnProperty('uuid')) { + obj['uuid'] = ApiClient.convertToType(data['uuid'], 'String'); + } + if (data.hasOwnProperty('password')) { + obj['password'] = ApiClient.convertToType(data['password'], 'String'); + } + } + return obj; } - return obj; - } - /** - * @member {Number} integer - */ - exports.prototype['integer'] = undefined; - /** - * @member {Number} int32 - */ - exports.prototype['int32'] = undefined; - /** - * @member {Number} int64 - */ - exports.prototype['int64'] = undefined; - /** - * @member {Number} number - */ - exports.prototype['number'] = undefined; - /** - * @member {Number} float - */ - exports.prototype['float'] = undefined; - /** - * @member {Number} double - */ - exports.prototype['double'] = undefined; - /** - * @member {String} string - */ - exports.prototype['string'] = undefined; - /** - * @member {Blob} byte - */ - exports.prototype['byte'] = undefined; - /** - * @member {Blob} binary - */ - exports.prototype['binary'] = undefined; - /** - * @member {Date} date - */ - exports.prototype['date'] = undefined; - /** - * @member {Date} dateTime - */ - exports.prototype['dateTime'] = undefined; - /** - * @member {String} uuid - */ - exports.prototype['uuid'] = undefined; - /** - * @member {String} password - */ - exports.prototype['password'] = undefined; + /** + * @member {Number} integer + */ + integer = undefined; + /** + * @member {Number} int32 + */ + int32 = undefined; + /** + * @member {Number} int64 + */ + int64 = undefined; + /** + * @member {Number} number + */ + number = undefined; + /** + * @member {Number} float + */ + float = undefined; + /** + * @member {Number} double + */ + double = undefined; + /** + * @member {String} string + */ + string = undefined; + /** + * @member {Blob} byte + */ + byte = undefined; + /** + * @member {Blob} binary + */ + binary = undefined; + /** + * @member {Date} date + */ + date = undefined; + /** + * @member {Date} dateTime + */ + dateTime = undefined; + /** + * @member {String} uuid + */ + uuid = undefined; + /** + * @member {String} password + */ + password = undefined; - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-promise-es6/src/model/HasOnlyReadOnly.js b/samples/client/petstore/javascript-promise-es6/src/model/HasOnlyReadOnly.js index 17c09dfca7b..cb859fe3e50 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/HasOnlyReadOnly.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/HasOnlyReadOnly.js @@ -7,84 +7,81 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + + + + +/** +* The HasOnlyReadOnly model module. +* @module model/HasOnlyReadOnly +* @version 1.0.0 +*/ +export default class HasOnlyReadOnly { + /** + * Constructs a new HasOnlyReadOnly. + * @alias module:model/HasOnlyReadOnly + * @class + */ + + constructor() { + + + + + + + + } - root.SwaggerPetstore.HasOnlyReadOnly = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; + /** + * Constructs a HasOnlyReadOnly 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/HasOnlyReadOnly} obj Optional instance to populate. + * @return {module:model/HasOnlyReadOnly} The populated HasOnlyReadOnly instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new HasOnlyReadOnly(); + + + - - /** - * The HasOnlyReadOnly model module. - * @module model/HasOnlyReadOnly - * @version 1.0.0 - */ - - /** - * Constructs a new HasOnlyReadOnly. - * @alias module:model/HasOnlyReadOnly - * @class - */ - var exports = function() { - var _this = this; - - - - }; - - /** - * Constructs a HasOnlyReadOnly 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/HasOnlyReadOnly} obj Optional instance to populate. - * @return {module:model/HasOnlyReadOnly} The populated HasOnlyReadOnly 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('foo')) { - obj['foo'] = ApiClient.convertToType(data['foo'], 'String'); - } + if (data.hasOwnProperty('bar')) { + obj['bar'] = ApiClient.convertToType(data['bar'], 'String'); + } + if (data.hasOwnProperty('foo')) { + obj['foo'] = ApiClient.convertToType(data['foo'], 'String'); + } + } + return obj; } - return obj; - } - /** - * @member {String} bar - */ - exports.prototype['bar'] = undefined; - /** - * @member {String} foo - */ - exports.prototype['foo'] = undefined; + /** + * @member {String} bar + */ + bar = undefined; + /** + * @member {String} foo + */ + foo = undefined; - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-promise-es6/src/model/List.js b/samples/client/petstore/javascript-promise-es6/src/model/List.js index ce54341bb18..513acd45aff 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/List.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/List.js @@ -7,76 +7,74 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + + + + +/** +* The List model module. +* @module model/List +* @version 1.0.0 +*/ +export default class List { + /** + * Constructs a new List. + * @alias module:model/List + * @class + */ + + constructor() { + + + + + + + + } - root.SwaggerPetstore.List = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; + /** + * Constructs a List 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/List} obj Optional instance to populate. + * @return {module:model/List} The populated List instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new List(); + + + - - /** - * The List model module. - * @module model/List - * @version 1.0.0 - */ - - /** - * Constructs a new List. - * @alias module:model/List - * @class - */ - var exports = function() { - var _this = this; - - - }; - - /** - * Constructs a List 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/List} obj Optional instance to populate. - * @return {module:model/List} The populated List instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - - if (data.hasOwnProperty('123-list')) { - obj['123-list'] = ApiClient.convertToType(data['123-list'], 'String'); - } + if (data.hasOwnProperty('123-list')) { + obj['123-list'] = ApiClient.convertToType(data['123-list'], 'String'); + } + } + return obj; } - return obj; - } - /** - * @member {String} 123-list - */ - exports.prototype['123-list'] = undefined; + /** + * @member {String} 123-list + */ + 123-list = undefined; - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-promise-es6/src/model/MapTest.js b/samples/client/petstore/javascript-promise-es6/src/model/MapTest.js index b7d0164b998..b7a60cd8d9d 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/MapTest.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/MapTest.js @@ -7,101 +7,101 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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.MapTest = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; + +import ApiClient from '../ApiClient'; - /** - * The MapTest model module. - * @module model/MapTest - * @version 1.0.0 - */ - /** - * Constructs a new MapTest. - * @alias module:model/MapTest - * @class - */ - var exports = function() { - var _this = this; - - - - }; - - /** - * Constructs a MapTest 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/MapTest} obj Optional instance to populate. - * @return {module:model/MapTest} The populated MapTest instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - - if (data.hasOwnProperty('map_map_of_string')) { - obj['map_map_of_string'] = ApiClient.convertToType(data['map_map_of_string'], {'String': {'String': 'String'}}); - } - if (data.hasOwnProperty('map_of_enum_string')) { - obj['map_of_enum_string'] = ApiClient.convertToType(data['map_of_enum_string'], {'String': 'String'}); - } - } - return obj; - } - - /** - * @member {Object.>} map_map_of_string - */ - exports.prototype['map_map_of_string'] = undefined; - /** - * @member {Object.} map_of_enum_string - */ - exports.prototype['map_of_enum_string'] = undefined; - - - /** - * Allowed values for the inner property. - * @enum {String} - * @readonly - */ - exports.InnerEnum = { +/** +* The MapTest model module. +* @module model/MapTest +* @version 1.0.0 +*/ +export default class MapTest { /** - * value: "UPPER" - * @const - */ - "UPPER": "UPPER", + * Constructs a new MapTest. + * @alias module:model/MapTest + * @class + */ + + constructor() { + + + + + + + + + } + /** - * value: "lower" - * @const - */ - "lower": "lower" }; + * Constructs a MapTest 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/MapTest} obj Optional instance to populate. + * @return {module:model/MapTest} The populated MapTest instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new MapTest(); + + + + + + if (data.hasOwnProperty('map_map_of_string')) { + obj['map_map_of_string'] = ApiClient.convertToType(data['map_map_of_string'], {'String': {'String': 'String'}}); + } + if (data.hasOwnProperty('map_of_enum_string')) { + obj['map_of_enum_string'] = ApiClient.convertToType(data['map_of_enum_string'], {'String': 'String'}); + } + } + return obj; + } + + /** + * @member {Object.>} map_map_of_string + */ + map_map_of_string = undefined; + /** + * @member {Object.} map_of_enum_string + */ + map_of_enum_string = undefined; - return exports; -})); + + + + + /** + * Allowed values for the inner property. + * @enum {String} + * @readonly + */ + static InnerEnum = { + + /** + * value: "UPPER" + * @const + */ + "UPPER": "UPPER", + + /** + * value: "lower" + * @const + */ + "lower": "lower" + }; + + + +} diff --git a/samples/client/petstore/javascript-promise-es6/src/model/MixedPropertiesAndAdditionalPropertiesClass.js b/samples/client/petstore/javascript-promise-es6/src/model/MixedPropertiesAndAdditionalPropertiesClass.js index 973ca5a65e2..6d912ceeb9b 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/MixedPropertiesAndAdditionalPropertiesClass.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/MixedPropertiesAndAdditionalPropertiesClass.js @@ -7,92 +7,89 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; +import Animal from './Animal'; + + + + + +/** +* The MixedPropertiesAndAdditionalPropertiesClass model module. +* @module model/MixedPropertiesAndAdditionalPropertiesClass +* @version 1.0.0 +*/ +export default class MixedPropertiesAndAdditionalPropertiesClass { + /** + * Constructs a new MixedPropertiesAndAdditionalPropertiesClass. + * @alias module:model/MixedPropertiesAndAdditionalPropertiesClass + * @class + */ + + constructor() { + + + + + + + + } - root.SwaggerPetstore.MixedPropertiesAndAdditionalPropertiesClass = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.Animal); - } -}(this, function(ApiClient, Animal) { - 'use strict'; + /** + * 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. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new MixedPropertiesAndAdditionalPropertiesClass(); + + + - - /** - * The MixedPropertiesAndAdditionalPropertiesClass model module. - * @module model/MixedPropertiesAndAdditionalPropertiesClass - * @version 1.0.0 - */ - - /** - * Constructs a new MixedPropertiesAndAdditionalPropertiesClass. - * @alias module:model/MixedPropertiesAndAdditionalPropertiesClass - * @class - */ - var exports = function() { - var _this = 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(); - - if (data.hasOwnProperty('uuid')) { - obj['uuid'] = ApiClient.convertToType(data['uuid'], 'String'); - } - if (data.hasOwnProperty('dateTime')) { - obj['dateTime'] = ApiClient.convertToType(data['dateTime'], 'Date'); - } - if (data.hasOwnProperty('map')) { - obj['map'] = ApiClient.convertToType(data['map'], {'String': Animal}); - } + if (data.hasOwnProperty('uuid')) { + obj['uuid'] = ApiClient.convertToType(data['uuid'], 'String'); + } + if (data.hasOwnProperty('dateTime')) { + obj['dateTime'] = ApiClient.convertToType(data['dateTime'], 'Date'); + } + if (data.hasOwnProperty('map')) { + obj['map'] = ApiClient.convertToType(data['map'], {'String': Animal}); + } + } + return obj; } - return obj; - } - /** - * @member {String} uuid - */ - exports.prototype['uuid'] = undefined; - /** - * @member {Date} dateTime - */ - exports.prototype['dateTime'] = undefined; - /** - * @member {Object.} map - */ - exports.prototype['map'] = undefined; + /** + * @member {String} uuid + */ + uuid = undefined; + /** + * @member {Date} dateTime + */ + dateTime = undefined; + /** + * @member {Object.} map + */ + map = undefined; - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-promise-es6/src/model/Model200Response.js b/samples/client/petstore/javascript-promise-es6/src/model/Model200Response.js index c382f333344..df4d957df7c 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/Model200Response.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/Model200Response.js @@ -7,85 +7,82 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + + + + +/** +* The Model200Response model module. +* @module model/Model200Response +* @version 1.0.0 +*/ +export default class Model200Response { + /** + * Constructs a new Model200Response. + * Model for testing model name starting with number + * @alias module:model/Model200Response + * @class + */ + + constructor() { + + + + + + + + } - root.SwaggerPetstore.Model200Response = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; + /** + * Constructs a Model200Response 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/Model200Response} obj Optional instance to populate. + * @return {module:model/Model200Response} The populated Model200Response instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new Model200Response(); + + + - - /** - * The Model200Response model module. - * @module model/Model200Response - * @version 1.0.0 - */ - - /** - * Constructs a new Model200Response. - * Model for testing model name starting with number - * @alias module:model/Model200Response - * @class - */ - var exports = function() { - var _this = this; - - - - }; - - /** - * Constructs a Model200Response 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/Model200Response} obj Optional instance to populate. - * @return {module:model/Model200Response} The populated Model200Response instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - - if (data.hasOwnProperty('name')) { - obj['name'] = ApiClient.convertToType(data['name'], 'Number'); - } - if (data.hasOwnProperty('class')) { - obj['class'] = ApiClient.convertToType(data['class'], 'String'); - } + if (data.hasOwnProperty('name')) { + obj['name'] = ApiClient.convertToType(data['name'], 'Number'); + } + if (data.hasOwnProperty('class')) { + obj['class'] = ApiClient.convertToType(data['class'], 'String'); + } + } + return obj; } - return obj; - } - /** - * @member {Number} name - */ - exports.prototype['name'] = undefined; - /** - * @member {String} class - */ - exports.prototype['class'] = undefined; + /** + * @member {Number} name + */ + name = undefined; + /** + * @member {String} class + */ + class = undefined; - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-promise-es6/src/model/ModelReturn.js b/samples/client/petstore/javascript-promise-es6/src/model/ModelReturn.js index fa5bc9910f8..88fd97ab85f 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/ModelReturn.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/ModelReturn.js @@ -7,77 +7,75 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + + + + +/** +* The ModelReturn model module. +* @module model/ModelReturn +* @version 1.0.0 +*/ +export default class ModelReturn { + /** + * Constructs a new ModelReturn. + * Model for testing reserved words + * @alias module:model/ModelReturn + * @class + */ + + constructor() { + + + + + + + + } - root.SwaggerPetstore.ModelReturn = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; + /** + * Constructs a ModelReturn 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/ModelReturn} obj Optional instance to populate. + * @return {module:model/ModelReturn} The populated ModelReturn instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new ModelReturn(); + + + - - /** - * The ModelReturn model module. - * @module model/ModelReturn - * @version 1.0.0 - */ - - /** - * Constructs a new ModelReturn. - * Model for testing reserved words - * @alias module:model/ModelReturn - * @class - */ - var exports = function() { - var _this = this; - - - }; - - /** - * Constructs a ModelReturn 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/ModelReturn} obj Optional instance to populate. - * @return {module:model/ModelReturn} The populated ModelReturn instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - - if (data.hasOwnProperty('return')) { - obj['return'] = ApiClient.convertToType(data['return'], 'Number'); - } + if (data.hasOwnProperty('return')) { + obj['return'] = ApiClient.convertToType(data['return'], 'Number'); + } + } + return obj; } - return obj; - } - /** - * @member {Number} return - */ - exports.prototype['return'] = undefined; + /** + * @member {Number} return + */ + return = undefined; - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-promise-es6/src/model/Name.js b/samples/client/petstore/javascript-promise-es6/src/model/Name.js index 0671311976c..f355fbdd403 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/Name.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/Name.js @@ -7,102 +7,97 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + + + + +/** +* The Name model module. +* @module model/Name +* @version 1.0.0 +*/ +export default class Name { + /** + * Constructs a new Name. + * Model for testing model name same as property name + * @alias module:model/Name + * @class + * @param name {Number} + */ + + constructor(name) { + + + + + + this['name'] = name; + + } - root.SwaggerPetstore.Name = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; + /** + * Constructs a Name 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/Name} obj Optional instance to populate. + * @return {module:model/Name} The populated Name instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new Name(); + + + - - /** - * The Name model module. - * @module model/Name - * @version 1.0.0 - */ - - /** - * Constructs a new Name. - * Model for testing model name same as property name - * @alias module:model/Name - * @class - * @param name {Number} - */ - var exports = function(name) { - var _this = this; - - _this['name'] = name; - - - - }; - - /** - * Constructs a Name 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/Name} obj Optional instance to populate. - * @return {module:model/Name} The populated Name instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - - if (data.hasOwnProperty('name')) { - obj['name'] = ApiClient.convertToType(data['name'], 'Number'); - } - if (data.hasOwnProperty('snake_case')) { - obj['snake_case'] = ApiClient.convertToType(data['snake_case'], 'Number'); - } - if (data.hasOwnProperty('property')) { - obj['property'] = ApiClient.convertToType(data['property'], 'String'); - } - if (data.hasOwnProperty('123Number')) { - obj['123Number'] = ApiClient.convertToType(data['123Number'], 'Number'); - } + if (data.hasOwnProperty('name')) { + obj['name'] = ApiClient.convertToType(data['name'], 'Number'); + } + if (data.hasOwnProperty('snake_case')) { + obj['snake_case'] = ApiClient.convertToType(data['snake_case'], 'Number'); + } + if (data.hasOwnProperty('property')) { + obj['property'] = ApiClient.convertToType(data['property'], 'String'); + } + if (data.hasOwnProperty('123Number')) { + obj['123Number'] = ApiClient.convertToType(data['123Number'], 'Number'); + } + } + return obj; } - return obj; - } - /** - * @member {Number} name - */ - exports.prototype['name'] = undefined; - /** - * @member {Number} snake_case - */ - exports.prototype['snake_case'] = undefined; - /** - * @member {String} property - */ - exports.prototype['property'] = undefined; - /** - * @member {Number} 123Number - */ - exports.prototype['123Number'] = undefined; + /** + * @member {Number} name + */ + name = undefined; + /** + * @member {Number} snake_case + */ + snake_case = undefined; + /** + * @member {String} property + */ + property = undefined; + /** + * @member {Number} 123Number + */ + 123Number = undefined; - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-promise-es6/src/model/NumberOnly.js b/samples/client/petstore/javascript-promise-es6/src/model/NumberOnly.js index d9ee8fcd3ab..bee66870891 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/NumberOnly.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/NumberOnly.js @@ -7,76 +7,74 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + + + + +/** +* The NumberOnly model module. +* @module model/NumberOnly +* @version 1.0.0 +*/ +export default class NumberOnly { + /** + * Constructs a new NumberOnly. + * @alias module:model/NumberOnly + * @class + */ + + constructor() { + + + + + + + + } - root.SwaggerPetstore.NumberOnly = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; + /** + * Constructs a NumberOnly 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/NumberOnly} obj Optional instance to populate. + * @return {module:model/NumberOnly} The populated NumberOnly instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new NumberOnly(); + + + - - /** - * The NumberOnly model module. - * @module model/NumberOnly - * @version 1.0.0 - */ - - /** - * Constructs a new NumberOnly. - * @alias module:model/NumberOnly - * @class - */ - var exports = function() { - var _this = this; - - - }; - - /** - * Constructs a NumberOnly 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/NumberOnly} obj Optional instance to populate. - * @return {module:model/NumberOnly} The populated NumberOnly instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - - if (data.hasOwnProperty('JustNumber')) { - obj['JustNumber'] = ApiClient.convertToType(data['JustNumber'], 'Number'); - } + if (data.hasOwnProperty('JustNumber')) { + obj['JustNumber'] = ApiClient.convertToType(data['JustNumber'], 'Number'); + } + } + return obj; } - return obj; - } - /** - * @member {Number} JustNumber - */ - exports.prototype['JustNumber'] = undefined; + /** + * @member {Number} JustNumber + */ + JustNumber = undefined; - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-promise-es6/src/model/Order.js b/samples/client/petstore/javascript-promise-es6/src/model/Order.js index f082668517f..ff704900bbc 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/Order.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/Order.js @@ -7,140 +7,137 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + + + + +/** +* The Order model module. +* @module model/Order +* @version 1.0.0 +*/ +export default class Order { + /** + * Constructs a new Order. + * @alias module:model/Order + * @class + */ + + constructor() { + + + + + + + + } - root.SwaggerPetstore.Order = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; + /** + * Constructs a Order 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/Order} obj Optional instance to populate. + * @return {module:model/Order} The populated Order instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new Order(); + + + - - /** - * The Order model module. - * @module model/Order - * @version 1.0.0 - */ - - /** - * Constructs a new Order. - * @alias module:model/Order - * @class - */ - var exports = function() { - var _this = this; - - - - - - - - }; - - /** - * Constructs a Order 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/Order} obj Optional instance to populate. - * @return {module:model/Order} The populated Order instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - - if (data.hasOwnProperty('id')) { - obj['id'] = ApiClient.convertToType(data['id'], 'Number'); - } - if (data.hasOwnProperty('petId')) { - obj['petId'] = ApiClient.convertToType(data['petId'], 'Number'); - } - if (data.hasOwnProperty('quantity')) { - obj['quantity'] = ApiClient.convertToType(data['quantity'], 'Number'); - } - if (data.hasOwnProperty('shipDate')) { - obj['shipDate'] = ApiClient.convertToType(data['shipDate'], 'Date'); - } - if (data.hasOwnProperty('status')) { - obj['status'] = ApiClient.convertToType(data['status'], 'String'); - } - if (data.hasOwnProperty('complete')) { - obj['complete'] = ApiClient.convertToType(data['complete'], 'Boolean'); - } + if (data.hasOwnProperty('id')) { + obj['id'] = ApiClient.convertToType(data['id'], 'Number'); + } + if (data.hasOwnProperty('petId')) { + obj['petId'] = ApiClient.convertToType(data['petId'], 'Number'); + } + if (data.hasOwnProperty('quantity')) { + obj['quantity'] = ApiClient.convertToType(data['quantity'], 'Number'); + } + if (data.hasOwnProperty('shipDate')) { + obj['shipDate'] = ApiClient.convertToType(data['shipDate'], 'Date'); + } + if (data.hasOwnProperty('status')) { + obj['status'] = ApiClient.convertToType(data['status'], 'String'); + } + if (data.hasOwnProperty('complete')) { + obj['complete'] = ApiClient.convertToType(data['complete'], 'Boolean'); + } + } + return obj; } - return obj; - } - /** - * @member {Number} id - */ - exports.prototype['id'] = undefined; - /** - * @member {Number} petId - */ - exports.prototype['petId'] = undefined; - /** - * @member {Number} quantity - */ - exports.prototype['quantity'] = undefined; - /** - * @member {Date} shipDate - */ - exports.prototype['shipDate'] = undefined; - /** - * Order Status - * @member {module:model/Order.StatusEnum} status - */ - exports.prototype['status'] = undefined; - /** - * @member {Boolean} complete - * @default false - */ - exports.prototype['complete'] = false; - - - /** - * Allowed values for the status property. - * @enum {String} - * @readonly - */ - exports.StatusEnum = { /** - * value: "placed" - * @const - */ - "placed": "placed", + * @member {Number} id + */ + id = undefined; /** - * value: "approved" - * @const - */ - "approved": "approved", + * @member {Number} petId + */ + petId = undefined; /** - * value: "delivered" - * @const - */ - "delivered": "delivered" }; + * @member {Number} quantity + */ + quantity = undefined; + /** + * @member {Date} shipDate + */ + shipDate = undefined; + /** + * Order Status + * @member {module:model/Order.StatusEnum} status + */ + status = undefined; + /** + * @member {Boolean} complete + * @default false + */ + complete = false; - return exports; -})); + + + + + /** + * Allowed values for the status property. + * @enum {String} + * @readonly + */ + static StatusEnum = { + + /** + * value: "placed" + * @const + */ + "placed": "placed", + + /** + * value: "approved" + * @const + */ + "approved": "approved", + + /** + * value: "delivered" + * @const + */ + "delivered": "delivered" + }; + + + +} diff --git a/samples/client/petstore/javascript-promise-es6/src/model/OuterBoolean.js b/samples/client/petstore/javascript-promise-es6/src/model/OuterBoolean.js index 96b8b11d1bc..592a0b69864 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/OuterBoolean.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/OuterBoolean.js @@ -7,68 +7,67 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + + + + +/** +* The OuterBoolean model module. +* @module model/OuterBoolean +* @version 1.0.0 +*/ +export default class OuterBoolean { + /** + * Constructs a new OuterBoolean. + * @alias module:model/OuterBoolean + * @class + */ + + constructor() { + + + + + + + + } - root.SwaggerPetstore.OuterBoolean = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; + /** + * Constructs a OuterBoolean 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/OuterBoolean} obj Optional instance to populate. + * @return {module:model/OuterBoolean} The populated OuterBoolean instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new OuterBoolean(); + + + - - /** - * The OuterBoolean model module. - * @module model/OuterBoolean - * @version 1.0.0 - */ - - /** - * Constructs a new OuterBoolean. - * @alias module:model/OuterBoolean - * @class - */ - var exports = function() { - var _this = this; - - }; - - /** - * Constructs a OuterBoolean 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/OuterBoolean} obj Optional instance to populate. - * @return {module:model/OuterBoolean} The populated OuterBoolean instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - + } + return obj; } - return obj; - } - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-promise-es6/src/model/OuterComposite.js b/samples/client/petstore/javascript-promise-es6/src/model/OuterComposite.js index 14e7775588b..327e303467a 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/OuterComposite.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/OuterComposite.js @@ -7,92 +7,91 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(function(root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['ApiClient', 'model/OuterBoolean', 'model/OuterNumber', 'model/OuterString'], factory); - } else if (typeof module === 'object' && module.exports) { - // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('../ApiClient'), require('./OuterBoolean'), require('./OuterNumber'), require('./OuterString')); - } else { - // Browser globals (root is window) - if (!root.SwaggerPetstore) { - root.SwaggerPetstore = {}; + +import ApiClient from '../ApiClient'; +import OuterBoolean from './OuterBoolean'; +import OuterNumber from './OuterNumber'; +import OuterString from './OuterString'; + + + + + +/** +* The OuterComposite model module. +* @module model/OuterComposite +* @version 1.0.0 +*/ +export default class OuterComposite { + /** + * Constructs a new OuterComposite. + * @alias module:model/OuterComposite + * @class + */ + + constructor() { + + + + + + + + } - root.SwaggerPetstore.OuterComposite = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.OuterBoolean, root.SwaggerPetstore.OuterNumber, root.SwaggerPetstore.OuterString); - } -}(this, function(ApiClient, OuterBoolean, OuterNumber, OuterString) { - 'use strict'; + /** + * Constructs a OuterComposite 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/OuterComposite} obj Optional instance to populate. + * @return {module:model/OuterComposite} The populated OuterComposite instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new OuterComposite(); + + + - - /** - * The OuterComposite model module. - * @module model/OuterComposite - * @version 1.0.0 - */ - - /** - * Constructs a new OuterComposite. - * @alias module:model/OuterComposite - * @class - */ - var exports = function() { - var _this = this; - - - - - }; - - /** - * Constructs a OuterComposite 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/OuterComposite} obj Optional instance to populate. - * @return {module:model/OuterComposite} The populated OuterComposite instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - - if (data.hasOwnProperty('my_number')) { - obj['my_number'] = OuterNumber.constructFromObject(data['my_number']); - } - if (data.hasOwnProperty('my_string')) { - obj['my_string'] = OuterString.constructFromObject(data['my_string']); - } - if (data.hasOwnProperty('my_boolean')) { - obj['my_boolean'] = OuterBoolean.constructFromObject(data['my_boolean']); - } + if (data.hasOwnProperty('my_number')) { + obj['my_number'] = OuterNumber.constructFromObject(data['my_number']); + } + if (data.hasOwnProperty('my_string')) { + obj['my_string'] = OuterString.constructFromObject(data['my_string']); + } + if (data.hasOwnProperty('my_boolean')) { + obj['my_boolean'] = OuterBoolean.constructFromObject(data['my_boolean']); + } + } + return obj; } - return obj; - } - /** - * @member {module:model/OuterNumber} my_number - */ - exports.prototype['my_number'] = undefined; - /** - * @member {module:model/OuterString} my_string - */ - exports.prototype['my_string'] = undefined; - /** - * @member {module:model/OuterBoolean} my_boolean - */ - exports.prototype['my_boolean'] = undefined; + /** + * @member {module:model/OuterNumber} my_number + */ + my_number = undefined; + /** + * @member {module:model/OuterString} my_string + */ + my_string = undefined; + /** + * @member {module:model/OuterBoolean} my_boolean + */ + my_boolean = undefined; - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-promise-es6/src/model/OuterEnum.js b/samples/client/petstore/javascript-promise-es6/src/model/OuterEnum.js index cdd43098369..bf264fd8f64 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/OuterEnum.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/OuterEnum.js @@ -7,63 +7,51 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + +/** +* Enum class OuterEnum. +* @enum {} +* @readonly +*/ +export default class OuterEnum { + + /** + * value: "placed" + * @const + */ + placed = "placed"; + + + /** + * value: "approved" + * @const + */ + approved = "approved"; + + + /** + * value: "delivered" + * @const + */ + delivered = "delivered"; + + + + /** + * Returns a OuterEnum enum value from a Javascript object name. + * @param {Object} data The plain JavaScript object containing the name of the enum value. + * @return {module:model/OuterEnum} The enum OuterEnum value. + */ + static constructFromObject(object) { + return object; } - root.SwaggerPetstore.OuterEnum = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; - - - /** - * Enum class OuterEnum. - * @enum {} - * @readonly - */ - var exports = { - /** - * value: "placed" - * @const - */ - "placed": "placed", - /** - * value: "approved" - * @const - */ - "approved": "approved", - /** - * value: "delivered" - * @const - */ - "delivered": "delivered" }; - - /** - * Returns a OuterEnum enum value from a Javascript object name. - * @param {Object} data The plain JavaScript object containing the name of the enum value. - * @return {module:model/OuterEnum} The enum OuterEnum value. - */ - exports.constructFromObject = function(object) { - return object; - } - - return exports; -})); +} diff --git a/samples/client/petstore/javascript-promise-es6/src/model/OuterNumber.js b/samples/client/petstore/javascript-promise-es6/src/model/OuterNumber.js index 1128dcb8afe..ff65b1588b7 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/OuterNumber.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/OuterNumber.js @@ -7,68 +7,67 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + + + + +/** +* The OuterNumber model module. +* @module model/OuterNumber +* @version 1.0.0 +*/ +export default class OuterNumber { + /** + * Constructs a new OuterNumber. + * @alias module:model/OuterNumber + * @class + */ + + constructor() { + + + + + + + + } - root.SwaggerPetstore.OuterNumber = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; + /** + * Constructs a OuterNumber 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/OuterNumber} obj Optional instance to populate. + * @return {module:model/OuterNumber} The populated OuterNumber instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new OuterNumber(); + + + - - /** - * The OuterNumber model module. - * @module model/OuterNumber - * @version 1.0.0 - */ - - /** - * Constructs a new OuterNumber. - * @alias module:model/OuterNumber - * @class - */ - var exports = function() { - var _this = this; - - }; - - /** - * Constructs a OuterNumber 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/OuterNumber} obj Optional instance to populate. - * @return {module:model/OuterNumber} The populated OuterNumber instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - + } + return obj; } - return obj; - } - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-promise-es6/src/model/OuterString.js b/samples/client/petstore/javascript-promise-es6/src/model/OuterString.js index 3a012fbb0c9..6921029ede1 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/OuterString.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/OuterString.js @@ -7,68 +7,67 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + + + + +/** +* The OuterString model module. +* @module model/OuterString +* @version 1.0.0 +*/ +export default class OuterString { + /** + * Constructs a new OuterString. + * @alias module:model/OuterString + * @class + */ + + constructor() { + + + + + + + + } - root.SwaggerPetstore.OuterString = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; + /** + * Constructs a OuterString 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/OuterString} obj Optional instance to populate. + * @return {module:model/OuterString} The populated OuterString instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new OuterString(); + + + - - /** - * The OuterString model module. - * @module model/OuterString - * @version 1.0.0 - */ - - /** - * Constructs a new OuterString. - * @alias module:model/OuterString - * @class - */ - var exports = function() { - var _this = this; - - }; - - /** - * Constructs a OuterString 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/OuterString} obj Optional instance to populate. - * @return {module:model/OuterString} The populated OuterString instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - + } + return obj; } - return obj; - } - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-promise-es6/src/model/Pet.js b/samples/client/petstore/javascript-promise-es6/src/model/Pet.js index 7edd65724ba..bb849152027 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/Pet.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/Pet.js @@ -7,141 +7,140 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(function(root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['ApiClient', 'model/Category', 'model/Tag'], factory); - } else if (typeof module === 'object' && module.exports) { - // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('../ApiClient'), require('./Category'), require('./Tag')); - } else { - // Browser globals (root is window) - if (!root.SwaggerPetstore) { - root.SwaggerPetstore = {}; + +import ApiClient from '../ApiClient'; +import Category from './Category'; +import Tag from './Tag'; + + + + + +/** +* The Pet model module. +* @module model/Pet +* @version 1.0.0 +*/ +export default class Pet { + /** + * Constructs a new Pet. + * @alias module:model/Pet + * @class + * @param name {String} + * @param photoUrls {Array.} + */ + + constructor(name, photoUrls) { + + + + + + this['name'] = name;this['photoUrls'] = photoUrls; + + } - root.SwaggerPetstore.Pet = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.Category, root.SwaggerPetstore.Tag); - } -}(this, function(ApiClient, Category, Tag) { - 'use strict'; + /** + * Constructs a Pet 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/Pet} obj Optional instance to populate. + * @return {module:model/Pet} The populated Pet instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new Pet(); + + + - - /** - * The Pet model module. - * @module model/Pet - * @version 1.0.0 - */ - - /** - * Constructs a new Pet. - * @alias module:model/Pet - * @class - * @param name {String} - * @param photoUrls {Array.} - */ - var exports = function(name, photoUrls) { - var _this = this; - - - - _this['name'] = name; - _this['photoUrls'] = photoUrls; - - - }; - - /** - * Constructs a Pet 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/Pet} obj Optional instance to populate. - * @return {module:model/Pet} The populated Pet instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - - if (data.hasOwnProperty('id')) { - obj['id'] = ApiClient.convertToType(data['id'], 'Number'); - } - if (data.hasOwnProperty('category')) { - obj['category'] = Category.constructFromObject(data['category']); - } - if (data.hasOwnProperty('name')) { - obj['name'] = ApiClient.convertToType(data['name'], 'String'); - } - if (data.hasOwnProperty('photoUrls')) { - obj['photoUrls'] = ApiClient.convertToType(data['photoUrls'], ['String']); - } - if (data.hasOwnProperty('tags')) { - obj['tags'] = ApiClient.convertToType(data['tags'], [Tag]); - } - if (data.hasOwnProperty('status')) { - obj['status'] = ApiClient.convertToType(data['status'], 'String'); - } + if (data.hasOwnProperty('id')) { + obj['id'] = ApiClient.convertToType(data['id'], 'Number'); + } + if (data.hasOwnProperty('category')) { + obj['category'] = Category.constructFromObject(data['category']); + } + if (data.hasOwnProperty('name')) { + obj['name'] = ApiClient.convertToType(data['name'], 'String'); + } + if (data.hasOwnProperty('photoUrls')) { + obj['photoUrls'] = ApiClient.convertToType(data['photoUrls'], ['String']); + } + if (data.hasOwnProperty('tags')) { + obj['tags'] = ApiClient.convertToType(data['tags'], [Tag]); + } + if (data.hasOwnProperty('status')) { + obj['status'] = ApiClient.convertToType(data['status'], 'String'); + } + } + return obj; } - return obj; - } - /** - * @member {Number} id - */ - exports.prototype['id'] = undefined; - /** - * @member {module:model/Category} category - */ - exports.prototype['category'] = undefined; - /** - * @member {String} name - */ - exports.prototype['name'] = undefined; - /** - * @member {Array.} photoUrls - */ - exports.prototype['photoUrls'] = undefined; - /** - * @member {Array.} tags - */ - exports.prototype['tags'] = undefined; - /** - * pet status in the store - * @member {module:model/Pet.StatusEnum} status - */ - exports.prototype['status'] = undefined; - - - /** - * Allowed values for the status property. - * @enum {String} - * @readonly - */ - exports.StatusEnum = { /** - * value: "available" - * @const - */ - "available": "available", + * @member {Number} id + */ + id = undefined; /** - * value: "pending" - * @const - */ - "pending": "pending", + * @member {module:model/Category} category + */ + category = undefined; /** - * value: "sold" - * @const - */ - "sold": "sold" }; + * @member {String} name + */ + name = undefined; + /** + * @member {Array.} photoUrls + */ + photoUrls = undefined; + /** + * @member {Array.} tags + */ + tags = undefined; + /** + * pet status in the store + * @member {module:model/Pet.StatusEnum} status + */ + status = undefined; - return exports; -})); + + + + + /** + * Allowed values for the status property. + * @enum {String} + * @readonly + */ + static StatusEnum = { + + /** + * value: "available" + * @const + */ + "available": "available", + + /** + * value: "pending" + * @const + */ + "pending": "pending", + + /** + * value: "sold" + * @const + */ + "sold": "sold" + }; + + + +} diff --git a/samples/client/petstore/javascript-promise-es6/src/model/ReadOnlyFirst.js b/samples/client/petstore/javascript-promise-es6/src/model/ReadOnlyFirst.js index f6f0064fd96..143b34f3eb1 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/ReadOnlyFirst.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/ReadOnlyFirst.js @@ -7,84 +7,81 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + + + + +/** +* The ReadOnlyFirst model module. +* @module model/ReadOnlyFirst +* @version 1.0.0 +*/ +export default class ReadOnlyFirst { + /** + * Constructs a new ReadOnlyFirst. + * @alias module:model/ReadOnlyFirst + * @class + */ + + constructor() { + + + + + + + + } - root.SwaggerPetstore.ReadOnlyFirst = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; + /** + * 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. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new ReadOnlyFirst(); + + + - - /** - * 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'); - } + if (data.hasOwnProperty('bar')) { + obj['bar'] = ApiClient.convertToType(data['bar'], 'String'); + } + if (data.hasOwnProperty('baz')) { + obj['baz'] = ApiClient.convertToType(data['baz'], 'String'); + } + } + return obj; } - return obj; - } - /** - * @member {String} bar - */ - exports.prototype['bar'] = undefined; - /** - * @member {String} baz - */ - exports.prototype['baz'] = undefined; + /** + * @member {String} bar + */ + bar = undefined; + /** + * @member {String} baz + */ + baz = undefined; - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-promise-es6/src/model/SpecialModelName.js b/samples/client/petstore/javascript-promise-es6/src/model/SpecialModelName.js index 921a1e87379..4e0dd379b19 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/SpecialModelName.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/SpecialModelName.js @@ -7,76 +7,74 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + + + + +/** +* The SpecialModelName model module. +* @module model/SpecialModelName +* @version 1.0.0 +*/ +export default class SpecialModelName { + /** + * Constructs a new SpecialModelName. + * @alias module:model/SpecialModelName + * @class + */ + + constructor() { + + + + + + + + } - root.SwaggerPetstore.SpecialModelName = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; + /** + * Constructs a SpecialModelName 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/SpecialModelName} obj Optional instance to populate. + * @return {module:model/SpecialModelName} The populated SpecialModelName instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new SpecialModelName(); + + + - - /** - * The SpecialModelName model module. - * @module model/SpecialModelName - * @version 1.0.0 - */ - - /** - * Constructs a new SpecialModelName. - * @alias module:model/SpecialModelName - * @class - */ - var exports = function() { - var _this = this; - - - }; - - /** - * Constructs a SpecialModelName 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/SpecialModelName} obj Optional instance to populate. - * @return {module:model/SpecialModelName} The populated SpecialModelName instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - - if (data.hasOwnProperty('$special[property.name]')) { - obj['$special[property.name]'] = ApiClient.convertToType(data['$special[property.name]'], 'Number'); - } + if (data.hasOwnProperty('$special[property.name]')) { + obj['$special[property.name]'] = ApiClient.convertToType(data['$special[property.name]'], 'Number'); + } + } + return obj; } - return obj; - } - /** - * @member {Number} $special[property.name] - */ - exports.prototype['$special[property.name]'] = undefined; + /** + * @member {Number} $special[property.name] + */ + $special[property.name] = undefined; - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-promise-es6/src/model/Tag.js b/samples/client/petstore/javascript-promise-es6/src/model/Tag.js index 6308751e08f..759b3fa04e3 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/Tag.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/Tag.js @@ -7,84 +7,81 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + + + + +/** +* The Tag model module. +* @module model/Tag +* @version 1.0.0 +*/ +export default class Tag { + /** + * Constructs a new Tag. + * @alias module:model/Tag + * @class + */ + + constructor() { + + + + + + + + } - root.SwaggerPetstore.Tag = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; + /** + * Constructs a Tag 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/Tag} obj Optional instance to populate. + * @return {module:model/Tag} The populated Tag instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new Tag(); + + + - - /** - * The Tag model module. - * @module model/Tag - * @version 1.0.0 - */ - - /** - * Constructs a new Tag. - * @alias module:model/Tag - * @class - */ - var exports = function() { - var _this = this; - - - - }; - - /** - * Constructs a Tag 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/Tag} obj Optional instance to populate. - * @return {module:model/Tag} The populated Tag instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - - if (data.hasOwnProperty('id')) { - obj['id'] = ApiClient.convertToType(data['id'], 'Number'); - } - if (data.hasOwnProperty('name')) { - obj['name'] = ApiClient.convertToType(data['name'], 'String'); - } + if (data.hasOwnProperty('id')) { + obj['id'] = ApiClient.convertToType(data['id'], 'Number'); + } + if (data.hasOwnProperty('name')) { + obj['name'] = ApiClient.convertToType(data['name'], 'String'); + } + } + return obj; } - return obj; - } - /** - * @member {Number} id - */ - exports.prototype['id'] = undefined; - /** - * @member {String} name - */ - exports.prototype['name'] = undefined; + /** + * @member {Number} id + */ + id = undefined; + /** + * @member {String} name + */ + name = undefined; - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-promise-es6/src/model/User.js b/samples/client/petstore/javascript-promise-es6/src/model/User.js index 1d251e22b3c..36311e75938 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/User.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/User.js @@ -7,133 +7,124 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * * Do not edit the class manually. * */ -(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 = {}; + +import ApiClient from '../ApiClient'; + + + + + +/** +* The User model module. +* @module model/User +* @version 1.0.0 +*/ +export default class User { + /** + * Constructs a new User. + * @alias module:model/User + * @class + */ + + constructor() { + + + + + + + + } - root.SwaggerPetstore.User = factory(root.SwaggerPetstore.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; + /** + * Constructs a User 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/User} obj Optional instance to populate. + * @return {module:model/User} The populated User instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new User(); + + + - - /** - * The User model module. - * @module model/User - * @version 1.0.0 - */ - - /** - * Constructs a new User. - * @alias module:model/User - * @class - */ - var exports = function() { - var _this = this; - - - - - - - - - - }; - - /** - * Constructs a User 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/User} obj Optional instance to populate. - * @return {module:model/User} The populated User instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - - if (data.hasOwnProperty('id')) { - obj['id'] = ApiClient.convertToType(data['id'], 'Number'); - } - if (data.hasOwnProperty('username')) { - obj['username'] = ApiClient.convertToType(data['username'], 'String'); - } - if (data.hasOwnProperty('firstName')) { - obj['firstName'] = ApiClient.convertToType(data['firstName'], 'String'); - } - if (data.hasOwnProperty('lastName')) { - obj['lastName'] = ApiClient.convertToType(data['lastName'], 'String'); - } - if (data.hasOwnProperty('email')) { - obj['email'] = ApiClient.convertToType(data['email'], 'String'); - } - if (data.hasOwnProperty('password')) { - obj['password'] = ApiClient.convertToType(data['password'], 'String'); - } - if (data.hasOwnProperty('phone')) { - obj['phone'] = ApiClient.convertToType(data['phone'], 'String'); - } - if (data.hasOwnProperty('userStatus')) { - obj['userStatus'] = ApiClient.convertToType(data['userStatus'], 'Number'); - } + if (data.hasOwnProperty('id')) { + obj['id'] = ApiClient.convertToType(data['id'], 'Number'); + } + if (data.hasOwnProperty('username')) { + obj['username'] = ApiClient.convertToType(data['username'], 'String'); + } + if (data.hasOwnProperty('firstName')) { + obj['firstName'] = ApiClient.convertToType(data['firstName'], 'String'); + } + if (data.hasOwnProperty('lastName')) { + obj['lastName'] = ApiClient.convertToType(data['lastName'], 'String'); + } + if (data.hasOwnProperty('email')) { + obj['email'] = ApiClient.convertToType(data['email'], 'String'); + } + if (data.hasOwnProperty('password')) { + obj['password'] = ApiClient.convertToType(data['password'], 'String'); + } + if (data.hasOwnProperty('phone')) { + obj['phone'] = ApiClient.convertToType(data['phone'], 'String'); + } + if (data.hasOwnProperty('userStatus')) { + obj['userStatus'] = ApiClient.convertToType(data['userStatus'], 'Number'); + } + } + return obj; } - return obj; - } - /** - * @member {Number} id - */ - exports.prototype['id'] = undefined; - /** - * @member {String} username - */ - exports.prototype['username'] = undefined; - /** - * @member {String} firstName - */ - exports.prototype['firstName'] = undefined; - /** - * @member {String} lastName - */ - exports.prototype['lastName'] = undefined; - /** - * @member {String} email - */ - exports.prototype['email'] = undefined; - /** - * @member {String} password - */ - exports.prototype['password'] = undefined; - /** - * @member {String} phone - */ - exports.prototype['phone'] = undefined; - /** - * User Status - * @member {Number} userStatus - */ - exports.prototype['userStatus'] = undefined; + /** + * @member {Number} id + */ + id = undefined; + /** + * @member {String} username + */ + username = undefined; + /** + * @member {String} firstName + */ + firstName = undefined; + /** + * @member {String} lastName + */ + lastName = undefined; + /** + * @member {String} email + */ + email = undefined; + /** + * @member {String} password + */ + password = undefined; + /** + * @member {String} phone + */ + phone = undefined; + /** + * User Status + * @member {Number} userStatus + */ + userStatus = undefined; - return exports; -})); + + + + + +} diff --git a/samples/client/petstore/javascript-promise/README.md b/samples/client/petstore/javascript-promise/README.md index df887522c96..b6ceec1bbdd 100644 --- a/samples/client/petstore/javascript-promise/README.md +++ b/samples/client/petstore/javascript-promise/README.md @@ -79,6 +79,7 @@ Class | Method | HTTP request | Description *SwaggerPetstore.FakeApi* | [**testClientModel**](docs/FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model *SwaggerPetstore.FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *SwaggerPetstore.FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters +*SwaggerPetstore.FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data *SwaggerPetstore.Fake_classname_tags123Api* | [**testClassname**](docs/Fake_classname_tags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case *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 diff --git a/samples/client/petstore/javascript-promise/docs/FakeApi.md b/samples/client/petstore/javascript-promise/docs/FakeApi.md index 7bfea4df889..2b1ced3624c 100644 --- a/samples/client/petstore/javascript-promise/docs/FakeApi.md +++ b/samples/client/petstore/javascript-promise/docs/FakeApi.md @@ -11,6 +11,7 @@ Method | HTTP request | Description [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters +[**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data @@ -370,3 +371,49 @@ No authorization required - **Content-Type**: */* - **Accept**: */* + +# **testJsonFormData** +> testJsonFormData(param, param2) + +test json serialization of form data + + + +### Example +```javascript +var SwaggerPetstore = require('swagger_petstore'); + +var apiInstance = new SwaggerPetstore.FakeApi(); + +var param = "param_example"; // String | field1 + +var param2 = "param2_example"; // String | field2 + +apiInstance.testJsonFormData(param, param2).then(function() { + console.log('API called successfully.'); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | **String**| field1 | + **param2** | **String**| field2 | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + diff --git a/samples/client/petstore/javascript-promise/src/api/FakeApi.js b/samples/client/petstore/javascript-promise/src/api/FakeApi.js index 74a03d71017..eb95b4d4712 100644 --- a/samples/client/petstore/javascript-promise/src/api/FakeApi.js +++ b/samples/client/petstore/javascript-promise/src/api/FakeApi.js @@ -476,6 +476,67 @@ return response_and_data.data; }); } + + + /** + * test json serialization of form data + * + * @param {String} param field1 + * @param {String} param2 field2 + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response + */ + this.testJsonFormDataWithHttpInfo = function(param, param2) { + var postBody = null; + + // verify the required parameter 'param' is set + if (param === undefined || param === null) { + throw new Error("Missing the required parameter 'param' when calling testJsonFormData"); + } + + // verify the required parameter 'param2' is set + if (param2 === undefined || param2 === null) { + throw new Error("Missing the required parameter 'param2' when calling testJsonFormData"); + } + + + var pathParams = { + }; + var queryParams = { + }; + var collectionQueryParams = { + }; + var headerParams = { + }; + var formParams = { + 'param': param, + 'param2': param2 + }; + + var authNames = []; + var contentTypes = ['application/json']; + var accepts = []; + var returnType = null; + + return this.apiClient.callApi( + '/fake/jsonFormData', 'GET', + pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType + ); + } + + /** + * test json serialization of form data + * + * @param {String} param field1 + * @param {String} param2 field2 + * @return {Promise} a {@link https://www.promisejs.org/|Promise} + */ + this.testJsonFormData = function(param, param2) { + return this.testJsonFormDataWithHttpInfo(param, param2) + .then(function(response_and_data) { + return response_and_data.data; + }); + } }; return exports; diff --git a/samples/client/petstore/javascript/README.md b/samples/client/petstore/javascript/README.md index eff200e4844..2ea09ae3d9e 100644 --- a/samples/client/petstore/javascript/README.md +++ b/samples/client/petstore/javascript/README.md @@ -82,6 +82,7 @@ Class | Method | HTTP request | Description *SwaggerPetstore.FakeApi* | [**testClientModel**](docs/FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model *SwaggerPetstore.FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *SwaggerPetstore.FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters +*SwaggerPetstore.FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data *SwaggerPetstore.Fake_classname_tags123Api* | [**testClassname**](docs/Fake_classname_tags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case *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 diff --git a/samples/client/petstore/javascript/docs/FakeApi.md b/samples/client/petstore/javascript/docs/FakeApi.md index 85ac0b3d8a2..f9059904bbd 100644 --- a/samples/client/petstore/javascript/docs/FakeApi.md +++ b/samples/client/petstore/javascript/docs/FakeApi.md @@ -11,6 +11,7 @@ Method | HTTP request | Description [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters +[**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data @@ -391,3 +392,52 @@ No authorization required - **Content-Type**: */* - **Accept**: */* + +# **testJsonFormData** +> testJsonFormData(param, param2) + +test json serialization of form data + + + +### Example +```javascript +var SwaggerPetstore = require('swagger_petstore'); + +var apiInstance = new SwaggerPetstore.FakeApi(); + +var param = "param_example"; // String | field1 + +var param2 = "param2_example"; // String | field2 + + +var callback = function(error, data, response) { + if (error) { + console.error(error); + } else { + console.log('API called successfully.'); + } +}; +apiInstance.testJsonFormData(param, param2, callback); +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | **String**| field1 | + **param2** | **String**| field2 | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + diff --git a/samples/client/petstore/javascript/src/api/FakeApi.js b/samples/client/petstore/javascript/src/api/FakeApi.js index 7353eb33f40..156a91d18fc 100644 --- a/samples/client/petstore/javascript/src/api/FakeApi.js +++ b/samples/client/petstore/javascript/src/api/FakeApi.js @@ -417,6 +417,60 @@ authNames, contentTypes, accepts, returnType, callback ); } + + /** + * Callback function to receive the result of the testJsonFormData operation. + * @callback module:api/FakeApi~testJsonFormDataCallback + * @param {String} error Error message, if any. + * @param data This operation does not return a value. + * @param {String} response The complete HTTP response. + */ + + /** + * test json serialization of form data + * + * @param {String} param field1 + * @param {String} param2 field2 + * @param {module:api/FakeApi~testJsonFormDataCallback} callback The callback function, accepting three arguments: error, data, response + */ + this.testJsonFormData = function(param, param2, callback) { + var postBody = null; + + // verify the required parameter 'param' is set + if (param === undefined || param === null) { + throw new Error("Missing the required parameter 'param' when calling testJsonFormData"); + } + + // verify the required parameter 'param2' is set + if (param2 === undefined || param2 === null) { + throw new Error("Missing the required parameter 'param2' when calling testJsonFormData"); + } + + + var pathParams = { + }; + var queryParams = { + }; + var collectionQueryParams = { + }; + var headerParams = { + }; + var formParams = { + 'param': param, + 'param2': param2 + }; + + var authNames = []; + var contentTypes = ['application/json']; + var accepts = []; + var returnType = null; + + return this.apiClient.callApi( + '/fake/jsonFormData', 'GET', + pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, callback + ); + } }; return exports; diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/objc/core-data/SwaggerClientTests/run_xcodebuild.sh index 128a0153aa0..7553a165a4c 100755 --- a/samples/client/petstore/objc/core-data/SwaggerClientTests/run_xcodebuild.sh +++ b/samples/client/petstore/objc/core-data/SwaggerClientTests/run_xcodebuild.sh @@ -1,3 +1,3 @@ #!/bin/sh -pod install && xcodebuild clean build build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient-Example" -destination "platform=iOS Simulator,name=iPhone 5s,OS=9.3" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient-Example" -destination "platform=iOS Simulator,name=iPhone 5s,OS=9.3" | xcpretty && exit ${PIPESTATUS[0]} +pod install && xcodebuild test -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient-Example" -destination "platform=iOS Simulator,name=iPhone 5s,OS=9.3" | xcpretty && exit ${PIPESTATUS[0]} diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/objc/default/SwaggerClientTests/run_xcodebuild.sh index 128a0153aa0..7553a165a4c 100755 --- a/samples/client/petstore/objc/default/SwaggerClientTests/run_xcodebuild.sh +++ b/samples/client/petstore/objc/default/SwaggerClientTests/run_xcodebuild.sh @@ -1,3 +1,3 @@ #!/bin/sh -pod install && xcodebuild clean build build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient-Example" -destination "platform=iOS Simulator,name=iPhone 5s,OS=9.3" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient-Example" -destination "platform=iOS Simulator,name=iPhone 5s,OS=9.3" | xcpretty && exit ${PIPESTATUS[0]} +pod install && xcodebuild test -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient-Example" -destination "platform=iOS Simulator,name=iPhone 5s,OS=9.3" | xcpretty && exit ${PIPESTATUS[0]} diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Configuration.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Configuration.swift new file mode 100644 index 00000000000..c03a10b930c --- /dev/null +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Configuration.swift @@ -0,0 +1,15 @@ +// Configuration.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + +open class Configuration { + + // This value is used to configure the date formatter that is used to serialize dates into JSON format. + // You must set it prior to encoding any dates, and it will only be read once. + open static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" + +} \ No newline at end of file diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Extensions.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Extensions.swift index db5466651e1..d310882b908 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Extensions.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Extensions.swift @@ -67,7 +67,7 @@ extension Data: JSONEncodable { private let dateFormatter: DateFormatter = { let fmt = DateFormatter() - fmt.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" + fmt.dateFormat = Configuration.dateFormat fmt.locale = Locale(identifier: "en_US_POSIX") return fmt }() diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj index 9c0262e94cf..b3c65bfeb66 100644 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj +++ b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj @@ -71,6 +71,7 @@ D32130A2C8AC5B1FF21AF43BCC2B5217 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3F9B2E024A80A62FE090406312870D33 /* Foundation.framework */; }; D52A767EDADE11D49FB4D7025833E609 /* FakeAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2272FD848EBD922DFE94031D474D666A /* FakeAPI.swift */; }; D5F1BBD60108412FD5C8B320D20B2993 /* Pods-SwaggerClient-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 291054DAA3207AFC1F6B3D7AD6C25E5C /* Pods-SwaggerClient-dummy.m */; }; +<<<<<<< HEAD D72FE8F02FA0C28BF2737692CD13FA10 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = A041F36D613A417E8CCC4F038E20D9B6 /* Extensions.swift */; }; D8A9935175AB4DFA8FFDC5E976AA2498 /* Model200Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 13457FF30C11B42612C51A0EAA798710 /* Model200Response.swift */; }; D9D3DBD15D89DA6B6A4E644F0064D4E2 /* Return.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8DCE71B5892DB4B3A48674E6266D8C61 /* Return.swift */; }; @@ -79,6 +80,16 @@ E1865ED24DA0A6ADC13C2BE11AB570F3 /* Dog.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D33A220E683C35C96BD93BCC63A8206 /* Dog.swift */; }; E359A69A2F895241D105A374B150B59E /* OuterComposite.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46E264E5D125C49E1707C03CB0BFEE21 /* OuterComposite.swift */; }; EEE843F9B2F84BC97FA734CD6FE2FA62 /* FormatTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F5F498D0AFFD1FCADE5A55B7B0A9911 /* FormatTest.swift */; }; +======= + DFF51395E668CB50C62094B262D9A1C9 /* OuterComposite.swift in Sources */ = {isa = PBXBuildFile; fileRef = F336860878BAE1E9CA890278A91E5C8E /* OuterComposite.swift */; }; + E00B472B8E85B150B189F1E663AC4FF1 /* ArrayOfArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = E36384E835011F7B64D5054B85301E91 /* ArrayOfArrayOfNumberOnly.swift */; }; + E39C68251EF17F31006E3D04 /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = E39C68241EF17F31006E3D04 /* Configuration.swift */; }; + E4E4ECD4F6B7F07B3A787A3350D71FF7 /* AlamofireImplementations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 446AA4F1435CD928FC1052A8D1F731A7 /* AlamofireImplementations.swift */; }; + EA9EB849136AF56E2E80C5965399D7F2 /* PetstoreClient-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 46A8E0328DC896E0893B565FE8742167 /* PetstoreClient-dummy.m */; }; + EC099A5174E7BC4C4BE3E2A136829813 /* HasOnlyReadOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = A2C4E1F3D85C52E8B6B8C2939DBD40B2 /* HasOnlyReadOnly.swift */; }; + ECCB48FE2418D23E048BB897BB6D7ED7 /* ReadOnlyFirst.swift in Sources */ = {isa = PBXBuildFile; fileRef = 126A97A1C31AB3B4DED7360B37E0A813 /* ReadOnlyFirst.swift */; }; + ED26B1A87BB614169B10CADC5FBE35CA /* ClassModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4BEE09BF45D35F2A039032207378BCC /* ClassModel.swift */; }; +>>>>>>> origin/master EFD264FC408EBF3BA2528E70B08DDD94 /* Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = 66A46F517F0AF7E85A16D723F6406896 /* Notifications.swift */; }; F21A3972246AF75E5F40DECB20AF4D1A /* MapTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6DCF5573F3F42EF767C82F2970B589EE /* MapTest.swift */; }; F6BECD98B97CBFEBE2C96F0E9E72A6C0 /* ResponseSerialization.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2F9510473F6FFD7AA66524DB16C2263 /* ResponseSerialization.swift */; }; @@ -111,7 +122,7 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 00ACB4396DD1B4E4539E4E81C1D7A14E /* Pods-SwaggerClientTests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = "Pods-SwaggerClientTests.modulemap"; sourceTree = ""; }; + 00ACB4396DD1B4E4539E4E81C1D7A14E /* Pods-SwaggerClientTests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = "Pods-SwaggerClientTests.modulemap"; sourceTree = ""; }; 02F28E719AA874BE9213D6CF8CE7E36B /* Pods-SwaggerClientTests-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-SwaggerClientTests-acknowledgements.plist"; sourceTree = ""; }; 04F47F5C9CDB035C5AFADEBA5BF44F1C /* Response.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Response.swift; path = Source/Response.swift; sourceTree = ""; }; 0FCBF1EED873F61C6D46CE37FA5C39D3 /* DispatchQueue+Alamofire.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "DispatchQueue+Alamofire.swift"; path = "Source/DispatchQueue+Alamofire.swift"; sourceTree = ""; }; @@ -138,8 +149,12 @@ 43FC49AA70D3E2A84CAED9C37BE9C4B5 /* Pods-SwaggerClientTests-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClientTests-frameworks.sh"; sourceTree = ""; }; 46A8E0328DC896E0893B565FE8742167 /* PetstoreClient-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "PetstoreClient-dummy.m"; sourceTree = ""; }; 46CDAC6C1187C5467E576980E1062C8B /* SessionManager.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SessionManager.swift; path = Source/SessionManager.swift; sourceTree = ""; }; +<<<<<<< HEAD 46E264E5D125C49E1707C03CB0BFEE21 /* OuterComposite.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterComposite.swift; sourceTree = ""; }; 49A9B3BBFEA1CFFC48229E438EA64F9E /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Alamofire.framework; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; +======= + 49A9B3BBFEA1CFFC48229E438EA64F9E /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; +>>>>>>> origin/master 4AF006B0AD5765D1BFA8253C2DCBB126 /* AFError.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AFError.swift; path = Source/AFError.swift; sourceTree = ""; }; 4BD62BD0B8DD7137A72467441C75DE3B /* Capitalization.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Capitalization.swift; sourceTree = ""; }; 50000749782EE4E81FB84B7A4BE80B91 /* AnimalFarm.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AnimalFarm.swift; sourceTree = ""; }; @@ -154,26 +169,47 @@ 6639346628280A0D0FAD35196BF56108 /* ParameterEncoding.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ParameterEncoding.swift; path = Source/ParameterEncoding.swift; sourceTree = ""; }; 66A46F517F0AF7E85A16D723F6406896 /* Notifications.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Notifications.swift; path = Source/Notifications.swift; sourceTree = ""; }; 687B19CB3E722272B41D60B485C29EE7 /* Pods-SwaggerClientTests-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-SwaggerClientTests-dummy.m"; sourceTree = ""; }; +<<<<<<< HEAD 695814E5D32C2BBF4E5CF25BAF706613 /* EnumArrays.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumArrays.swift; sourceTree = ""; }; 6C0ACB269F0C836F1865A56C4AF7A07E /* Pods_SwaggerClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_SwaggerClient.framework; path = "Pods-SwaggerClient.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; 6C3243594B2102C5474230A5C84CAF1E /* NumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = NumberOnly.swift; sourceTree = ""; }; 6DCF5573F3F42EF767C82F2970B589EE /* MapTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MapTest.swift; sourceTree = ""; }; +======= + 69CF7B9457BAA564DBDCD74C15DB58B5 /* APIHelper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = APIHelper.swift; sourceTree = ""; }; + 6A04B8FD96CF9B18621BD5FD4288DB0A /* Models.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Models.swift; sourceTree = ""; }; + 6C0ACB269F0C836F1865A56C4AF7A07E /* Pods_SwaggerClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwaggerClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; +>>>>>>> origin/master 706C7AFFE37BA158C3553250F4B5FAED /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 7456797D43F1AAF3FEA6B302ADD7B3E7 /* OuterBoolean.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterBoolean.swift; sourceTree = ""; }; 76A7E39F3B0A5BE01392FC696FF50E07 /* OuterEnum.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterEnum.swift; sourceTree = ""; }; 7C8E63660D346FD8ED2A97242E74EA09 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +<<<<<<< HEAD 7D141D1953E5C6E67E362CE73090E48A /* Alamofire.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = Alamofire.modulemap; sourceTree = ""; }; 8269D87A82AD9AF5050B0A6B70CB1955 /* Order.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Order.swift; sourceTree = ""; }; +======= + 7CAA162642ECFEDA2F70266594B3F8D4 /* Capitalization.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Capitalization.swift; sourceTree = ""; }; + 7CCD9B1BF18DB8B2474093F63CAA4ABB /* UserAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UserAPI.swift; sourceTree = ""; }; + 7D141D1953E5C6E67E362CE73090E48A /* Alamofire.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = Alamofire.modulemap; sourceTree = ""; }; + 83C3C30BFAB81115949E9ED1801C13EA /* PetAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PetAPI.swift; sourceTree = ""; }; +>>>>>>> origin/master 849FECBC6CC67F2B6800F982927E3A9E /* Pods-SwaggerClientTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClientTests.release.xcconfig"; sourceTree = ""; }; 86B1DDCB9E27DF43C2C35D9E7B2E84DA /* Pods-SwaggerClient.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClient.release.xcconfig"; sourceTree = ""; }; 8772C980C3E7F449DBD668A8436AA127 /* ClassModel.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ClassModel.swift; sourceTree = ""; }; 87882A1F5A92C8138D54545E51D51E6F /* Timeline.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Timeline.swift; path = Source/Timeline.swift; sourceTree = ""; }; +<<<<<<< HEAD 87D52E04F8D6CC552189A05277B50796 /* Models.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Models.swift; sourceTree = ""; }; 897F0C201C5E0C66A1F1E359AECF4C9C /* PetstoreClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = PetstoreClient.framework; path = PetstoreClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 8D33A220E683C35C96BD93BCC63A8206 /* Dog.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Dog.swift; sourceTree = ""; }; 8DCE71B5892DB4B3A48674E6266D8C61 /* Return.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Return.swift; sourceTree = ""; }; 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 9581D24EE0E82B21FA9A78110A45A854 /* FakeclassnametagsAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FakeclassnametagsAPI.swift; sourceTree = ""; }; +======= + 87CD5AF7D46088322331E3BC80BC050B /* AdditionalPropertiesClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesClass.swift; sourceTree = ""; }; + 897F0C201C5E0C66A1F1E359AECF4C9C /* PetstoreClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PetstoreClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 8A0698D2EF2ACAF00C434CB9137E6858 /* EnumClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumClass.swift; sourceTree = ""; }; + 8DF7DA17836C79D5700D114169C3119F /* AnimalFarm.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AnimalFarm.swift; sourceTree = ""; }; + 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; +>>>>>>> origin/master 969C2AF48F4307163B301A92E78AFCF2 /* Pods-SwaggerClientTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClientTests.debug.xcconfig"; sourceTree = ""; }; 98A60CF6408230CE0FEF3866CFBC8AFF /* OuterNumber.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterNumber.swift; sourceTree = ""; }; 9F681D2C508D1BA8F62893120D9343A4 /* PetstoreClient-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PetstoreClient-umbrella.h"; sourceTree = ""; }; @@ -197,20 +233,38 @@ D428E85876935D0277DF38A75194582F /* StoreAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StoreAPI.swift; sourceTree = ""; }; D5E55DFE80DA371A2E2BCE1A663AC7FF /* Fake_classname_tags123API.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Fake_classname_tags123API.swift; sourceTree = ""; }; DADAB10704E49D6B9E18F59F995BB88F /* PetstoreClient.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = PetstoreClient.xcconfig; sourceTree = ""; }; +<<<<<<< HEAD DD3686F82234A4E012DE725460C9D3A4 /* MixedPropertiesAndAdditionalPropertiesClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MixedPropertiesAndAdditionalPropertiesClass.swift; sourceTree = ""; }; DE164497A94DD3215ED4D1AE0D4703B1 /* Pods-SwaggerClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = "Pods-SwaggerClient.modulemap"; sourceTree = ""; }; DFCB8C44DE758E906C0BCDA455937B85 /* Alamofire.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Alamofire.swift; path = Source/Alamofire.swift; sourceTree = ""; }; E1E4BCB344D3C100253B24B79421F00A /* Pods-SwaggerClient-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-SwaggerClient-acknowledgements.plist"; sourceTree = ""; }; E2F9510473F6FFD7AA66524DB16C2263 /* ResponseSerialization.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ResponseSerialization.swift; path = Source/ResponseSerialization.swift; sourceTree = ""; }; E3D1141B63DF38660CD6F3AC588A782B /* PetstoreClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = PetstoreClient.modulemap; sourceTree = ""; }; +======= + DE164497A94DD3215ED4D1AE0D4703B1 /* Pods-SwaggerClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = "Pods-SwaggerClient.modulemap"; sourceTree = ""; }; + DF321C5A696F2549CA703B02CE57668E /* Order.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Order.swift; sourceTree = ""; }; + DFCB8C44DE758E906C0BCDA455937B85 /* Alamofire.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Alamofire.swift; path = Source/Alamofire.swift; sourceTree = ""; }; + E1E4BCB344D3C100253B24B79421F00A /* Pods-SwaggerClient-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-SwaggerClient-acknowledgements.plist"; sourceTree = ""; }; + E2F9510473F6FFD7AA66524DB16C2263 /* ResponseSerialization.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ResponseSerialization.swift; path = Source/ResponseSerialization.swift; sourceTree = ""; }; + E36384E835011F7B64D5054B85301E91 /* ArrayOfArrayOfNumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayOfArrayOfNumberOnly.swift; sourceTree = ""; }; + E39C68241EF17F31006E3D04 /* Configuration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Configuration.swift; sourceTree = ""; }; + E3D1141B63DF38660CD6F3AC588A782B /* PetstoreClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = PetstoreClient.modulemap; sourceTree = ""; }; +>>>>>>> origin/master E4E6F4A58FE7868CA2177D3AC79AD2FA /* Pods-SwaggerClientTests-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClientTests-resources.sh"; sourceTree = ""; }; E4F88C620BD7B42F70896609E123A302 /* SpecialModelName.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SpecialModelName.swift; sourceTree = ""; }; E5A8AA5F9EDED0A0BDDE7E830BF4AEE0 /* NetworkReachabilityManager.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = NetworkReachabilityManager.swift; path = Source/NetworkReachabilityManager.swift; sourceTree = ""; }; E5EB08623124474060E4892ABF163A23 /* ArrayTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayTest.swift; sourceTree = ""; }; E6F34CCF86067ED508C12C676E298C69 /* Alamofire.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Alamofire.xcconfig; sourceTree = ""; }; +<<<<<<< HEAD E7F47D8A64DA3C94023F7DAEA055BF12 /* PetAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PetAPI.swift; sourceTree = ""; }; EA3FFA48FB4D08FC02C47F71C0089CD9 /* Pods_SwaggerClientTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_SwaggerClientTests.framework; path = "Pods-SwaggerClientTests.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; ED93B12264EE3ECF214E885C7D5B169D /* AlamofireImplementations.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AlamofireImplementations.swift; sourceTree = ""; }; +======= + EA14FECBFF7BAF8F7800C53E30DF6F89 /* OuterString.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterString.swift; sourceTree = ""; }; + EA3FFA48FB4D08FC02C47F71C0089CD9 /* Pods_SwaggerClientTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwaggerClientTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + EB87FB89CC7971C5349574DA439137B9 /* User.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; + ECF292015DBDB2BCF7990C6EC267F23B /* APIs.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = APIs.swift; sourceTree = ""; }; +>>>>>>> origin/master F0D4E00A8974E74325E9E53D456F9AD4 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; F22FE315AC1C04A8749BD18281EE9028 /* Pods-SwaggerClientTests-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-SwaggerClientTests-umbrella.h"; sourceTree = ""; }; FB170EFD14935F121CDE3211DB4C5CA3 /* Pods-SwaggerClientTests-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-SwaggerClientTests-acknowledgements.markdown"; sourceTree = ""; }; @@ -264,8 +318,12 @@ 78742AC6A73AE41086A2AFDF31697B4E /* APIs */, 7AFCC226320EECF523D29C0DE9248826 /* Models */, ); +<<<<<<< HEAD name = Swaggers; path = Swaggers; +======= + path = Models; +>>>>>>> origin/master sourceTree = ""; }; 200D10EB20F0397D47F022B50CF0433F /* Alamofire */ = { @@ -290,7 +348,6 @@ B029DBC43E49A740F12B5E4D2E6DD452 /* Validation.swift */, 55F14F994FE7AB51F028BFE66CEF3106 /* Support Files */, ); - name = Alamofire; path = Alamofire; sourceTree = ""; }; @@ -302,6 +359,24 @@ name = "Development Pods"; sourceTree = ""; }; +<<<<<<< HEAD +======= + 275CABFE9E1B588E8668908DE0DE85AD /* Swaggers */ = { + isa = PBXGroup; + children = ( + E39C68241EF17F31006E3D04 /* Configuration.swift */, + 446AA4F1435CD928FC1052A8D1F731A7 /* AlamofireImplementations.swift */, + 69CF7B9457BAA564DBDCD74C15DB58B5 /* APIHelper.swift */, + ECF292015DBDB2BCF7990C6EC267F23B /* APIs.swift */, + A1FAF68F86EFA2896D6066D4FA89D6AD /* Extensions.swift */, + 6A04B8FD96CF9B18621BD5FD4288DB0A /* Models.swift */, + 5AFC4EDB2DA38C8D4A113D32F0F8E4AA /* APIs */, + 12DEA2B1DC312FDD717E14A9BDB9E717 /* Models */, + ); + path = Swaggers; + sourceTree = ""; + }; +>>>>>>> origin/master 35F128EB69B6F7FB7DA93BBF6C130FAE /* Pods */ = { isa = PBXGroup; children = ( @@ -343,7 +418,6 @@ D428E85876935D0277DF38A75194582F /* StoreAPI.swift */, 32707EEAD9C088A20FA4FBAF64AE735C /* UserAPI.swift */, ); - name = APIs; path = APIs; sourceTree = ""; }; @@ -459,7 +533,6 @@ children = ( 014A918F89FFD24641261772533C92D8 /* Swaggers */, ); - name = Classes; path = Classes; sourceTree = ""; }; @@ -495,7 +568,6 @@ children = ( AD94092456F8ABCB18F74CAC75AD85DE /* Classes */, ); - name = PetstoreClient; path = PetstoreClient; sourceTree = ""; }; @@ -655,6 +727,7 @@ 9ED2BB2981896E0A39EFA365503F58CE /* AFError.swift in Sources */, A9EEEA7477981DEEBC72432DE9990A4B /* Alamofire-dummy.m in Sources */, F8B3D3092ED0417E8CDF32033F6122F5 /* Alamofire.swift in Sources */, + E39C68251EF17F31006E3D04 /* Configuration.swift in Sources */, 61200D01A1855D7920CEF835C8BE00B0 /* DispatchQueue+Alamofire.swift in Sources */, B65FCF589DA398C3EFE0128064E510EC /* MultipartFormData.swift in Sources */, A2A6F71B727312BD45CC7A4AAD7B0AB7 /* NetworkReachabilityManager.swift in Sources */, diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Configuration.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Configuration.swift new file mode 100644 index 00000000000..c03a10b930c --- /dev/null +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Configuration.swift @@ -0,0 +1,15 @@ +// Configuration.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + +open class Configuration { + + // This value is used to configure the date formatter that is used to serialize dates into JSON format. + // You must set it prior to encoding any dates, and it will only be read once. + open static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" + +} \ No newline at end of file diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Extensions.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Extensions.swift index af50f1486a7..c123e070527 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Extensions.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Extensions.swift @@ -68,7 +68,7 @@ extension Data: JSONEncodable { private let dateFormatter: DateFormatter = { let fmt = DateFormatter() - fmt.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" + fmt.dateFormat = Configuration.dateFormat fmt.locale = Locale(identifier: "en_US_POSIX") return fmt }() diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj index 239a973ba3c..ea6502169ce 100644 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj +++ b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj @@ -120,6 +120,7 @@ CFA32E12B3FB399F1E25A830B6168646 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C8F4E041B8F062D0E58498A365070ED8 /* Foundation.framework */; }; CFCB1804CAD468BC19D46A20401ED982 /* Client.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1D9B6A20198F93C71DE1D2C2FFC2BE9 /* Client.swift */; }; D32130A2C8AC5B1FF21AF43BCC2B5217 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C8F4E041B8F062D0E58498A365070ED8 /* Foundation.framework */; }; +<<<<<<< HEAD D900813E538BF9DAAEAF05A30DAE9881 /* OuterNumber.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98A60CF6408230CE0FEF3866CFBC8AFF /* OuterNumber.swift */; }; D9B3F3CC2C9120385C903AC3BDCE2E7E /* PMKQuartzCore.h in Headers */ = {isa = PBXBuildFile; fileRef = 584464ED8CD0D083C3125CBCE3F07BA1 /* PMKQuartzCore.h */; settings = {ATTRIBUTES = (Public, ); }; }; DCE2F57D43CB9B04A828806077DCDDE4 /* ReadOnlyFirst.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8304535B54C5E9813BDA0EE6FA3A166 /* ReadOnlyFirst.swift */; }; @@ -132,6 +133,27 @@ E6CB036F0DB6727CB7AE4E7880C56618 /* hang.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E0D7BCA2C0C3C6ABB215B192FE61633 /* hang.m */; }; E71F075525962E3B24667CCC7E751D7B /* Promise+Properties.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C42CC2D632364C7CA8BB4857F2F9C6F /* Promise+Properties.swift */; }; EADE79189C9E6C9E34AFB602226F5EE2 /* PetAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = E7F47D8A64DA3C94023F7DAEA055BF12 /* PetAPI.swift */; }; +======= + D475844378C21E8C6DF99EBAD218BE2A /* join.swift in Sources */ = {isa = PBXBuildFile; fileRef = E92EF227AB7E7DD3F054096F5CC1A430 /* join.swift */; }; + D4A4DA3DB64C5563277DAA09EF19FBEA /* PMKAlertController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A1934708EF63D8175858BE77D4CC707 /* PMKAlertController.swift */; }; + D671DEDDEBBC4623B9CBCAF31CA8E00E /* Animal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042B9E19CCDC65CDBD7F68F114E9FA76 /* Animal.swift */; }; + D9624B083E4F321FC71B6D1479D603E5 /* PromiseKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 31D680492464F6D65F2FAFA3D645CFFC /* PromiseKit.framework */; }; + DBBA35964295D81CE1107E4F23692571 /* OuterBoolean.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDE74487389C5091910590BD0378CE8B /* OuterBoolean.swift */; }; + DD72D57CC6618E5AB26AFC810A7BF8BF /* Order.swift in Sources */ = {isa = PBXBuildFile; fileRef = DF321C5A696F2549CA703B02CE57668E /* Order.swift */; }; + DE412D1E2A3EEE2DC0AC669BE3546B4B /* OuterComposite.swift in Sources */ = {isa = PBXBuildFile; fileRef = F336860878BAE1E9CA890278A91E5C8E /* OuterComposite.swift */; }; + DEDF51FC50B8CF8BFFCD936B087025AD /* NSURLSession+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = BA71549EA391E3A6799E5E2083D51179 /* NSURLSession+Promise.swift */; }; + DF9669C20DEE106A57CDD3D047F36662 /* PetstoreClient-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 46A8E0328DC896E0893B565FE8742167 /* PetstoreClient-dummy.m */; }; + E1632A7B9365E51B3CFA83F6A1F80C31 /* UIView+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = 607DB4D4E14EB20C4DE0C6BD2FA4A922 /* UIView+AnyPromise.m */; }; + E34E3F861EF3CD7E007A6E4F /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = E34E3F851EF3CD7E007A6E4F /* Configuration.swift */; }; + E3B2463F6E53108E7847CA9CC74C395C /* HasOnlyReadOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = A2C4E1F3D85C52E8B6B8C2939DBD40B2 /* HasOnlyReadOnly.swift */; }; + E4A31FDE330F502AA5B5A2075712A85F /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F53D6FE99858297507D97FCDF5F0F461 /* Alamofire.framework */; }; + E6646C1E3E69FEAE7E371576471FD09A /* OuterString.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA14FECBFF7BAF8F7800C53E30DF6F89 /* OuterString.swift */; }; + E74A59F81B8261085968E545EA4EE024 /* NSNotificationCenter+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = 3BF219E6163D01FB1E793CA0AE97EF67 /* NSNotificationCenter+AnyPromise.m */; }; + E818B2D6C4919BC5F0B91F66E9B9A163 /* ClassModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4BEE09BF45D35F2A039032207378BCC /* ClassModel.swift */; }; + E97F49D0BA36A6A3BB6D878FB61538C3 /* Name.swift in Sources */ = {isa = PBXBuildFile; fileRef = A2C139ABD49ABB94DC02E2AD38AFA4EA /* Name.swift */; }; + EC385D8316A824E9C7B5AFA7986A3F0A /* NSNotificationCenter+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 7DEB18C435BF545F4290754BD12ACA89 /* NSNotificationCenter+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; + EC56CD29FB2B78CA9F5919FB3F4628D3 /* ArrayOfArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = E36384E835011F7B64D5054B85301E91 /* ArrayOfArrayOfNumberOnly.swift */; }; +>>>>>>> origin/master EFD264FC408EBF3BA2528E70B08DDD94 /* Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2DE0CB8D9EE8A56D63B991586247B70A /* Notifications.swift */; }; F5056D891EB2E8ADD5AABE81590DA0EE /* when.m in Sources */ = {isa = PBXBuildFile; fileRef = 152E92E58DF288044CE0369CD8522B52 /* when.m */; }; F5752CE852E4E651FA9E36D54CFF4CE5 /* OuterComposite.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46E264E5D125C49E1707C03CB0BFEE21 /* OuterComposite.swift */; }; @@ -178,14 +200,14 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 00ACB4396DD1B4E4539E4E81C1D7A14E /* Pods-SwaggerClientTests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = "Pods-SwaggerClientTests.modulemap"; sourceTree = ""; }; + 00ACB4396DD1B4E4539E4E81C1D7A14E /* Pods-SwaggerClientTests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = "Pods-SwaggerClientTests.modulemap"; sourceTree = ""; }; 0296C2154D0CAB4EE1AF3AD456C7207F /* AnyPromise.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AnyPromise.m; path = Sources/AnyPromise.m; sourceTree = ""; }; 02F28E719AA874BE9213D6CF8CE7E36B /* Pods-SwaggerClientTests-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-SwaggerClientTests-acknowledgements.plist"; sourceTree = ""; }; 06FB2C2C487F62C8E234E5F309EE50EE /* Process+Promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Process+Promise.swift"; path = "Extensions/Foundation/Sources/Process+Promise.swift"; sourceTree = ""; }; 0720785FA765917D0C03A126E07CB2C5 /* AnyPromise.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AnyPromise.h; path = Sources/AnyPromise.h; sourceTree = ""; }; 08BC2EAEE303ADCEB346C66DA76C7B56 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 0A0A7AF3E4D82A790BC8A16BB4972FA7 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 0B4A4A4EB2DBD6F56B1383E53763FD1B /* PetstoreClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = PetstoreClient.framework; path = PetstoreClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 0B4A4A4EB2DBD6F56B1383E53763FD1B /* PetstoreClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PetstoreClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 0B83848569669227892C0BF2A5CE1835 /* wrap.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = wrap.swift; path = Sources/wrap.swift; sourceTree = ""; }; 0E0D7BCA2C0C3C6ABB215B192FE61633 /* hang.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = hang.m; path = Sources/hang.m; sourceTree = ""; }; 103847E55D2DB836C4726FD119FCFA4F /* DispatchQueue+Promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "DispatchQueue+Promise.swift"; path = "Sources/DispatchQueue+Promise.swift"; sourceTree = ""; }; @@ -207,10 +229,15 @@ 2FF17440CCD2E1A69791A4AA23325AD5 /* Pods-SwaggerClient-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-SwaggerClient-acknowledgements.markdown"; sourceTree = ""; }; 31D680492464F6D65F2FAFA3D645CFFC /* PromiseKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PromiseKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 3227553C2F6B960B53F2DADD2091E856 /* SessionManager.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SessionManager.swift; path = Source/SessionManager.swift; sourceTree = ""; }; +<<<<<<< HEAD 32707EEAD9C088A20FA4FBAF64AE735C /* UserAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UserAPI.swift; sourceTree = ""; }; 333A9E9802CC9090A44946166799777F /* PromiseKit.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = PromiseKit.modulemap; sourceTree = ""; }; 33C32CDB946507FDFB63393FE480A558 /* List.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = List.swift; sourceTree = ""; }; 39A0FC58C07E05F432AD8B495B1DBAB6 /* Cat.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Cat.swift; sourceTree = ""; }; +======= + 333A9E9802CC9090A44946166799777F /* PromiseKit.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = PromiseKit.modulemap; sourceTree = ""; }; + 3A5FE293C325570B9E21AF9F1D42817C /* MapTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MapTest.swift; sourceTree = ""; }; +>>>>>>> origin/master 3BF219E6163D01FB1E793CA0AE97EF67 /* NSNotificationCenter+AnyPromise.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSNotificationCenter+AnyPromise.m"; path = "Extensions/Foundation/Sources/NSNotificationCenter+AnyPromise.m"; sourceTree = ""; }; 3C42CC2D632364C7CA8BB4857F2F9C6F /* Promise+Properties.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Promise+Properties.swift"; path = "Sources/Promise+Properties.swift"; sourceTree = ""; }; 3DB83DEE18EB958220B42D26A726EA74 /* CALayer+AnyPromise.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "CALayer+AnyPromise.h"; path = "Extensions/QuartzCore/Sources/CALayer+AnyPromise.h"; sourceTree = ""; }; @@ -220,7 +247,7 @@ 3F78284F7B9A118A7B3040F17CC8796B /* Name.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Name.swift; sourceTree = ""; }; 43FC49AA70D3E2A84CAED9C37BE9C4B5 /* Pods-SwaggerClientTests-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClientTests-frameworks.sh"; sourceTree = ""; }; 4655B4C1707E9902435774C9B1981618 /* Error.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Error.swift; path = Sources/Error.swift; sourceTree = ""; }; - 46A00B403166BEF9EE215F6CB59BE9A6 /* Pods_SwaggerClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_SwaggerClient.framework; path = "Pods-SwaggerClient.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; + 46A00B403166BEF9EE215F6CB59BE9A6 /* Pods_SwaggerClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwaggerClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 46A8E0328DC896E0893B565FE8742167 /* PetstoreClient-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "PetstoreClient-dummy.m"; sourceTree = ""; }; 46E264E5D125C49E1707C03CB0BFEE21 /* OuterComposite.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterComposite.swift; sourceTree = ""; }; 475705EF39C1CD6FEAE0873C0353F9A7 /* PMKUIKit.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = PMKUIKit.h; path = Extensions/UIKit/Sources/PMKUIKit.h; sourceTree = ""; }; @@ -269,13 +296,20 @@ 849FECBC6CC67F2B6800F982927E3A9E /* Pods-SwaggerClientTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClientTests.release.xcconfig"; sourceTree = ""; }; 86B1DDCB9E27DF43C2C35D9E7B2E84DA /* Pods-SwaggerClient.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClient.release.xcconfig"; sourceTree = ""; }; 86FB9D88F32EB25214615C461AC6C432 /* NSNotificationCenter+Promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "NSNotificationCenter+Promise.swift"; path = "Extensions/Foundation/Sources/NSNotificationCenter+Promise.swift"; sourceTree = ""; }; +<<<<<<< HEAD 8772C980C3E7F449DBD668A8436AA127 /* ClassModel.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ClassModel.swift; sourceTree = ""; }; 87D52E04F8D6CC552189A05277B50796 /* Models.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Models.swift; sourceTree = ""; }; 8BBF3490280C4ED53738743F84C890BC /* Pods_SwaggerClientTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_SwaggerClientTests.framework; path = "Pods-SwaggerClientTests.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; 8D33A220E683C35C96BD93BCC63A8206 /* Dog.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Dog.swift; sourceTree = ""; }; 8DCE71B5892DB4B3A48674E6266D8C61 /* Return.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Return.swift; sourceTree = ""; }; +======= + 87CD5AF7D46088322331E3BC80BC050B /* AdditionalPropertiesClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesClass.swift; sourceTree = ""; }; + 8A0698D2EF2ACAF00C434CB9137E6858 /* EnumClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumClass.swift; sourceTree = ""; }; + 8BBF3490280C4ED53738743F84C890BC /* Pods_SwaggerClientTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwaggerClientTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 8DF7DA17836C79D5700D114169C3119F /* AnimalFarm.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AnimalFarm.swift; sourceTree = ""; }; +>>>>>>> origin/master 8E47C91B82D7EF2401C4A7D2DA4F7B72 /* UIViewController+Promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UIViewController+Promise.swift"; path = "Extensions/UIKit/Sources/UIViewController+Promise.swift"; sourceTree = ""; }; - 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; + 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 943618599D753D3CF9CEA416875D6417 /* Validation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Validation.swift; path = Source/Validation.swift; sourceTree = ""; }; 9581D24EE0E82B21FA9A78110A45A854 /* FakeclassnametagsAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FakeclassnametagsAPI.swift; sourceTree = ""; }; 969C2AF48F4307163B301A92E78AFCF2 /* Pods-SwaggerClientTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClientTests.debug.xcconfig"; sourceTree = ""; }; @@ -287,9 +321,15 @@ A4AECF8B352819D57BE253B02387B58E /* SessionDelegate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SessionDelegate.swift; path = Source/SessionDelegate.swift; sourceTree = ""; }; A583E04FA44E6EB8B13CFBD3C4BC1016 /* NSTask+AnyPromise.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSTask+AnyPromise.m"; path = "Extensions/Foundation/Sources/NSTask+AnyPromise.m"; sourceTree = ""; }; AAC0733365F6A9BF565156D2FFA419ED /* Promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Promise.swift; path = Sources/Promise.swift; sourceTree = ""; }; +<<<<<<< HEAD AC28EAD09953B2F12CEFAFAEA7D04ECE /* ArrayOfNumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayOfNumberOnly.swift; sourceTree = ""; }; AD3B511F5C43568AAFBA2714468F9FD5 /* PromiseKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = PromiseKit.framework; path = PromiseKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; AD3C5E0062F758F6329D06621C8ADCD4 /* ArrayOfArrayOfNumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayOfArrayOfNumberOnly.swift; sourceTree = ""; }; +======= + AD3B511F5C43568AAFBA2714468F9FD5 /* PromiseKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PromiseKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + AE166325CA9F0847B8D3B69E9618A90D /* Dog.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Dog.swift; sourceTree = ""; }; + B0AE693AEB9A2624CADBCC38B3AD78B5 /* EnumTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumTest.swift; sourceTree = ""; }; +>>>>>>> origin/master B2D46CA33667445037B49DB2E4682861 /* PromiseKit-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PromiseKit-umbrella.h"; sourceTree = ""; }; B3964284F8F6A5A28F29B90488E973D9 /* Pet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Pet.swift; sourceTree = ""; }; B3A144887C8B13FD888B76AB096B0CA1 /* PetstoreClient-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PetstoreClient-prefix.pch"; sourceTree = ""; }; @@ -298,7 +338,12 @@ BAF01D809260F177266BCDEB5D85A6F4 /* CALayer+AnyPromise.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "CALayer+AnyPromise.m"; path = "Extensions/QuartzCore/Sources/CALayer+AnyPromise.m"; sourceTree = ""; }; BCF2D4DFF08D2A18E8C8FE4C4B4633FB /* Pods-SwaggerClient-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClient-frameworks.sh"; sourceTree = ""; }; BFD4C386443F3A9950AA00E1C6127C2B /* UIViewController+AnyPromise.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIViewController+AnyPromise.h"; path = "Extensions/UIKit/Sources/UIViewController+AnyPromise.h"; sourceTree = ""; }; +<<<<<<< HEAD C0C4B8ED879AE799525B69F4E8C51B1E /* Alamofire.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = Alamofire.modulemap; sourceTree = ""; }; +======= + C0B050784C4673F342686C9BAD7AA189 /* ArrayOfNumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayOfNumberOnly.swift; sourceTree = ""; }; + C0C4B8ED879AE799525B69F4E8C51B1E /* Alamofire.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = Alamofire.modulemap; sourceTree = ""; }; +>>>>>>> origin/master C31B213B335DFB715738D846C9799EC8 /* PMKFoundation.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = PMKFoundation.h; path = Extensions/Foundation/Sources/PMKFoundation.h; sourceTree = ""; }; C3DD4689CB744B566DA645A762474D50 /* Alamofire.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Alamofire.swift; path = Source/Alamofire.swift; sourceTree = ""; }; C440049BD75402A20C0E2ECFF1A18D69 /* HasOnlyReadOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = HasOnlyReadOnly.swift; sourceTree = ""; }; @@ -315,17 +360,30 @@ D5E55DFE80DA371A2E2BCE1A663AC7FF /* Fake_classname_tags123API.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Fake_classname_tags123API.swift; sourceTree = ""; }; D6C0428DC253F416C26670E1A755E6C7 /* PromiseKit.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = PromiseKit.xcconfig; sourceTree = ""; }; DADAB10704E49D6B9E18F59F995BB88F /* PetstoreClient.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = PetstoreClient.xcconfig; sourceTree = ""; }; +<<<<<<< HEAD DD3686F82234A4E012DE725460C9D3A4 /* MixedPropertiesAndAdditionalPropertiesClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MixedPropertiesAndAdditionalPropertiesClass.swift; sourceTree = ""; }; DE164497A94DD3215ED4D1AE0D4703B1 /* Pods-SwaggerClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = "Pods-SwaggerClient.modulemap"; sourceTree = ""; }; E1E4BCB344D3C100253B24B79421F00A /* Pods-SwaggerClient-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-SwaggerClient-acknowledgements.plist"; sourceTree = ""; }; E3D1141B63DF38660CD6F3AC588A782B /* PetstoreClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = PetstoreClient.modulemap; sourceTree = ""; }; +======= + DE164497A94DD3215ED4D1AE0D4703B1 /* Pods-SwaggerClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = "Pods-SwaggerClient.modulemap"; sourceTree = ""; }; + DF321C5A696F2549CA703B02CE57668E /* Order.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Order.swift; sourceTree = ""; }; + E1E4BCB344D3C100253B24B79421F00A /* Pods-SwaggerClient-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-SwaggerClient-acknowledgements.plist"; sourceTree = ""; }; + E34E3F851EF3CD7E007A6E4F /* Configuration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Configuration.swift; sourceTree = ""; }; + E36384E835011F7B64D5054B85301E91 /* ArrayOfArrayOfNumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayOfArrayOfNumberOnly.swift; sourceTree = ""; }; + E3D1141B63DF38660CD6F3AC588A782B /* PetstoreClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = PetstoreClient.modulemap; sourceTree = ""; }; +>>>>>>> origin/master E470520443CDA5BBDA7D716E9AFEF14C /* NSURLSession+AnyPromise.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSURLSession+AnyPromise.m"; path = "Extensions/Foundation/Sources/NSURLSession+AnyPromise.m"; sourceTree = ""; }; E4E6F4A58FE7868CA2177D3AC79AD2FA /* Pods-SwaggerClientTests-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClientTests-resources.sh"; sourceTree = ""; }; E4F88C620BD7B42F70896609E123A302 /* SpecialModelName.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SpecialModelName.swift; sourceTree = ""; }; E5EB08623124474060E4892ABF163A23 /* ArrayTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayTest.swift; sourceTree = ""; }; E6880118613493912D876F6EDAC620D3 /* NSObject+Promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "NSObject+Promise.swift"; path = "Extensions/Foundation/Sources/NSObject+Promise.swift"; sourceTree = ""; }; +<<<<<<< HEAD E7F47D8A64DA3C94023F7DAEA055BF12 /* PetAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PetAPI.swift; sourceTree = ""; }; E80A16C989615AAE419866DB4FD10185 /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Alamofire.framework; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; +======= + E80A16C989615AAE419866DB4FD10185 /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; +>>>>>>> origin/master E92EF227AB7E7DD3F054096F5CC1A430 /* join.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = join.swift; path = Sources/join.swift; sourceTree = ""; }; ED93B12264EE3ECF214E885C7D5B169D /* AlamofireImplementations.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AlamofireImplementations.swift; sourceTree = ""; }; F05F43847135C8DA403312FBEDB1F49F /* after.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = after.swift; path = Sources/after.swift; sourceTree = ""; }; @@ -423,6 +481,52 @@ name = Foundation; sourceTree = ""; }; +<<<<<<< HEAD +======= + 12DEA2B1DC312FDD717E14A9BDB9E717 /* Models */ = { + isa = PBXGroup; + children = ( + 87CD5AF7D46088322331E3BC80BC050B /* AdditionalPropertiesClass.swift */, + 042B9E19CCDC65CDBD7F68F114E9FA76 /* Animal.swift */, + 8DF7DA17836C79D5700D114169C3119F /* AnimalFarm.swift */, + FDDD93B4507C3265C8D1F317E7C46924 /* ApiResponse.swift */, + E36384E835011F7B64D5054B85301E91 /* ArrayOfArrayOfNumberOnly.swift */, + C0B050784C4673F342686C9BAD7AA189 /* ArrayOfNumberOnly.swift */, + D0C628AEB5916C4CE7044287CA6E4979 /* ArrayTest.swift */, + 7CAA162642ECFEDA2F70266594B3F8D4 /* Capitalization.swift */, + C9E9A12519387508C3E55F6292B93FF1 /* Cat.swift */, + D39C8BC96A8762DFE8F331BA30F1DA0C /* Category.swift */, + F4BEE09BF45D35F2A039032207378BCC /* ClassModel.swift */, + 1C7581B29C3C8A04E79270927392696E /* Client.swift */, + AE166325CA9F0847B8D3B69E9618A90D /* Dog.swift */, + 6511D3DCA91FA2D78DD9013EE95E7D58 /* EnumArrays.swift */, + 8A0698D2EF2ACAF00C434CB9137E6858 /* EnumClass.swift */, + B0AE693AEB9A2624CADBCC38B3AD78B5 /* EnumTest.swift */, + 0DA9D22EFDA73BFFC2F0E4BA314DFFFE /* FormatTest.swift */, + A2C4E1F3D85C52E8B6B8C2939DBD40B2 /* HasOnlyReadOnly.swift */, + 3FE87C214B3FC88BD5D0158C125A3BDE /* List.swift */, + 3A5FE293C325570B9E21AF9F1D42817C /* MapTest.swift */, + 3D5F754EB34AB8320D646085EDD6B1C8 /* MixedPropertiesAndAdditionalPropertiesClass.swift */, + 2EB42698C78227CB46391092003E81CA /* Model200Response.swift */, + A2C139ABD49ABB94DC02E2AD38AFA4EA /* Name.swift */, + 081DF7A701B93326C82A6A672C00B3AB /* NumberOnly.swift */, + DF321C5A696F2549CA703B02CE57668E /* Order.swift */, + BDE74487389C5091910590BD0378CE8B /* OuterBoolean.swift */, + F336860878BAE1E9CA890278A91E5C8E /* OuterComposite.swift */, + 4B5843BB40297BE310E947CEE7926962 /* OuterEnum.swift */, + A394D156099766C154890037D1B69E57 /* OuterNumber.swift */, + EA14FECBFF7BAF8F7800C53E30DF6F89 /* OuterString.swift */, + 06ED7312B45ED8BAF27E7FE1B6B6924C /* Pet.swift */, + 126A97A1C31AB3B4DED7360B37E0A813 /* ReadOnlyFirst.swift */, + D05FE06F98CB6690174C0970F50B70C2 /* Return.swift */, + 03CE36E3173971E820F39F1C07F67BDC /* SpecialModelName.swift */, + 1016F63DCF7F423DD8C2FE24916B374B /* Tag.swift */, + EB87FB89CC7971C5349574DA439137B9 /* User.swift */, + ); + path = Models; + sourceTree = ""; + }; +>>>>>>> origin/master 22F52349E1BE90FC6E064DAAC9EA9612 /* Development Pods */ = { isa = PBXGroup; children = ( @@ -440,10 +544,27 @@ 8349D367FE0957C4AFA12D8CA5EA5B44 /* Support Files */, 4C35F42FA9EA91ABFFA7ECEDDFB2E61A /* UIKit */, ); - name = PromiseKit; path = PromiseKit; sourceTree = ""; }; +<<<<<<< HEAD +======= + 275CABFE9E1B588E8668908DE0DE85AD /* Swaggers */ = { + isa = PBXGroup; + children = ( + E34E3F851EF3CD7E007A6E4F /* Configuration.swift */, + 446AA4F1435CD928FC1052A8D1F731A7 /* AlamofireImplementations.swift */, + 69CF7B9457BAA564DBDCD74C15DB58B5 /* APIHelper.swift */, + ECF292015DBDB2BCF7990C6EC267F23B /* APIs.swift */, + A1FAF68F86EFA2896D6066D4FA89D6AD /* Extensions.swift */, + 6A04B8FD96CF9B18621BD5FD4288DB0A /* Models.swift */, + 5AFC4EDB2DA38C8D4A113D32F0F8E4AA /* APIs */, + 12DEA2B1DC312FDD717E14A9BDB9E717 /* Models */, + ); + path = Swaggers; + sourceTree = ""; + }; +>>>>>>> origin/master 470B2EC4B502506F1DCAE0EE7E194226 /* Support Files */ = { isa = PBXGroup; children = ( @@ -473,6 +594,21 @@ name = UIKit; sourceTree = ""; }; +<<<<<<< HEAD +======= + 5AFC4EDB2DA38C8D4A113D32F0F8E4AA /* APIs */ = { + isa = PBXGroup; + children = ( + 20CB1C29AEEDDA61F383A0344CEF2F78 /* FakeAPI.swift */, + 99014EF0D973E04B0E4D6AF4FC023570 /* FakeclassnametagsAPI.swift */, + 83C3C30BFAB81115949E9ED1801C13EA /* PetAPI.swift */, + 22F07E9187F96D2A4B224B9E61CC33A8 /* StoreAPI.swift */, + 7CCD9B1BF18DB8B2474093F63CAA4ABB /* UserAPI.swift */, + ); + path = APIs; + sourceTree = ""; + }; +>>>>>>> origin/master 6B8BED723E1865D5B9F1AC8B17FF7035 /* CorePromise */ = { isa = PBXGroup; children = ( @@ -634,7 +770,6 @@ children = ( 014A918F89FFD24641261772533C92D8 /* Swaggers */, ); - name = Classes; path = Classes; sourceTree = ""; }; @@ -691,7 +826,6 @@ 943618599D753D3CF9CEA416875D6417 /* Validation.swift */, 470B2EC4B502506F1DCAE0EE7E194226 /* Support Files */, ); - name = Alamofire; path = Alamofire; sourceTree = ""; }; @@ -737,7 +871,6 @@ children = ( AD94092456F8ABCB18F74CAC75AD85DE /* Classes */, ); - name = PetstoreClient; path = PetstoreClient; sourceTree = ""; }; @@ -937,6 +1070,7 @@ 9ED2BB2981896E0A39EFA365503F58CE /* AFError.swift in Sources */, A9EEEA7477981DEEBC72432DE9990A4B /* Alamofire-dummy.m in Sources */, F8B3D3092ED0417E8CDF32033F6122F5 /* Alamofire.swift in Sources */, + E34E3F861EF3CD7E007A6E4F /* Configuration.swift in Sources */, 61200D01A1855D7920CEF835C8BE00B0 /* DispatchQueue+Alamofire.swift in Sources */, B65FCF589DA398C3EFE0128064E510EC /* MultipartFormData.swift in Sources */, A2A6F71B727312BD45CC7A4AAD7B0AB7 /* NetworkReachabilityManager.swift in Sources */, diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Configuration.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Configuration.swift new file mode 100644 index 00000000000..c03a10b930c --- /dev/null +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Configuration.swift @@ -0,0 +1,15 @@ +// Configuration.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + +open class Configuration { + + // This value is used to configure the date formatter that is used to serialize dates into JSON format. + // You must set it prior to encoding any dates, and it will only be read once. + open static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" + +} \ No newline at end of file diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Extensions.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Extensions.swift index db5466651e1..d310882b908 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Extensions.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Extensions.swift @@ -67,7 +67,7 @@ extension Data: JSONEncodable { private let dateFormatter: DateFormatter = { let fmt = DateFormatter() - fmt.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" + fmt.dateFormat = Configuration.dateFormat fmt.locale = Locale(identifier: "en_US_POSIX") return fmt }() diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj index cef8163466a..dc9f4a5c37a 100644 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj +++ b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj @@ -193,6 +193,7 @@ CDD81EA302C7179C81624B9163AC3B90 /* ElementAt.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0668A90FD8DFEB8D178EE6721979B788 /* ElementAt.swift */; }; D29EB4467D929B725B3C4772A9D0CFC9 /* SkipUntil.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C897A93D54D11502C0795F3D0F8510F /* SkipUntil.swift */; }; D32130A2C8AC5B1FF21AF43BCC2B5217 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AE307308EA13685E2F9959277D7E355A /* Foundation.framework */; }; +<<<<<<< HEAD D54E2205A24AFCB921EFC74271EE701E /* Deprecated.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63A236E8B385B46BC8C1268A38CCBDE5 /* Deprecated.swift */; }; D57B92BEC8B854B7BF37E4B8061797B1 /* ObservableType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B4FF38E4CA2AFB54D788C9F1919BFA8 /* ObservableType.swift */; }; D86F2A5D49536A92E96CE05A97A5030E /* ArrayTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0C628AEB5916C4CE7044287CA6E4979 /* ArrayTest.swift */; }; @@ -216,6 +217,30 @@ ED346A5EA86AC79F524648448232652B /* DisposeBag.swift in Sources */ = {isa = PBXBuildFile; fileRef = 77762B0005C750E84813994CE0075E3B /* DisposeBag.swift */; }; EDC4FE812351E8F1541F8F67B78E529C /* SubscribeOn.swift in Sources */ = {isa = PBXBuildFile; fileRef = B80609FF38FDE35E5FE2D38886D2361F /* SubscribeOn.swift */; }; EF4FB8749ACDDE84412D99A84F4AE6E5 /* Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B5F05AEF12013DFCBEBE433EEBB3C8F /* Rx.swift */; }; +======= + D5386E2FC5AE2607F93D6D15EE68BE71 /* Name.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70E2BE5DC711104C3A05CF7734444AE6 /* Name.swift */; }; + D5BA538343435D3D2829CC7ACEAC0A89 /* Capitalization.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBDB1835E354AE829EC076FC72188103 /* Capitalization.swift */; }; + D745E5C09C019F336E7DFE2A51660BE4 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 166F69F07C764030A7995E60A0FB8ACB /* Extensions.swift */; }; + D77131EF69C647A47FAA29B7908548A2 /* ArrayOfArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5E83590E34071960E0A234219F7C0A30 /* ArrayOfArrayOfNumberOnly.swift */; }; + DEB39B27FFE129D66190C8404BEE3388 /* SkipWhile.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E3BEFA00C2C7854A37F845BF40B59F4 /* SkipWhile.swift */; }; + DF169C8702316CBBB5DA2D7D090D6CA5 /* Amb.swift in Sources */ = {isa = PBXBuildFile; fileRef = A6635256007E4FB66691FA58431C5B23 /* Amb.swift */; }; + DF2B6E7DD3979721F5F569E0D3685EC3 /* Bag+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D641B399A74F0F9D45B05F8D357C806 /* Bag+Rx.swift */; }; + E063BA8986EF250487B3F6004626E527 /* TailRecursiveSink.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11316F7A1A5EB2E5B756703C0EE77CF6 /* TailRecursiveSink.swift */; }; + E1DC82E07388386B1ADBC50ACF8681C4 /* Model200Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A3508D5B3FC6345F25907559BC684A1 /* Model200Response.swift */; }; + E270BAC5CCFFBB55F1056E4BAFD5BD9A /* InfiniteSequence.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5017E276F3AE00F1F45A62F9A35F51C0 /* InfiniteSequence.swift */; }; + E302BC0CE99F3E8B155AC2C90F23C4AB /* ConcurrentMainScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B782CE63F4EDE0F2FE5908E009D66D3 /* ConcurrentMainScheduler.swift */; }; + E34E3F881EF3CDAF007A6E4F /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = E34E3F871EF3CDAF007A6E4F /* Configuration.swift */; }; + E37341B11DC65A369B8A5E532909C9BC /* ConcurrentDispatchQueueScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B1C5A8AB9C095DD01A23DB6B7179E5C /* ConcurrentDispatchQueueScheduler.swift */; }; + E57359F76995A4D4451EEC056A096756 /* MapTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94D52AAA0C8C143CED9376E20727E420 /* MapTest.swift */; }; + E8B47BA0B893F0261AE96929029F6DE8 /* AnonymousObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6472AECA91A4E834A9AF15721BC6D569 /* AnonymousObserver.swift */; }; + E8E275B7A3686605EDE9844688758CF2 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AA9C5856BEAE5090A7D1EB450A10C04F /* Alamofire.framework */; }; + EA6C2E6065D4B55DDF1860C32A727756 /* Materialize.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1D34B07FCD98BCADAA8A3B68F1ACF1E /* Materialize.swift */; }; + EB8A396E62FED02A5B237C10B1ECB6CB /* TakeLast.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EACF73E072E466AF5911B9BB191E174 /* TakeLast.swift */; }; + EC311AF62F50F2674B4F29F55D00739C /* Cancelable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 463ABD4055AB6537A2C5B0EDB617C139 /* Cancelable.swift */; }; + EE09CF258A0DD7CB8B8C87061A742732 /* SchedulerType.swift in Sources */ = {isa = PBXBuildFile; fileRef = B258A9C347C516AA8D8A3FB2CD665D6D /* SchedulerType.swift */; }; + EEC8F9078C66B961D3A6FCD9F5072F4E /* DistinctUntilChanged.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75DAC3F84E978269F03F6516EE7E9FAE /* DistinctUntilChanged.swift */; }; + EEE78DB914769229A6F7D18F1AFDD1E1 /* PetstoreClient-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F681D2C508D1BA8F62893120D9343A4 /* PetstoreClient-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; +>>>>>>> origin/master EFD264FC408EBF3BA2528E70B08DDD94 /* Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = 64082BE2455C7B840B138508D24C0B0C /* Notifications.swift */; }; F021857298766814580AB082206996AD /* SynchronizedSubscribeType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B70F2B6C174F1E6C285A5F774C3C97E /* SynchronizedSubscribeType.swift */; }; F1297DF65AD2268A3FD9774BDDD827F0 /* Platform.Darwin.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB1413438046E9B3E8A94F51358A8205 /* Platform.Darwin.swift */; }; @@ -274,11 +299,15 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 00ACB4396DD1B4E4539E4E81C1D7A14E /* Pods-SwaggerClientTests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = "Pods-SwaggerClientTests.modulemap"; sourceTree = ""; }; + 00ACB4396DD1B4E4539E4E81C1D7A14E /* Pods-SwaggerClientTests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = "Pods-SwaggerClientTests.modulemap"; sourceTree = ""; }; 02F28E719AA874BE9213D6CF8CE7E36B /* Pods-SwaggerClientTests-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-SwaggerClientTests-acknowledgements.plist"; sourceTree = ""; }; +<<<<<<< HEAD 03CE36E3173971E820F39F1C07F67BDC /* SpecialModelName.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SpecialModelName.swift; sourceTree = ""; }; 042B9E19CCDC65CDBD7F68F114E9FA76 /* Animal.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Animal.swift; sourceTree = ""; }; 057FC3E5DE19EA8F4DD600557D771032 /* Pods_SwaggerClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_SwaggerClient.framework; path = "Pods-SwaggerClient.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; +======= + 057FC3E5DE19EA8F4DD600557D771032 /* Pods_SwaggerClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwaggerClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; +>>>>>>> origin/master 0668A90FD8DFEB8D178EE6721979B788 /* ElementAt.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ElementAt.swift; path = RxSwift/Observables/ElementAt.swift; sourceTree = ""; }; 06ED7312B45ED8BAF27E7FE1B6B6924C /* Pet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Pet.swift; sourceTree = ""; }; 081DF7A701B93326C82A6A672C00B3AB /* NumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = NumberOnly.swift; sourceTree = ""; }; @@ -340,7 +369,7 @@ 4FE676DC3C01D76D82723E22A695A308 /* BehaviorSubject.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BehaviorSubject.swift; path = RxSwift/Subjects/BehaviorSubject.swift; sourceTree = ""; }; 4FF46ACE1C78929AB44803AE915B394F /* Debug.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Debug.swift; path = RxSwift/Observables/Debug.swift; sourceTree = ""; }; 5017E276F3AE00F1F45A62F9A35F51C0 /* InfiniteSequence.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = InfiniteSequence.swift; path = Platform/DataStructures/InfiniteSequence.swift; sourceTree = ""; }; - 503A5FA54C11AE46D3333E6080D61E9A /* RxSwift.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = RxSwift.modulemap; sourceTree = ""; }; + 503A5FA54C11AE46D3333E6080D61E9A /* RxSwift.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = RxSwift.modulemap; sourceTree = ""; }; 510BB12F1D8076F5BA1888E67E121E79 /* BinaryDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BinaryDisposable.swift; path = RxSwift/Disposables/BinaryDisposable.swift; sourceTree = ""; }; 549C6527D10094289B101749047807C5 /* Pods-SwaggerClient.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClient.debug.xcconfig"; sourceTree = ""; }; 56CC0097103243FBF2702AB35BF7C0A4 /* InvocableType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = InvocableType.swift; path = RxSwift/Schedulers/Internal/InvocableType.swift; sourceTree = ""; }; @@ -352,7 +381,7 @@ 5A9C750647768399DC941729E35D2915 /* FakeAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FakeAPI.swift; sourceTree = ""; }; 5AC613DA00AD0B2ACF145E94AED80E86 /* ConnectableObservable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConnectableObservable.swift; path = RxSwift/Observables/ConnectableObservable.swift; sourceTree = ""; }; 5B4FF38E4CA2AFB54D788C9F1919BFA8 /* ObservableType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ObservableType.swift; path = RxSwift/ObservableType.swift; sourceTree = ""; }; - 5B598E168B47485DC60F9DBBCBEEF5BB /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Alamofire.framework; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 5B598E168B47485DC60F9DBBCBEEF5BB /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 5B5F05AEF12013DFCBEBE433EEBB3C8F /* Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Rx.swift; path = RxSwift/Rx.swift; sourceTree = ""; }; 5D641B399A74F0F9D45B05F8D357C806 /* Bag+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Bag+Rx.swift"; path = "RxSwift/Extensions/Bag+Rx.swift"; sourceTree = ""; }; 5E047D08FB3120A3AFA0DF05CCC1712A /* RxSwift-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "RxSwift-dummy.m"; sourceTree = ""; }; @@ -404,8 +433,12 @@ 8317D3F53EA1D6DC62811B7F71E22E8E /* SerialDispatchQueueScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SerialDispatchQueueScheduler.swift; path = RxSwift/Schedulers/SerialDispatchQueueScheduler.swift; sourceTree = ""; }; 83CF28DA7318DA2566376ACECE87D6E3 /* AnonymousInvocable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AnonymousInvocable.swift; path = RxSwift/Schedulers/Internal/AnonymousInvocable.swift; sourceTree = ""; }; 849FECBC6CC67F2B6800F982927E3A9E /* Pods-SwaggerClientTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClientTests.release.xcconfig"; sourceTree = ""; }; +<<<<<<< HEAD 84A09D760BA2EA13D5BE269086BAD34C /* RxSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = RxSwift.framework; path = RxSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 864C70DC24FEEC5B2D80065CE824ADF8 /* StoreAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StoreAPI.swift; sourceTree = ""; }; +======= + 84A09D760BA2EA13D5BE269086BAD34C /* RxSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = RxSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; +>>>>>>> origin/master 86B1DDCB9E27DF43C2C35D9E7B2E84DA /* Pods-SwaggerClient.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClient.release.xcconfig"; sourceTree = ""; }; 86B5A2A541FCAB86964565123DAF4719 /* CombineLatest+Collection.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "CombineLatest+Collection.swift"; path = "RxSwift/Observables/CombineLatest+Collection.swift"; sourceTree = ""; }; 870EAFD138EAD59EAC7EE2CE19DE25B4 /* HistoricalSchedulerTimeConverter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = HistoricalSchedulerTimeConverter.swift; path = RxSwift/Schedulers/HistoricalSchedulerTimeConverter.swift; sourceTree = ""; }; @@ -417,7 +450,7 @@ 8DF7DA17836C79D5700D114169C3119F /* AnimalFarm.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AnimalFarm.swift; sourceTree = ""; }; 8F94DF516E7B950F928922C1D41C6D4D /* Never.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Never.swift; path = RxSwift/Observables/Never.swift; sourceTree = ""; }; 939E73AB843F47D6C9EA0D065BAF63FC /* Map.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Map.swift; path = RxSwift/Observables/Map.swift; sourceTree = ""; }; - 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; + 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 93D2B184ED95D52B41994F4AA9D93A6C /* ObservableConvertibleType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ObservableConvertibleType.swift; path = RxSwift/ObservableConvertibleType.swift; sourceTree = ""; }; 9675783D8A4B72DF63BAA2050C4E5659 /* Generate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Generate.swift; path = RxSwift/Observables/Generate.swift; sourceTree = ""; }; 969C2AF48F4307163B301A92E78AFCF2 /* Pods-SwaggerClientTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClientTests.debug.xcconfig"; sourceTree = ""; }; @@ -447,7 +480,7 @@ B23F66A643FB8A1DEAC31DC3B637ACEB /* Zip+Collection.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Zip+Collection.swift"; path = "RxSwift/Observables/Zip+Collection.swift"; sourceTree = ""; }; B258A9C347C516AA8D8A3FB2CD665D6D /* SchedulerType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SchedulerType.swift; path = RxSwift/SchedulerType.swift; sourceTree = ""; }; B34B9F812BB8C50E3EA28F4FB51A1095 /* SynchronizedDisposeType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SynchronizedDisposeType.swift; path = RxSwift/Concurrency/SynchronizedDisposeType.swift; sourceTree = ""; }; - B34E08DA58315FFF5FCCF17FBA995360 /* Alamofire.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = Alamofire.modulemap; sourceTree = ""; }; + B34E08DA58315FFF5FCCF17FBA995360 /* Alamofire.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = Alamofire.modulemap; sourceTree = ""; }; B3A144887C8B13FD888B76AB096B0CA1 /* PetstoreClient-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PetstoreClient-prefix.pch"; sourceTree = ""; }; B4644DAD437464D93509A585F99B235E /* AsSingle.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AsSingle.swift; path = RxSwift/Observables/AsSingle.swift; sourceTree = ""; }; B4EEA393253D8586EB38190FC649A3FA /* SwitchIfEmpty.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SwitchIfEmpty.swift; path = RxSwift/Observables/SwitchIfEmpty.swift; sourceTree = ""; }; @@ -467,7 +500,7 @@ C1FCEDB728FD2060B1A8C36A71039328 /* Merge.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Merge.swift; path = RxSwift/Observables/Merge.swift; sourceTree = ""; }; C30419C2A3E0EC1B15E0D3AF3D91FB15 /* ObservableType+Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "ObservableType+Extensions.swift"; path = "RxSwift/ObservableType+Extensions.swift"; sourceTree = ""; }; C367D19B8DD4C0F9954A24DD5A2A6AFB /* SerialDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SerialDisposable.swift; path = RxSwift/Disposables/SerialDisposable.swift; sourceTree = ""; }; - C4B474BD9070828C0F786071EEF46CD0 /* Pods_SwaggerClientTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_SwaggerClientTests.framework; path = "Pods-SwaggerClientTests.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; + C4B474BD9070828C0F786071EEF46CD0 /* Pods_SwaggerClientTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwaggerClientTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; C541B03ABB2F0F5E10F027D5E3C9DF4B /* Just.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Just.swift; path = RxSwift/Observables/Just.swift; sourceTree = ""; }; C860BEC2AFE3C3670391CECBA2707574 /* Empty.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Empty.swift; path = RxSwift/Observables/Empty.swift; sourceTree = ""; }; C9E9A12519387508C3E55F6292B93FF1 /* Cat.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Cat.swift; sourceTree = ""; }; @@ -486,6 +519,7 @@ DADAB10704E49D6B9E18F59F995BB88F /* PetstoreClient.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = PetstoreClient.xcconfig; sourceTree = ""; }; DAE1A43C13EDE68CF0C6AEA7EA3A2521 /* RecursiveScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RecursiveScheduler.swift; path = RxSwift/Schedulers/RecursiveScheduler.swift; sourceTree = ""; }; DAE679F6024F9BDC9690AFE107798377 /* Window.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Window.swift; path = RxSwift/Observables/Window.swift; sourceTree = ""; }; +<<<<<<< HEAD DE164497A94DD3215ED4D1AE0D4703B1 /* Pods-SwaggerClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = "Pods-SwaggerClient.modulemap"; sourceTree = ""; }; DF321C5A696F2549CA703B02CE57668E /* Order.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Order.swift; sourceTree = ""; }; DF7CAA870676F2440AC2CCFC5A522F6C /* Response.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Response.swift; path = Source/Response.swift; sourceTree = ""; }; @@ -493,14 +527,27 @@ E1E4BCB344D3C100253B24B79421F00A /* Pods-SwaggerClient-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-SwaggerClient-acknowledgements.plist"; sourceTree = ""; }; E36384E835011F7B64D5054B85301E91 /* ArrayOfArrayOfNumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayOfArrayOfNumberOnly.swift; sourceTree = ""; }; E3D1141B63DF38660CD6F3AC588A782B /* PetstoreClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = PetstoreClient.modulemap; sourceTree = ""; }; +======= + DB71CB53C6CA273037A7AD4D372289E4 /* OuterComposite.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterComposite.swift; sourceTree = ""; }; + DE164497A94DD3215ED4D1AE0D4703B1 /* Pods-SwaggerClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = "Pods-SwaggerClient.modulemap"; sourceTree = ""; }; + DF7CAA870676F2440AC2CCFC5A522F6C /* Response.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Response.swift; path = Source/Response.swift; sourceTree = ""; }; + E181A2141028C3EB376581163644E247 /* TaskDelegate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TaskDelegate.swift; path = Source/TaskDelegate.swift; sourceTree = ""; }; + E1E4BCB344D3C100253B24B79421F00A /* Pods-SwaggerClient-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-SwaggerClient-acknowledgements.plist"; sourceTree = ""; }; + E34E3F871EF3CDAF007A6E4F /* Configuration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Configuration.swift; sourceTree = ""; }; + E3D1141B63DF38660CD6F3AC588A782B /* PetstoreClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = PetstoreClient.modulemap; sourceTree = ""; }; +>>>>>>> origin/master E4E6F4A58FE7868CA2177D3AC79AD2FA /* Pods-SwaggerClientTests-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClientTests-resources.sh"; sourceTree = ""; }; E721CFEFA8C057FD4766D5603B283218 /* VirtualTimeScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = VirtualTimeScheduler.swift; path = RxSwift/Schedulers/VirtualTimeScheduler.swift; sourceTree = ""; }; E7513ADBA4C19938F615442415D28732 /* ShareReplay1.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ShareReplay1.swift; path = RxSwift/Observables/ShareReplay1.swift; sourceTree = ""; }; E7A01B1A67EE04FE1D9C036932C4C037 /* Filter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Filter.swift; path = RxSwift/Observables/Filter.swift; sourceTree = ""; }; E841A5E38033B35ED3073E4BBB921518 /* Disposables.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Disposables.swift; path = RxSwift/Disposables/Disposables.swift; sourceTree = ""; }; E9178D3690ADCB4F8C9057F81C073A45 /* SynchronizedOnType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SynchronizedOnType.swift; path = RxSwift/Concurrency/SynchronizedOnType.swift; sourceTree = ""; }; +<<<<<<< HEAD E9CBBB398E7A62950FA8BC091CBE0359 /* PetstoreClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = PetstoreClient.framework; path = PetstoreClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; EA14FECBFF7BAF8F7800C53E30DF6F89 /* OuterString.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterString.swift; sourceTree = ""; }; +======= + E9CBBB398E7A62950FA8BC091CBE0359 /* PetstoreClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PetstoreClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; +>>>>>>> origin/master EA39A7A8DF958888156A2207EF666EB1 /* SynchronizedUnsubscribeType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SynchronizedUnsubscribeType.swift; path = RxSwift/Concurrency/SynchronizedUnsubscribeType.swift; sourceTree = ""; }; EA4F47C5A2E55E47E45F95C0672F0820 /* AsyncLock.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AsyncLock.swift; path = RxSwift/Concurrency/AsyncLock.swift; sourceTree = ""; }; EA907F82073836CB66D5D606FB1333D9 /* Using.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Using.swift; path = RxSwift/Observables/Using.swift; sourceTree = ""; }; @@ -581,6 +628,7 @@ 12DEA2B1DC312FDD717E14A9BDB9E717 /* Models */ = { isa = PBXGroup; children = ( +<<<<<<< HEAD 87CD5AF7D46088322331E3BC80BC050B /* AdditionalPropertiesClass.swift */, 042B9E19CCDC65CDBD7F68F114E9FA76 /* Animal.swift */, 8DF7DA17836C79D5700D114169C3119F /* AnimalFarm.swift */, @@ -620,6 +668,18 @@ ); name = Models; path = Models; +======= + E34E3F871EF3CDAF007A6E4F /* Configuration.swift */, + 632953C583B6AAAECE114038A06C32E3 /* AlamofireImplementations.swift */, + A20D77D5AC2AA4253C3CE53A63DFE219 /* APIHelper.swift */, + A0EB0065C6D34C3D0408752D4613F3CC /* APIs.swift */, + 166F69F07C764030A7995E60A0FB8ACB /* Extensions.swift */, + BE1EED6C6EBD9EFBB19021E58E93181E /* Models.swift */, + 51DA08F7A95B7A8E36868C11C21687D6 /* APIs */, + 75355E2B6672CAE759386E00841CB62A /* Models */, + ); + path = Swaggers; +>>>>>>> origin/master sourceTree = ""; }; 22F52349E1BE90FC6E064DAAC9EA9612 /* Development Pods */ = { @@ -682,7 +742,6 @@ 864C70DC24FEEC5B2D80065CE824ADF8 /* StoreAPI.swift */, 2091E04790CEDFDDE8AD17E6A9D66DE7 /* UserAPI.swift */, ); - name = APIs; path = APIs; sourceTree = ""; }; @@ -696,6 +755,52 @@ name = Frameworks; sourceTree = ""; }; +<<<<<<< HEAD +======= + 75355E2B6672CAE759386E00841CB62A /* Models */ = { + isa = PBXGroup; + children = ( + 09EF81F086DC98341BD5C23455FA7137 /* AdditionalPropertiesClass.swift */, + A568309F76A1B652CE036E988C06EE29 /* Animal.swift */, + FDF3E12F07433F6DEF7BC4BA736B7983 /* AnimalFarm.swift */, + A061F576466B90F459D65935F8D51860 /* ApiResponse.swift */, + 5E83590E34071960E0A234219F7C0A30 /* ArrayOfArrayOfNumberOnly.swift */, + AE3534EA1F45ABC5A27AA7DBFF18A3F4 /* ArrayOfNumberOnly.swift */, + 3549BBEB8310C2F7A1F4D1E6C3D79AE1 /* ArrayTest.swift */, + CBDB1835E354AE829EC076FC72188103 /* Capitalization.swift */, + 2200CE8E035C9ABEC8A8552FB2D02AD7 /* Cat.swift */, + EBC5372EF6B061786D5D4B252A95FF5C /* Category.swift */, + 1D74EAA3DAC66991636132D82A0A05F2 /* ClassModel.swift */, + D0BD560289D20018A6FB726ACB134A5A /* Client.swift */, + C5EE72D9C168A7004E584E07F7826BB0 /* Dog.swift */, + 1B4E0C41758267C8D9711F25E27A2D0F /* EnumArrays.swift */, + 6CB65861EAC368C247576FAF02C7C3B6 /* EnumClass.swift */, + EF3FAE9C759B152871F26527631A3F75 /* EnumTest.swift */, + 7377E9ACF6F0A23ACBE63CFEB89E5EF0 /* FormatTest.swift */, + A4EB53382F31FD1AEDA15EBDD2054F0B /* HasOnlyReadOnly.swift */, + 985EAA89CA211498C1E93B1FFD07179D /* List.swift */, + 94D52AAA0C8C143CED9376E20727E420 /* MapTest.swift */, + 2E3652B7ACC6DE631E8417ED3B2F09B1 /* MixedPropertiesAndAdditionalPropertiesClass.swift */, + 3A3508D5B3FC6345F25907559BC684A1 /* Model200Response.swift */, + 70E2BE5DC711104C3A05CF7734444AE6 /* Name.swift */, + 4B6C279B6933AF62F8732FA0AB3D3D1D /* NumberOnly.swift */, + 1BAEC7D194EC637C5BB2B49992E25B42 /* Order.swift */, + C88A2837B4AAAF1081698C1A0B1D8AC0 /* OuterBoolean.swift */, + DB71CB53C6CA273037A7AD4D372289E4 /* OuterComposite.swift */, + BF55142E0AD23B3E449853C792C8A296 /* OuterEnum.swift */, + 1F3D4FA411A2731303A140989CD7008C /* OuterNumber.swift */, + 093D61FC663912F6B1BB390AEF884BD3 /* OuterString.swift */, + 2418BCA6631485FD1A60F85083118CEB /* Pet.swift */, + BAB1289A136EFF7D4A1EEF9ABF2501B9 /* ReadOnlyFirst.swift */, + 9540C210EFD6CFFEA8823D1B223D4BA3 /* Return.swift */, + 3BD968CE09C019C6D65DB89BFBAFCBE9 /* SpecialModelName.swift */, + 7C261CA341D13B7BAEEBC14E2F7F9EAE /* Tag.swift */, + 75721582549625DC6C6A2B12E2F9987D /* User.swift */, + ); + path = Models; + sourceTree = ""; + }; +>>>>>>> origin/master 7DB346D0F39D3F0E887471402A8071AB = { isa = PBXGroup; children = ( @@ -745,7 +850,6 @@ children = ( 275CABFE9E1B588E8668908DE0DE85AD /* Swaggers */, ); - name = Classes; path = Classes; sourceTree = ""; }; @@ -810,7 +914,6 @@ children = ( AD94092456F8ABCB18F74CAC75AD85DE /* Classes */, ); - name = PetstoreClient; path = PetstoreClient; sourceTree = ""; }; @@ -965,7 +1068,6 @@ B23F66A643FB8A1DEAC31DC3B637ACEB /* Zip+Collection.swift */, 2E07FFE8D5239059E139DA4A84322919 /* Support Files */, ); - name = RxSwift; path = RxSwift; sourceTree = ""; }; @@ -1001,7 +1103,6 @@ C0528EC401C03A7544A658C38016A893 /* Validation.swift */, 3F6894F6346ED0522534B4531C76C476 /* Support Files */, ); - name = Alamofire; path = Alamofire; sourceTree = ""; }; @@ -1333,6 +1434,7 @@ 9ED2BB2981896E0A39EFA365503F58CE /* AFError.swift in Sources */, A9EEEA7477981DEEBC72432DE9990A4B /* Alamofire-dummy.m in Sources */, F8B3D3092ED0417E8CDF32033F6122F5 /* Alamofire.swift in Sources */, + E34E3F881EF3CDAF007A6E4F /* Configuration.swift in Sources */, 61200D01A1855D7920CEF835C8BE00B0 /* DispatchQueue+Alamofire.swift in Sources */, B65FCF589DA398C3EFE0128064E510EC /* MultipartFormData.swift in Sources */, A2A6F71B727312BD45CC7A4AAD7B0AB7 /* NetworkReachabilityManager.swift in Sources */, diff --git a/samples/client/petstore/typescript-angular2/default/api/pet.service.ts b/samples/client/petstore/typescript-angular2/default/api/pet.service.ts index 93ecbfd4818..0303ca70d3a 100644 --- a/samples/client/petstore/typescript-angular2/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular2/default/api/pet.service.ts @@ -225,7 +225,7 @@ export class PetService { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -280,7 +280,7 @@ export class PetService { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -330,7 +330,7 @@ export class PetService { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -380,7 +380,7 @@ export class PetService { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -427,7 +427,7 @@ export class PetService { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -469,7 +469,7 @@ export class PetService { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -530,7 +530,7 @@ export class PetService { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; diff --git a/samples/client/petstore/typescript-angular2/default/api/store.service.ts b/samples/client/petstore/typescript-angular2/default/api/store.service.ts index 2fd90e5e5ea..877c8df7e08 100644 --- a/samples/client/petstore/typescript-angular2/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular2/default/api/store.service.ts @@ -155,7 +155,7 @@ export class StoreService { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -229,7 +229,7 @@ export class StoreService { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -266,7 +266,7 @@ export class StoreService { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; diff --git a/samples/client/petstore/typescript-angular2/default/api/user.service.ts b/samples/client/petstore/typescript-angular2/default/api/user.service.ts index b2e1b7b09d3..5a5761dcdd3 100644 --- a/samples/client/petstore/typescript-angular2/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular2/default/api/user.service.ts @@ -220,7 +220,7 @@ export class UserService { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -260,7 +260,7 @@ export class UserService { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -300,7 +300,7 @@ export class UserService { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -341,7 +341,7 @@ export class UserService { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -379,7 +379,7 @@ export class UserService { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -429,7 +429,7 @@ export class UserService { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -461,7 +461,7 @@ export class UserService { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -504,7 +504,7 @@ export class UserService { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; diff --git a/samples/client/petstore/typescript-angular2/default/variables.ts b/samples/client/petstore/typescript-angular2/default/variables.ts index b734b2e5918..29b7e5b1d71 100644 --- a/samples/client/petstore/typescript-angular2/default/variables.ts +++ b/samples/client/petstore/typescript-angular2/default/variables.ts @@ -1,9 +1,9 @@ -import { InjectionToken } from '@angular/core'; +import { OpaqueToken } from '@angular/core'; -export const BASE_PATH = new InjectionToken('basePath'); +export const BASE_PATH = new OpaqueToken('basePath'); export const COLLECTION_FORMATS = { 'csv': ',', 'tsv': ' ', 'ssv': ' ', 'pipes': '|' -} \ No newline at end of file +} diff --git a/samples/client/petstore/typescript-angular2/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular2/npm/api/pet.service.ts index 93ecbfd4818..0303ca70d3a 100644 --- a/samples/client/petstore/typescript-angular2/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular2/npm/api/pet.service.ts @@ -225,7 +225,7 @@ export class PetService { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -280,7 +280,7 @@ export class PetService { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -330,7 +330,7 @@ export class PetService { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -380,7 +380,7 @@ export class PetService { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -427,7 +427,7 @@ export class PetService { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -469,7 +469,7 @@ export class PetService { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -530,7 +530,7 @@ export class PetService { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; diff --git a/samples/client/petstore/typescript-angular2/npm/api/store.service.ts b/samples/client/petstore/typescript-angular2/npm/api/store.service.ts index 2fd90e5e5ea..877c8df7e08 100644 --- a/samples/client/petstore/typescript-angular2/npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular2/npm/api/store.service.ts @@ -155,7 +155,7 @@ export class StoreService { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -229,7 +229,7 @@ export class StoreService { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -266,7 +266,7 @@ export class StoreService { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; diff --git a/samples/client/petstore/typescript-angular2/npm/api/user.service.ts b/samples/client/petstore/typescript-angular2/npm/api/user.service.ts index b2e1b7b09d3..5a5761dcdd3 100644 --- a/samples/client/petstore/typescript-angular2/npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular2/npm/api/user.service.ts @@ -220,7 +220,7 @@ export class UserService { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -260,7 +260,7 @@ export class UserService { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -300,7 +300,7 @@ export class UserService { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -341,7 +341,7 @@ export class UserService { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -379,7 +379,7 @@ export class UserService { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -429,7 +429,7 @@ export class UserService { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -461,7 +461,7 @@ export class UserService { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -504,7 +504,7 @@ export class UserService { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; diff --git a/samples/client/petstore/typescript-angular2/npm/variables.ts b/samples/client/petstore/typescript-angular2/npm/variables.ts index b734b2e5918..29b7e5b1d71 100644 --- a/samples/client/petstore/typescript-angular2/npm/variables.ts +++ b/samples/client/petstore/typescript-angular2/npm/variables.ts @@ -1,9 +1,9 @@ -import { InjectionToken } from '@angular/core'; +import { OpaqueToken } from '@angular/core'; -export const BASE_PATH = new InjectionToken('basePath'); +export const BASE_PATH = new OpaqueToken('basePath'); export const COLLECTION_FORMATS = { 'csv': ',', 'tsv': ' ', 'ssv': ' ', 'pipes': '|' -} \ No newline at end of file +} diff --git a/samples/client/petstore/typescript-angular2/with-interfaces/api/PetApi.ts b/samples/client/petstore/typescript-angular2/with-interfaces/api/PetApi.ts index 0d76791d6fe..b23d131cca1 100644 --- a/samples/client/petstore/typescript-angular2/with-interfaces/api/PetApi.ts +++ b/samples/client/petstore/typescript-angular2/with-interfaces/api/PetApi.ts @@ -10,6 +10,8 @@ * Do not edit the class manually. */ +/* tslint:disable:no-unused-variable member-ordering */ + import { Inject, Injectable, Optional } from '@angular/core'; import { Http, Headers, URLSearchParams } from '@angular/http'; import { RequestMethod, RequestOptions, RequestOptionsArgs } from '@angular/http'; @@ -23,8 +25,6 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; import { PetApiInterface } from './PetApiInterface'; -/* tslint:disable:no-unused-variable member-ordering */ - @Injectable() export class PetApi implements PetApiInterface { diff --git a/samples/client/petstore/typescript-angular2/with-interfaces/api/StoreApi.ts b/samples/client/petstore/typescript-angular2/with-interfaces/api/StoreApi.ts index ecc6cb80eae..dcefb6f6b28 100644 --- a/samples/client/petstore/typescript-angular2/with-interfaces/api/StoreApi.ts +++ b/samples/client/petstore/typescript-angular2/with-interfaces/api/StoreApi.ts @@ -10,6 +10,8 @@ * Do not edit the class manually. */ +/* tslint:disable:no-unused-variable member-ordering */ + import { Inject, Injectable, Optional } from '@angular/core'; import { Http, Headers, URLSearchParams } from '@angular/http'; import { RequestMethod, RequestOptions, RequestOptionsArgs } from '@angular/http'; @@ -23,8 +25,6 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; import { StoreApiInterface } from './StoreApiInterface'; -/* tslint:disable:no-unused-variable member-ordering */ - @Injectable() export class StoreApi implements StoreApiInterface { diff --git a/samples/client/petstore/typescript-angular2/with-interfaces/api/UserApi.ts b/samples/client/petstore/typescript-angular2/with-interfaces/api/UserApi.ts index dfd8ac54d7a..b8738b0e463 100644 --- a/samples/client/petstore/typescript-angular2/with-interfaces/api/UserApi.ts +++ b/samples/client/petstore/typescript-angular2/with-interfaces/api/UserApi.ts @@ -10,6 +10,8 @@ * Do not edit the class manually. */ +/* tslint:disable:no-unused-variable member-ordering */ + import { Inject, Injectable, Optional } from '@angular/core'; import { Http, Headers, URLSearchParams } from '@angular/http'; import { RequestMethod, RequestOptions, RequestOptionsArgs } from '@angular/http'; @@ -23,8 +25,6 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; import { UserApiInterface } from './UserApiInterface'; -/* tslint:disable:no-unused-variable member-ordering */ - @Injectable() export class UserApi implements UserApiInterface { diff --git a/samples/client/petstore/typescript-angular2/with-interfaces/api/pet.service.ts b/samples/client/petstore/typescript-angular2/with-interfaces/api/pet.service.ts index 96dda262838..5bc5d2aa437 100644 --- a/samples/client/petstore/typescript-angular2/with-interfaces/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular2/with-interfaces/api/pet.service.ts @@ -10,6 +10,8 @@ * Do not edit the class manually. */ +/* tslint:disable:no-unused-variable member-ordering */ + import { Inject, Injectable, Optional } from '@angular/core'; import { Http, Headers, URLSearchParams } from '@angular/http'; import { RequestMethod, RequestOptions, RequestOptionsArgs } from '@angular/http'; @@ -24,8 +26,6 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; import { PetServiceInterface } from './PetServiceInterface'; -/* tslint:disable:no-unused-variable member-ordering */ - @Injectable() export class PetService implements PetServiceInterface { @@ -221,7 +221,7 @@ export class PetService implements PetServiceInterface { // to determine the Accept header let produces: string[] = [ - 'application/json', + 'application/json', 'application/xml' ]; @@ -276,7 +276,7 @@ export class PetService implements PetServiceInterface { // to determine the Accept header let produces: string[] = [ - 'application/json', + 'application/json', 'application/xml' ]; @@ -324,7 +324,7 @@ export class PetService implements PetServiceInterface { // to determine the Accept header let produces: string[] = [ - 'application/json', + 'application/json', 'application/xml' ]; @@ -372,7 +372,7 @@ export class PetService implements PetServiceInterface { // to determine the Accept header let produces: string[] = [ - 'application/json', + 'application/json', 'application/xml' ]; @@ -419,7 +419,7 @@ export class PetService implements PetServiceInterface { // to determine the Accept header let produces: string[] = [ - 'application/json', + 'application/json', 'application/xml' ]; @@ -466,7 +466,7 @@ export class PetService implements PetServiceInterface { // to determine the Accept header let produces: string[] = [ - 'application/json', + 'application/json', 'application/xml' ]; @@ -527,7 +527,7 @@ export class PetService implements PetServiceInterface { // to determine the Accept header let produces: string[] = [ - 'application/json', + 'application/json', 'application/xml' ]; @@ -595,7 +595,7 @@ export class PetService implements PetServiceInterface { // to determine the Accept header let produces: string[] = [ - 'application/json', + 'application/json', 'application/xml' ]; diff --git a/samples/client/petstore/typescript-angular2/with-interfaces/api/store.service.ts b/samples/client/petstore/typescript-angular2/with-interfaces/api/store.service.ts index fadcaf88411..ba50bbc9997 100644 --- a/samples/client/petstore/typescript-angular2/with-interfaces/api/store.service.ts +++ b/samples/client/petstore/typescript-angular2/with-interfaces/api/store.service.ts @@ -10,6 +10,8 @@ * Do not edit the class manually. */ +/* tslint:disable:no-unused-variable member-ordering */ + import { Inject, Injectable, Optional } from '@angular/core'; import { Http, Headers, URLSearchParams } from '@angular/http'; import { RequestMethod, RequestOptions, RequestOptionsArgs } from '@angular/http'; @@ -24,8 +26,6 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; import { StoreServiceInterface } from './StoreServiceInterface'; -/* tslint:disable:no-unused-variable member-ordering */ - @Injectable() export class StoreService implements StoreServiceInterface { @@ -156,7 +156,7 @@ export class StoreService implements StoreServiceInterface { // to determine the Accept header let produces: string[] = [ - 'application/json', + 'application/json', 'application/xml' ]; @@ -188,7 +188,7 @@ export class StoreService implements StoreServiceInterface { // to determine the Accept header let produces: string[] = [ - 'application/json', + 'application/json', 'application/xml' ]; @@ -231,7 +231,7 @@ export class StoreService implements StoreServiceInterface { // to determine the Accept header let produces: string[] = [ - 'application/json', + 'application/json', 'application/xml' ]; @@ -264,7 +264,7 @@ export class StoreService implements StoreServiceInterface { // to determine the Accept header let produces: string[] = [ - 'application/json', + 'application/json', 'application/xml' ]; diff --git a/samples/client/petstore/typescript-angular2/with-interfaces/api/user.service.ts b/samples/client/petstore/typescript-angular2/with-interfaces/api/user.service.ts index ed4e5d776bc..20f0c1338b2 100644 --- a/samples/client/petstore/typescript-angular2/with-interfaces/api/user.service.ts +++ b/samples/client/petstore/typescript-angular2/with-interfaces/api/user.service.ts @@ -10,6 +10,8 @@ * Do not edit the class manually. */ +/* tslint:disable:no-unused-variable member-ordering */ + import { Inject, Injectable, Optional } from '@angular/core'; import { Http, Headers, URLSearchParams } from '@angular/http'; import { RequestMethod, RequestOptions, RequestOptionsArgs } from '@angular/http'; @@ -24,8 +26,6 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables' import { Configuration } from '../configuration'; import { UserServiceInterface } from './UserServiceInterface'; -/* tslint:disable:no-unused-variable member-ordering */ - @Injectable() export class UserService implements UserServiceInterface { @@ -217,7 +217,7 @@ export class UserService implements UserServiceInterface { // to determine the Accept header let produces: string[] = [ - 'application/json', + 'application/json', 'application/xml' ]; @@ -253,7 +253,7 @@ export class UserService implements UserServiceInterface { // to determine the Accept header let produces: string[] = [ - 'application/json', + 'application/json', 'application/xml' ]; @@ -289,7 +289,7 @@ export class UserService implements UserServiceInterface { // to determine the Accept header let produces: string[] = [ - 'application/json', + 'application/json', 'application/xml' ]; @@ -330,7 +330,7 @@ export class UserService implements UserServiceInterface { // to determine the Accept header let produces: string[] = [ - 'application/json', + 'application/json', 'application/xml' ]; @@ -368,7 +368,7 @@ export class UserService implements UserServiceInterface { // to determine the Accept header let produces: string[] = [ - 'application/json', + 'application/json', 'application/xml' ]; @@ -410,7 +410,7 @@ export class UserService implements UserServiceInterface { // to determine the Accept header let produces: string[] = [ - 'application/json', + 'application/json', 'application/xml' ]; @@ -442,7 +442,7 @@ export class UserService implements UserServiceInterface { // to determine the Accept header let produces: string[] = [ - 'application/json', + 'application/json', 'application/xml' ]; @@ -481,7 +481,7 @@ export class UserService implements UserServiceInterface { // to determine the Accept header let produces: string[] = [ - 'application/json', + 'application/json', 'application/xml' ]; diff --git a/samples/client/petstore/typescript-angular2/with-interfaces/variables.ts b/samples/client/petstore/typescript-angular2/with-interfaces/variables.ts index b734b2e5918..29b7e5b1d71 100644 --- a/samples/client/petstore/typescript-angular2/with-interfaces/variables.ts +++ b/samples/client/petstore/typescript-angular2/with-interfaces/variables.ts @@ -1,9 +1,9 @@ -import { InjectionToken } from '@angular/core'; +import { OpaqueToken } from '@angular/core'; -export const BASE_PATH = new InjectionToken('basePath'); +export const BASE_PATH = new OpaqueToken('basePath'); export const COLLECTION_FORMATS = { 'csv': ',', 'tsv': ' ', 'ssv': ' ', 'pipes': '|' -} \ No newline at end of file +}