From e7d6bf5d048d14a8e19de41804918cefe9e8455f Mon Sep 17 00:00:00 2001 From: wing328 Date: Sat, 1 Jul 2017 22:40:53 +0800 Subject: [PATCH 1/7] add links to snapshot versions --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4cc3194646fd..9508af5750bb 100644 --- a/README.md +++ b/README.md @@ -77,8 +77,8 @@ The OpenAPI Specification has undergone 3 revisions since initial creation in 20 Swagger Codegen Version | Release Date | OpenAPI Spec compatibility | Notes -------------------------- | ------------ | -------------------------- | ----- -2.3.0 (upcoming minor release) | Apr/May 2017 | 1.0, 1.1, 1.2, 2.0 | Minor release with breaking changes -2.2.3 (upcoming patch release) | TBD | 1.0, 1.1, 1.2, 2.0 | Patch release without breaking changes +2.3.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/io/swagger/swagger-codegen/2.3.0-SNAPSHOT/)| Apr/May 2017 | 1.0, 1.1, 1.2, 2.0 | Minor release with breaking changes +2.2.3 (upcoming patch release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/io/swagger/swagger-codegen/2.2.3-SNAPSHOT/)| TBD | 1.0, 1.1, 1.2, 2.0 | Patch release without breaking changes [2.2.2](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.2.2) (**current stable**) | 2017-03-01 | 1.0, 1.1, 1.2, 2.0 | [tag v2.2.2](https://github.com/swagger-api/swagger-codegen/tree/v2.2.2) [2.2.1](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.2.1) | 2016-08-07 | 1.0, 1.1, 1.2, 2.0 | [tag v2.2.1](https://github.com/swagger-api/swagger-codegen/tree/v2.2.1) [2.1.6](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.1.6) | 2016-04-06 | 1.0, 1.1, 1.2, 2.0 | [tag v2.1.6](https://github.com/swagger-api/swagger-codegen/tree/v2.1.6) From 011c6fd01c9839b17df17e6c1f442200139c99fa Mon Sep 17 00:00:00 2001 From: wing328 Date: Sat, 1 Jul 2017 22:43:34 +0800 Subject: [PATCH 2/7] postpone release date to Jul/Aug 2017 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9508af5750bb..a53004522793 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ The OpenAPI Specification has undergone 3 revisions since initial creation in 20 Swagger Codegen Version | Release Date | OpenAPI Spec compatibility | Notes -------------------------- | ------------ | -------------------------- | ----- -2.3.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/io/swagger/swagger-codegen/2.3.0-SNAPSHOT/)| Apr/May 2017 | 1.0, 1.1, 1.2, 2.0 | Minor release with breaking changes +2.3.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/io/swagger/swagger-codegen/2.3.0-SNAPSHOT/)| Jul/Aug 2017 | 1.0, 1.1, 1.2, 2.0 | Minor release with breaking changes 2.2.3 (upcoming patch release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/io/swagger/swagger-codegen/2.2.3-SNAPSHOT/)| TBD | 1.0, 1.1, 1.2, 2.0 | Patch release without breaking changes [2.2.2](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.2.2) (**current stable**) | 2017-03-01 | 1.0, 1.1, 1.2, 2.0 | [tag v2.2.2](https://github.com/swagger-api/swagger-codegen/tree/v2.2.2) [2.2.1](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.2.1) | 2016-08-07 | 1.0, 1.1, 1.2, 2.0 | [tag v2.2.1](https://github.com/swagger-api/swagger-codegen/tree/v2.2.1) From 304a7ae19a78b31a12ad6bc94d61961358dd0406 Mon Sep 17 00:00:00 2001 From: wing328 Date: Sun, 2 Jul 2017 20:51:45 +0800 Subject: [PATCH 3/7] fix regex escape forward slash (#5963) --- .../io/swagger/codegen/DefaultCodegen.java | 11 ++++++++--- samples/client/petstore/ruby/docs/FakeApi.md | 2 +- .../ruby/lib/petstore/models/format_test.rb | 19 +++++++++++++++++++ 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java index d3f983453a3a..4ed6ad5be764 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java @@ -607,7 +607,7 @@ public class DefaultCodegen { * @return properly-escaped pattern */ public String toRegularExpression(String pattern) { - return escapeText(addRegularExpressionDelimiter(pattern)); + return addRegularExpressionDelimiter(escapeText(pattern)); } /** @@ -3573,9 +3573,14 @@ public class DefaultCodegen { * @return the pattern with delimiter */ public String addRegularExpressionDelimiter(String pattern) { - if (pattern != null && !pattern.matches("^/.*")) { - return "/" + pattern + "/"; + if (StringUtils.isEmpty(pattern)) { + return pattern; } + + if (!pattern.matches("^/.*")) { + return "/" + pattern.replaceAll("/", "\\\\/") + "/"; + } + return pattern; } diff --git a/samples/client/petstore/ruby/docs/FakeApi.md b/samples/client/petstore/ruby/docs/FakeApi.md index 70cf50ad9994..ebb6f8660fc2 100644 --- a/samples/client/petstore/ruby/docs/FakeApi.md +++ b/samples/client/petstore/ruby/docs/FakeApi.md @@ -274,7 +274,7 @@ double = 1.2 # Float | None pattern_without_delimiter = "pattern_without_delimiter_example" # String | None -byte = "B" # String | None +byte = "byte_example" # String | None opts = { integer: 56, # Integer | None diff --git a/samples/client/petstore/ruby/lib/petstore/models/format_test.rb b/samples/client/petstore/ruby/lib/petstore/models/format_test.rb index 7c896c33aa92..5c2e7513d4c6 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/format_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/format_test.rb @@ -198,6 +198,10 @@ module Petstore invalid_properties.push("invalid value for 'byte', byte cannot be nil.") end + if @byte !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/) + invalid_properties.push("invalid value for 'byte', must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.") + end + if @date.nil? invalid_properties.push("invalid value for 'date', date cannot be nil.") end @@ -233,6 +237,7 @@ module Petstore return false if !@double.nil? && @double < 67.8 return false if !@string.nil? && @string !~ Regexp.new(/[a-z]/i) return false if @byte.nil? + return false if @byte !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/) return false if @date.nil? return false if @password.nil? return false if @password.to_s.length > 64 @@ -329,6 +334,20 @@ module Petstore @string = string end + # Custom attribute writer method with validation + # @param [Object] byte Value to be assigned + def byte=(byte) + if byte.nil? + fail ArgumentError, "byte cannot be nil" + end + + if byte !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/) + fail ArgumentError, "invalid value for 'byte', must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/." + end + + @byte = byte + end + # Custom attribute writer method with validation # @param [Object] password Value to be assigned def password=(password) From f3d83eb925fb97440de506c194588cf62ce62624 Mon Sep 17 00:00:00 2001 From: wing328 Date: Sun, 2 Jul 2017 21:46:04 +0800 Subject: [PATCH 4/7] update ruby gem dependency version (#5964) --- .../src/main/resources/ruby/gemspec.mustache | 4 +- samples/client/petstore/ruby/Gemfile.lock | 55 +++++++++---------- samples/client/petstore/ruby/petstore.gemspec | 4 +- 3 files changed, 31 insertions(+), 32 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/ruby/gemspec.mustache b/modules/swagger-codegen/src/main/resources/ruby/gemspec.mustache index a6617ac8547a..7501d1360e8e 100644 --- a/modules/swagger-codegen/src/main/resources/ruby/gemspec.mustache +++ b/modules/swagger-codegen/src/main/resources/ruby/gemspec.mustache @@ -26,9 +26,9 @@ Gem::Specification.new do |s| s.required_ruby_version = "{{{gemRequiredRubyVersion}}}{{^gemRequiredRubyVersion}}>= 1.9{{/gemRequiredRubyVersion}}" s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' - s.add_runtime_dependency 'json', '~> 1.8', '>= 1.8.3' + s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' - s.add_development_dependency 'rspec', '~> 3.4', '>= 3.4.0' + s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' s.add_development_dependency 'vcr', '~> 3.0', '>= 3.0.1' s.add_development_dependency 'webmock', '~> 1.24', '>= 1.24.3' s.add_development_dependency 'autotest', '~> 4.4', '>= 4.4.6' diff --git a/samples/client/petstore/ruby/Gemfile.lock b/samples/client/petstore/ruby/Gemfile.lock index 18532818d141..e7791399b9ad 100644 --- a/samples/client/petstore/ruby/Gemfile.lock +++ b/samples/client/petstore/ruby/Gemfile.lock @@ -2,49 +2,51 @@ PATH remote: . specs: petstore (1.0.0) - json (~> 1.8, >= 1.8.3) + json (~> 2.1, >= 2.1.0) typhoeus (~> 1.0, >= 1.0.1) GEM remote: https://rubygems.org/ specs: - ZenTest (4.11.0) - addressable (2.3.8) + ZenTest (4.11.1) + addressable (2.5.1) + public_suffix (~> 2.0, >= 2.0.2) autotest (4.4.6) ZenTest (>= 4.4.1) autotest-fsevent (0.2.12) sys-uname autotest-growl (0.2.16) autotest-rails-pure (4.1.2) - crack (0.4.2) + crack (0.4.3) safe_yaml (~> 1.0.0) - diff-lcs (1.2.5) - ethon (0.8.1) + diff-lcs (1.3) + ethon (0.10.1) ffi (>= 1.3.0) - ffi (1.9.8) - hashdiff (0.3.0) - json (1.8.3) + ffi (1.9.18) + hashdiff (0.3.4) + json (2.1.0) + public_suffix (2.0.5) rake (12.0.0) - rspec (3.4.0) - rspec-core (~> 3.4.0) - rspec-expectations (~> 3.4.0) - rspec-mocks (~> 3.4.0) - rspec-core (3.4.4) - rspec-support (~> 3.4.0) - rspec-expectations (3.4.0) + rspec (3.6.0) + rspec-core (~> 3.6.0) + rspec-expectations (~> 3.6.0) + rspec-mocks (~> 3.6.0) + rspec-core (3.6.0) + rspec-support (~> 3.6.0) + rspec-expectations (3.6.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.4.0) - rspec-mocks (3.4.1) + rspec-support (~> 3.6.0) + rspec-mocks (3.6.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.4.0) - rspec-support (3.4.1) + rspec-support (~> 3.6.0) + rspec-support (3.6.0) safe_yaml (1.0.4) sys-uname (1.0.3) ffi (>= 1.0.0) - typhoeus (1.0.1) - ethon (>= 0.8.0) - vcr (3.0.1) - webmock (1.24.5) + typhoeus (1.1.2) + ethon (>= 0.9.0) + vcr (3.0.3) + webmock (1.24.6) addressable (>= 2.3.6) crack (>= 0.3.2) hashdiff @@ -59,9 +61,6 @@ DEPENDENCIES autotest-rails-pure (~> 4.1, >= 4.1.2) petstore! rake (~> 12.0.0) - rspec (~> 3.4, >= 3.4.0) + rspec (~> 3.6, >= 3.6.0) vcr (~> 3.0, >= 3.0.1) webmock (~> 1.24, >= 1.24.3) - -BUNDLED WITH - 1.12.3 diff --git a/samples/client/petstore/ruby/petstore.gemspec b/samples/client/petstore/ruby/petstore.gemspec index 846b2ac60eeb..3dd54d3107f8 100644 --- a/samples/client/petstore/ruby/petstore.gemspec +++ b/samples/client/petstore/ruby/petstore.gemspec @@ -29,9 +29,9 @@ Gem::Specification.new do |s| s.required_ruby_version = ">= 1.9" s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' - s.add_runtime_dependency 'json', '~> 1.8', '>= 1.8.3' + s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' - s.add_development_dependency 'rspec', '~> 3.4', '>= 3.4.0' + s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' s.add_development_dependency 'vcr', '~> 3.0', '>= 3.0.1' s.add_development_dependency 'webmock', '~> 1.24', '>= 1.24.3' s.add_development_dependency 'autotest', '~> 4.4', '>= 4.4.6' From 94814176b7564d2aaceeb3582f96a7aea3cae48e Mon Sep 17 00:00:00 2001 From: mmosemmle Date: Sun, 2 Jul 2017 15:30:42 +0100 Subject: [PATCH 5/7] [CPP] Fixing some more ordering of checks (#5951) * Fix more ordering of checks. * Update cpp petstores. --- .../swagger/codegen/languages/CppRestClientCodegen.java | 4 ++-- .../swagger/codegen/languages/PistacheServerCodegen.java | 4 ++-- .../java/io/swagger/codegen/languages/RestbedCodegen.java | 4 ++-- samples/client/petstore/cpprest/model/Category.cpp | 2 +- samples/client/petstore/cpprest/model/Order.cpp | 4 ++-- samples/client/petstore/cpprest/model/Pet.cpp | 2 +- samples/client/petstore/cpprest/model/Tag.cpp | 2 +- samples/client/petstore/cpprest/model/User.cpp | 2 +- .../server/petstore/pistache-server/model/Category.cpp | 2 +- samples/server/petstore/pistache-server/model/Order.cpp | 4 ++-- samples/server/petstore/pistache-server/model/Pet.cpp | 2 +- samples/server/petstore/pistache-server/model/Tag.cpp | 2 +- samples/server/petstore/pistache-server/model/User.cpp | 2 +- samples/server/petstore/restbed/model/Category.cpp | 4 ++-- samples/server/petstore/restbed/model/Order.cpp | 8 ++++---- samples/server/petstore/restbed/model/Pet.cpp | 4 ++-- samples/server/petstore/restbed/model/Tag.cpp | 4 ++-- samples/server/petstore/restbed/model/User.cpp | 4 ++-- 18 files changed, 30 insertions(+), 30 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CppRestClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CppRestClientCodegen.java index 6053939fa4e2..e1a79f4d5766 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CppRestClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CppRestClientCodegen.java @@ -312,10 +312,10 @@ public class CppRestClientCodegen extends DefaultCodegen implements CodegenConfi return "0.0"; } else if (p instanceof FloatProperty) { return "0.0f"; - } else if (p instanceof IntegerProperty || p instanceof BaseIntegerProperty) { - return "0"; } else if (p instanceof LongProperty) { return "0L"; + } else if (p instanceof IntegerProperty || p instanceof BaseIntegerProperty) { + return "0"; } else if (p instanceof DecimalProperty) { return "0.0"; } else if (p instanceof MapProperty) { diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PistacheServerCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PistacheServerCodegen.java index a56ef44710a7..0eb83a5e2ebe 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PistacheServerCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PistacheServerCodegen.java @@ -286,10 +286,10 @@ public class PistacheServerCodegen extends DefaultCodegen implements CodegenConf return "0.0"; } else if (p instanceof FloatProperty) { return "0.0f"; - } else if (p instanceof IntegerProperty || p instanceof BaseIntegerProperty) { - return "0"; } else if (p instanceof LongProperty) { return "0L"; + } else if (p instanceof IntegerProperty || p instanceof BaseIntegerProperty) { + return "0"; } else if (p instanceof DecimalProperty) { return "0.0"; } else if (p instanceof MapProperty) { diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/RestbedCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/RestbedCodegen.java index 730d6e075b65..dcd4c75988af 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/RestbedCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/RestbedCodegen.java @@ -318,10 +318,10 @@ public class RestbedCodegen extends DefaultCodegen implements CodegenConfig { return "0.0"; } else if (p instanceof FloatProperty) { return "0.0f"; - } else if (p instanceof IntegerProperty || p instanceof BaseIntegerProperty) { - return "0"; } else if (p instanceof LongProperty) { return "0L"; + } else if (p instanceof IntegerProperty || p instanceof BaseIntegerProperty) { + return "0"; } else if (p instanceof DecimalProperty) { return "0.0"; } else if (p instanceof MapProperty) { diff --git a/samples/client/petstore/cpprest/model/Category.cpp b/samples/client/petstore/cpprest/model/Category.cpp index 4d1856071490..24bdc66c132b 100644 --- a/samples/client/petstore/cpprest/model/Category.cpp +++ b/samples/client/petstore/cpprest/model/Category.cpp @@ -21,7 +21,7 @@ namespace model { Category::Category() { - m_Id = 0; + m_Id = 0L; m_IdIsSet = false; m_Name = U(""); m_NameIsSet = false; diff --git a/samples/client/petstore/cpprest/model/Order.cpp b/samples/client/petstore/cpprest/model/Order.cpp index b205701b76ff..24f3b7e46cc6 100644 --- a/samples/client/petstore/cpprest/model/Order.cpp +++ b/samples/client/petstore/cpprest/model/Order.cpp @@ -21,9 +21,9 @@ namespace model { Order::Order() { - m_Id = 0; + m_Id = 0L; m_IdIsSet = false; - m_PetId = 0; + m_PetId = 0L; m_PetIdIsSet = false; m_Quantity = 0; m_QuantityIsSet = false; diff --git a/samples/client/petstore/cpprest/model/Pet.cpp b/samples/client/petstore/cpprest/model/Pet.cpp index 5d8a4bb97257..a89406497f61 100644 --- a/samples/client/petstore/cpprest/model/Pet.cpp +++ b/samples/client/petstore/cpprest/model/Pet.cpp @@ -21,7 +21,7 @@ namespace model { Pet::Pet() { - m_Id = 0; + m_Id = 0L; m_IdIsSet = false; m_CategoryIsSet = false; m_Name = U(""); diff --git a/samples/client/petstore/cpprest/model/Tag.cpp b/samples/client/petstore/cpprest/model/Tag.cpp index 6d5e350ab917..050bcc2d4889 100644 --- a/samples/client/petstore/cpprest/model/Tag.cpp +++ b/samples/client/petstore/cpprest/model/Tag.cpp @@ -21,7 +21,7 @@ namespace model { Tag::Tag() { - m_Id = 0; + m_Id = 0L; m_IdIsSet = false; m_Name = U(""); m_NameIsSet = false; diff --git a/samples/client/petstore/cpprest/model/User.cpp b/samples/client/petstore/cpprest/model/User.cpp index 3cf4e4258d59..9ec72d1ac986 100644 --- a/samples/client/petstore/cpprest/model/User.cpp +++ b/samples/client/petstore/cpprest/model/User.cpp @@ -21,7 +21,7 @@ namespace model { User::User() { - m_Id = 0; + m_Id = 0L; m_IdIsSet = false; m_Username = U(""); m_UsernameIsSet = false; diff --git a/samples/server/petstore/pistache-server/model/Category.cpp b/samples/server/petstore/pistache-server/model/Category.cpp index 544f71241daf..966fb4a2262a 100644 --- a/samples/server/petstore/pistache-server/model/Category.cpp +++ b/samples/server/petstore/pistache-server/model/Category.cpp @@ -20,7 +20,7 @@ namespace model { Category::Category() { - m_Id = 0; + m_Id = 0L; m_IdIsSet = false; m_Name = ""; m_NameIsSet = false; diff --git a/samples/server/petstore/pistache-server/model/Order.cpp b/samples/server/petstore/pistache-server/model/Order.cpp index 7e249eb341bb..d1a94778deb1 100644 --- a/samples/server/petstore/pistache-server/model/Order.cpp +++ b/samples/server/petstore/pistache-server/model/Order.cpp @@ -20,9 +20,9 @@ namespace model { Order::Order() { - m_Id = 0; + m_Id = 0L; m_IdIsSet = false; - m_PetId = 0; + m_PetId = 0L; m_PetIdIsSet = false; m_Quantity = 0; m_QuantityIsSet = false; diff --git a/samples/server/petstore/pistache-server/model/Pet.cpp b/samples/server/petstore/pistache-server/model/Pet.cpp index 1f5cfe2d7e8c..7fad21e5e61c 100644 --- a/samples/server/petstore/pistache-server/model/Pet.cpp +++ b/samples/server/petstore/pistache-server/model/Pet.cpp @@ -20,7 +20,7 @@ namespace model { Pet::Pet() { - m_Id = 0; + m_Id = 0L; m_IdIsSet = false; m_CategoryIsSet = false; m_Name = ""; diff --git a/samples/server/petstore/pistache-server/model/Tag.cpp b/samples/server/petstore/pistache-server/model/Tag.cpp index 0854613f58bf..a020e73a1397 100644 --- a/samples/server/petstore/pistache-server/model/Tag.cpp +++ b/samples/server/petstore/pistache-server/model/Tag.cpp @@ -20,7 +20,7 @@ namespace model { Tag::Tag() { - m_Id = 0; + m_Id = 0L; m_IdIsSet = false; m_Name = ""; m_NameIsSet = false; diff --git a/samples/server/petstore/pistache-server/model/User.cpp b/samples/server/petstore/pistache-server/model/User.cpp index c916d14842e7..052587ab16fd 100644 --- a/samples/server/petstore/pistache-server/model/User.cpp +++ b/samples/server/petstore/pistache-server/model/User.cpp @@ -20,7 +20,7 @@ namespace model { User::User() { - m_Id = 0; + m_Id = 0L; m_IdIsSet = false; m_Username = ""; m_UsernameIsSet = false; diff --git a/samples/server/petstore/restbed/model/Category.cpp b/samples/server/petstore/restbed/model/Category.cpp index e5a38f26420e..34f0bf8af0b5 100644 --- a/samples/server/petstore/restbed/model/Category.cpp +++ b/samples/server/petstore/restbed/model/Category.cpp @@ -30,7 +30,7 @@ namespace model { Category::Category() { - m_Id = 0; + m_Id = 0L; m_Name = ""; } @@ -54,7 +54,7 @@ void Category::fromJsonString(std::string const& jsonString) std::stringstream ss(jsonString); ptree pt; read_json(ss,pt); - m_Id = pt.get("Id", 0); + m_Id = pt.get("Id", 0L); m_Name = pt.get("Name", ""); } diff --git a/samples/server/petstore/restbed/model/Order.cpp b/samples/server/petstore/restbed/model/Order.cpp index b6e97cecd1c4..4c14639d10fc 100644 --- a/samples/server/petstore/restbed/model/Order.cpp +++ b/samples/server/petstore/restbed/model/Order.cpp @@ -30,8 +30,8 @@ namespace model { Order::Order() { - m_Id = 0; - m_PetId = 0; + m_Id = 0L; + m_PetId = 0L; m_Quantity = 0; m_ShipDate = ""; m_Status = ""; @@ -62,8 +62,8 @@ void Order::fromJsonString(std::string const& jsonString) std::stringstream ss(jsonString); ptree pt; read_json(ss,pt); - m_Id = pt.get("Id", 0); - m_PetId = pt.get("PetId", 0); + m_Id = pt.get("Id", 0L); + m_PetId = pt.get("PetId", 0L); m_Quantity = pt.get("Quantity", 0); m_ShipDate = pt.get("ShipDate", ""); m_Status = pt.get("Status", ""); diff --git a/samples/server/petstore/restbed/model/Pet.cpp b/samples/server/petstore/restbed/model/Pet.cpp index 1889dc891a8f..9f4ce7d61465 100644 --- a/samples/server/petstore/restbed/model/Pet.cpp +++ b/samples/server/petstore/restbed/model/Pet.cpp @@ -30,7 +30,7 @@ namespace model { Pet::Pet() { - m_Id = 0; + m_Id = 0L; m_Name = ""; m_Status = ""; @@ -56,7 +56,7 @@ void Pet::fromJsonString(std::string const& jsonString) std::stringstream ss(jsonString); ptree pt; read_json(ss,pt); - m_Id = pt.get("Id", 0); + m_Id = pt.get("Id", 0L); m_Name = pt.get("Name", ""); m_Status = pt.get("Status", ""); } diff --git a/samples/server/petstore/restbed/model/Tag.cpp b/samples/server/petstore/restbed/model/Tag.cpp index a23bb9f767fe..ac2fb1f3f4b1 100644 --- a/samples/server/petstore/restbed/model/Tag.cpp +++ b/samples/server/petstore/restbed/model/Tag.cpp @@ -30,7 +30,7 @@ namespace model { Tag::Tag() { - m_Id = 0; + m_Id = 0L; m_Name = ""; } @@ -54,7 +54,7 @@ void Tag::fromJsonString(std::string const& jsonString) std::stringstream ss(jsonString); ptree pt; read_json(ss,pt); - m_Id = pt.get("Id", 0); + m_Id = pt.get("Id", 0L); m_Name = pt.get("Name", ""); } diff --git a/samples/server/petstore/restbed/model/User.cpp b/samples/server/petstore/restbed/model/User.cpp index be22d9bc9eff..d80b59b38e31 100644 --- a/samples/server/petstore/restbed/model/User.cpp +++ b/samples/server/petstore/restbed/model/User.cpp @@ -30,7 +30,7 @@ namespace model { User::User() { - m_Id = 0; + m_Id = 0L; m_Username = ""; m_FirstName = ""; m_LastName = ""; @@ -66,7 +66,7 @@ void User::fromJsonString(std::string const& jsonString) std::stringstream ss(jsonString); ptree pt; read_json(ss,pt); - m_Id = pt.get("Id", 0); + m_Id = pt.get("Id", 0L); m_Username = pt.get("Username", ""); m_FirstName = pt.get("FirstName", ""); m_LastName = pt.get("LastName", ""); From 5de6f7b86ee203f81a900be7f4f6ef61a471744b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pa=C5=ADlo=20Ebermann?= Date: Sun, 2 Jul 2017 16:32:58 +0200 Subject: [PATCH 6/7] Change all sample-generators for typescript-angular2-* to use the YAML version. (#5859) --- bin/typescript-angular2-petstore-all.sh | 2 +- ...typescript-angular2-petstore-interfaces.sh | 2 +- bin/typescript-angular2-petstore-with-npm.sh | 2 +- bin/typescript-angular2-petstore.sh | 2 +- .../with-interfaces/api/PetApi.ts | 98 ++++++++++--------- .../with-interfaces/api/PetApiInterface.ts | 20 ++-- .../with-interfaces/api/StoreApi.ts | 31 +++--- .../with-interfaces/api/StoreApiInterface.ts | 8 +- .../with-interfaces/api/UserApi.ts | 80 +++++++++------ .../with-interfaces/api/UserApiInterface.ts | 14 +-- .../with-interfaces/model/ApiResponse.ts | 25 +++++ .../with-interfaces/model/Category.ts | 7 +- .../with-interfaces/model/Order.ts | 7 +- .../with-interfaces/model/Pet.ts | 7 +- .../with-interfaces/model/Tag.ts | 7 +- .../with-interfaces/model/User.ts | 7 +- .../with-interfaces/model/models.ts | 1 + 17 files changed, 195 insertions(+), 125 deletions(-) create mode 100644 samples/client/petstore/typescript-angular2/with-interfaces/model/ApiResponse.ts diff --git a/bin/typescript-angular2-petstore-all.sh b/bin/typescript-angular2-petstore-all.sh index 0a4ee7080d5d..1c805738b528 100755 --- a/bin/typescript-angular2-petstore-all.sh +++ b/bin/typescript-angular2-petstore-all.sh @@ -36,5 +36,5 @@ ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml java $JAVA_OPTS -jar $executable $ags echo "Typescript Petstore API client (with interfaces generated)" -ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l typescript-angular2 -o samples/client/petstore/typescript-angular2/with-interfaces -D withInterfaces=true" +ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l typescript-angular2 -o samples/client/petstore/typescript-angular2/with-interfaces -D withInterfaces=true" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/typescript-angular2-petstore-interfaces.sh b/bin/typescript-angular2-petstore-interfaces.sh index 12b3228a6199..8fc81f13d684 100755 --- a/bin/typescript-angular2-petstore-interfaces.sh +++ b/bin/typescript-angular2-petstore-interfaces.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.json -l typescript-angular2 -o samples/client/petstore/typescript-angular2/with-interfaces -D withInterfaces=true" +ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l typescript-angular2 -o samples/client/petstore/typescript-angular2/with-interfaces -D withInterfaces=true" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/typescript-angular2-petstore-with-npm.sh b/bin/typescript-angular2-petstore-with-npm.sh index 305a3e0b39de..0b96d7bd7328 100755 --- a/bin/typescript-angular2-petstore-with-npm.sh +++ b/bin/typescript-angular2-petstore-with-npm.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.json -l typescript-angular2 -c bin/typescript-petstore-npm.json -o samples/client/petstore/typescript-angular2/npm" +ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l typescript-angular2 -c bin/typescript-petstore-npm.json -o samples/client/petstore/typescript-angular2/npm" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/typescript-angular2-petstore.sh b/bin/typescript-angular2-petstore.sh index f26dd0f668f2..dbb00a91344d 100755 --- a/bin/typescript-angular2-petstore.sh +++ b/bin/typescript-angular2-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 -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l typescript-angular2 -o samples/client/petstore/typescript-angular2/default" +ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l typescript-angular2 -o samples/client/petstore/typescript-angular2/default" java $JAVA_OPTS -jar $executable $ags 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 b23d131cca1f..5cb93a2d9873 100644 --- a/samples/client/petstore/typescript-angular2/with-interfaces/api/PetApi.ts +++ b/samples/client/petstore/typescript-angular2/with-interfaces/api/PetApi.ts @@ -1,9 +1,9 @@ /** * Swagger Petstore - * This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@wordnik.com + * Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git @@ -47,7 +47,7 @@ export class PetApi implements PetApiInterface { * * @param body Pet object that needs to be added to the store */ - public addPet(body?: models.Pet, extraHttpRequestParams?: any): Observable<{}> { + public addPet(body: models.Pet, extraHttpRequestParams?: any): Observable<{}> { return this.addPetWithHttpInfo(body, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -80,7 +80,7 @@ export class PetApi implements PetApiInterface { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter */ - public findPetsByStatus(status?: Array, extraHttpRequestParams?: any): Observable> { + public findPetsByStatus(status: Array, extraHttpRequestParams?: any): Observable> { return this.findPetsByStatusWithHttpInfo(status, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -96,7 +96,7 @@ export class PetApi implements PetApiInterface { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by */ - public findPetsByTags(tags?: Array, extraHttpRequestParams?: any): Observable> { + public findPetsByTags(tags: Array, extraHttpRequestParams?: any): Observable> { return this.findPetsByTagsWithHttpInfo(tags, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -109,8 +109,8 @@ export class PetApi implements PetApiInterface { /** * Find pet by ID - * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - * @param petId ID of pet that needs to be fetched + * Returns a single pet + * @param petId ID of pet to return */ public getPetById(petId: number, extraHttpRequestParams?: any): Observable { return this.getPetByIdWithHttpInfo(petId, extraHttpRequestParams) @@ -128,7 +128,7 @@ export class PetApi implements PetApiInterface { * * @param body Pet object that needs to be added to the store */ - public updatePet(body?: models.Pet, extraHttpRequestParams?: any): Observable<{}> { + public updatePet(body: models.Pet, extraHttpRequestParams?: any): Observable<{}> { return this.updatePetWithHttpInfo(body, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -146,7 +146,7 @@ export class PetApi implements PetApiInterface { * @param name Updated name of the pet * @param status Updated status of the pet */ - public updatePetWithForm(petId: string, name?: string, status?: string, extraHttpRequestParams?: any): Observable<{}> { + public updatePetWithForm(petId: number, name?: string, status?: string, extraHttpRequestParams?: any): Observable<{}> { return this.updatePetWithFormWithHttpInfo(petId, name, status, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -164,7 +164,7 @@ export class PetApi implements PetApiInterface { * @param additionalMetadata Additional data to pass to server * @param file file to upload */ - public uploadFile(petId: number, additionalMetadata?: string, file?: any, extraHttpRequestParams?: any): Observable<{}> { + public uploadFile(petId: number, additionalMetadata?: string, file?: any, extraHttpRequestParams?: any): Observable { return this.uploadFileWithHttpInfo(petId, additionalMetadata, file, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -181,11 +181,15 @@ export class PetApi implements PetApiInterface { * * @param body Pet object that needs to be added to the store */ - public addPetWithHttpInfo(body?: models.Pet, extraHttpRequestParams?: any): Observable { + public addPetWithHttpInfo(body: models.Pet, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/pet'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling addPet.'); + } // to determine the Content-Type header let consumes: string[] = [ 'application/json', @@ -194,8 +198,8 @@ export class PetApi implements PetApiInterface { // to determine the Accept header let produces: string[] = [ - 'application/json', - 'application/xml' + 'application/xml', + 'application/json' ]; // authentication (petstore_auth) required @@ -250,8 +254,8 @@ export class PetApi implements PetApiInterface { // to determine the Accept header let produces: string[] = [ - 'application/json', - 'application/xml' + 'application/xml', + 'application/json' ]; // authentication (petstore_auth) required @@ -282,15 +286,17 @@ export class PetApi implements PetApiInterface { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter */ - public findPetsByStatusWithHttpInfo(status?: Array, extraHttpRequestParams?: any): Observable { + public findPetsByStatusWithHttpInfo(status: Array, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/pet/findByStatus'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 + // verify required parameter 'status' is not null or undefined + if (status === null || status === undefined) { + throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); + } if (status) { - status.forEach((element) => { - queryParameters.append('status', element); - }) + queryParameters.set('status', status.join(COLLECTION_FORMATS['csv'])); } // to determine the Content-Type header @@ -299,8 +305,8 @@ export class PetApi implements PetApiInterface { // to determine the Accept header let produces: string[] = [ - 'application/json', - 'application/xml' + 'application/xml', + 'application/json' ]; // authentication (petstore_auth) required @@ -331,15 +337,17 @@ export class PetApi implements PetApiInterface { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by */ - public findPetsByTagsWithHttpInfo(tags?: Array, extraHttpRequestParams?: any): Observable { + public findPetsByTagsWithHttpInfo(tags: Array, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/pet/findByTags'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 + // verify required parameter 'tags' is not null or undefined + if (tags === null || tags === undefined) { + throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); + } if (tags) { - tags.forEach((element) => { - queryParameters.append('tags', element); - }) + queryParameters.set('tags', tags.join(COLLECTION_FORMATS['csv'])); } // to determine the Content-Type header @@ -348,8 +356,8 @@ export class PetApi implements PetApiInterface { // to determine the Accept header let produces: string[] = [ - 'application/json', - 'application/xml' + 'application/xml', + 'application/json' ]; // authentication (petstore_auth) required @@ -377,8 +385,8 @@ export class PetApi implements PetApiInterface { /** * Find pet by ID - * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - * @param petId ID of pet that needs to be fetched + * Returns a single pet + * @param petId ID of pet to return */ public getPetByIdWithHttpInfo(petId: number, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/pet/${petId}' @@ -396,8 +404,8 @@ export class PetApi implements PetApiInterface { // to determine the Accept header let produces: string[] = [ - 'application/json', - 'application/xml' + 'application/xml', + 'application/json' ]; // authentication (api_key) required @@ -405,15 +413,6 @@ export class PetApi implements PetApiInterface { headers.set('api_key', this.configuration.apiKey); } - // authentication (petstore_auth) required - // oauth required - if (this.configuration.accessToken) { - let accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers.set('Authorization', 'Bearer ' + accessToken); - } - let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, @@ -433,11 +432,15 @@ export class PetApi implements PetApiInterface { * * @param body Pet object that needs to be added to the store */ - public updatePetWithHttpInfo(body?: models.Pet, extraHttpRequestParams?: any): Observable { + public updatePetWithHttpInfo(body: models.Pet, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/pet'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling updatePet.'); + } // to determine the Content-Type header let consumes: string[] = [ 'application/json', @@ -446,8 +449,8 @@ export class PetApi implements PetApiInterface { // to determine the Accept header let produces: string[] = [ - 'application/json', - 'application/xml' + 'application/xml', + 'application/json' ]; // authentication (petstore_auth) required @@ -483,7 +486,7 @@ export class PetApi implements PetApiInterface { * @param name Updated name of the pet * @param status Updated status of the pet */ - public updatePetWithFormWithHttpInfo(petId: string, name?: string, status?: string, extraHttpRequestParams?: any): Observable { + public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/pet/${petId}' .replace('${' + 'petId' + '}', String(petId)); @@ -502,8 +505,8 @@ export class PetApi implements PetApiInterface { // to determine the Accept header let produces: string[] = [ - 'application/json', - 'application/xml' + 'application/xml', + 'application/json' ]; // authentication (petstore_auth) required @@ -566,8 +569,7 @@ export class PetApi implements PetApiInterface { // to determine the Accept header let produces: string[] = [ - 'application/json', - 'application/xml' + 'application/json' ]; // authentication (petstore_auth) required diff --git a/samples/client/petstore/typescript-angular2/with-interfaces/api/PetApiInterface.ts b/samples/client/petstore/typescript-angular2/with-interfaces/api/PetApiInterface.ts index d41a63882748..3f7c04d27dba 100644 --- a/samples/client/petstore/typescript-angular2/with-interfaces/api/PetApiInterface.ts +++ b/samples/client/petstore/typescript-angular2/with-interfaces/api/PetApiInterface.ts @@ -1,9 +1,9 @@ /** * Swagger Petstore - * This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@wordnik.com + * Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git @@ -28,7 +28,7 @@ export interface PetApiInterface { * * @param body Pet object that needs to be added to the store */ - addPet(body?: models.Pet, extraHttpRequestParams?: any): Observable<{}>; + addPet(body: models.Pet, extraHttpRequestParams?: any): Observable<{}>; /** * Deletes a pet @@ -43,19 +43,19 @@ export interface PetApiInterface { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter */ - findPetsByStatus(status?: Array, extraHttpRequestParams?: any): Observable>; + findPetsByStatus(status: Array, extraHttpRequestParams?: any): Observable>; /** * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by */ - findPetsByTags(tags?: Array, extraHttpRequestParams?: any): Observable>; + findPetsByTags(tags: Array, extraHttpRequestParams?: any): Observable>; /** * Find pet by ID - * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - * @param petId ID of pet that needs to be fetched + * Returns a single pet + * @param petId ID of pet to return */ getPetById(petId: number, extraHttpRequestParams?: any): Observable; @@ -64,7 +64,7 @@ export interface PetApiInterface { * * @param body Pet object that needs to be added to the store */ - updatePet(body?: models.Pet, extraHttpRequestParams?: any): Observable<{}>; + updatePet(body: models.Pet, extraHttpRequestParams?: any): Observable<{}>; /** * Updates a pet in the store with form data @@ -73,7 +73,7 @@ export interface PetApiInterface { * @param name Updated name of the pet * @param status Updated status of the pet */ - updatePetWithForm(petId: string, name?: string, status?: string, extraHttpRequestParams?: any): Observable<{}>; + updatePetWithForm(petId: number, name?: string, status?: string, extraHttpRequestParams?: any): Observable<{}>; /** * uploads an image @@ -82,6 +82,6 @@ export interface PetApiInterface { * @param additionalMetadata Additional data to pass to server * @param file file to upload */ - uploadFile(petId: number, additionalMetadata?: string, file?: any, extraHttpRequestParams?: any): Observable<{}>; + uploadFile(petId: number, additionalMetadata?: string, file?: any, extraHttpRequestParams?: any): Observable; } 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 dcefb6f6b287..a9e78e0bc41f 100644 --- a/samples/client/petstore/typescript-angular2/with-interfaces/api/StoreApi.ts +++ b/samples/client/petstore/typescript-angular2/with-interfaces/api/StoreApi.ts @@ -1,9 +1,9 @@ /** * Swagger Petstore - * This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@wordnik.com + * Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git @@ -78,7 +78,7 @@ export class StoreApi implements StoreApiInterface { * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched */ - public getOrderById(orderId: string, extraHttpRequestParams?: any): Observable { + public getOrderById(orderId: number, extraHttpRequestParams?: any): Observable { return this.getOrderByIdWithHttpInfo(orderId, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -94,7 +94,7 @@ export class StoreApi implements StoreApiInterface { * * @param body order placed for purchasing the pet */ - public placeOrder(body?: models.Order, extraHttpRequestParams?: any): Observable { + public placeOrder(body: models.Order, extraHttpRequestParams?: any): Observable { return this.placeOrderWithHttpInfo(body, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -127,8 +127,8 @@ export class StoreApi implements StoreApiInterface { // to determine the Accept header let produces: string[] = [ - 'application/json', - 'application/xml' + 'application/xml', + 'application/json' ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ @@ -160,8 +160,7 @@ export class StoreApi implements StoreApiInterface { // to determine the Accept header let produces: string[] = [ - 'application/json', - 'application/xml' + 'application/json' ]; // authentication (api_key) required @@ -188,7 +187,7 @@ export class StoreApi implements StoreApiInterface { * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched */ - public getOrderByIdWithHttpInfo(orderId: string, extraHttpRequestParams?: any): Observable { + public getOrderByIdWithHttpInfo(orderId: number, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/store/order/${orderId}' .replace('${' + 'orderId' + '}', String(orderId)); @@ -204,8 +203,8 @@ export class StoreApi implements StoreApiInterface { // to determine the Accept header let produces: string[] = [ - 'application/json', - 'application/xml' + 'application/xml', + 'application/json' ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ @@ -227,19 +226,23 @@ export class StoreApi implements StoreApiInterface { * * @param body order placed for purchasing the pet */ - public placeOrderWithHttpInfo(body?: models.Order, extraHttpRequestParams?: any): Observable { + public placeOrderWithHttpInfo(body: models.Order, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/store/order'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling placeOrder.'); + } // to determine the Content-Type header let consumes: string[] = [ ]; // to determine the Accept header let produces: string[] = [ - 'application/json', - 'application/xml' + 'application/xml', + 'application/json' ]; headers.set('Content-Type', 'application/json'); diff --git a/samples/client/petstore/typescript-angular2/with-interfaces/api/StoreApiInterface.ts b/samples/client/petstore/typescript-angular2/with-interfaces/api/StoreApiInterface.ts index e8fe0eb9a824..ca2476d82105 100644 --- a/samples/client/petstore/typescript-angular2/with-interfaces/api/StoreApiInterface.ts +++ b/samples/client/petstore/typescript-angular2/with-interfaces/api/StoreApiInterface.ts @@ -1,9 +1,9 @@ /** * Swagger Petstore - * This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@wordnik.com + * Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git @@ -41,13 +41,13 @@ export interface StoreApiInterface { * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched */ - getOrderById(orderId: string, extraHttpRequestParams?: any): Observable; + getOrderById(orderId: number, extraHttpRequestParams?: any): Observable; /** * Place an order for a pet * * @param body order placed for purchasing the pet */ - placeOrder(body?: models.Order, extraHttpRequestParams?: any): Observable; + placeOrder(body: models.Order, extraHttpRequestParams?: any): Observable; } 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 b8738b0e4634..d8d426fd7d19 100644 --- a/samples/client/petstore/typescript-angular2/with-interfaces/api/UserApi.ts +++ b/samples/client/petstore/typescript-angular2/with-interfaces/api/UserApi.ts @@ -1,9 +1,9 @@ /** * Swagger Petstore - * This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@wordnik.com + * Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git @@ -47,7 +47,7 @@ export class UserApi implements UserApiInterface { * This can only be done by the logged in user. * @param body Created user object */ - public createUser(body?: models.User, extraHttpRequestParams?: any): Observable<{}> { + public createUser(body: models.User, extraHttpRequestParams?: any): Observable<{}> { return this.createUserWithHttpInfo(body, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -63,7 +63,7 @@ export class UserApi implements UserApiInterface { * * @param body List of user object */ - public createUsersWithArrayInput(body?: Array, extraHttpRequestParams?: any): Observable<{}> { + public createUsersWithArrayInput(body: Array, extraHttpRequestParams?: any): Observable<{}> { return this.createUsersWithArrayInputWithHttpInfo(body, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -79,7 +79,7 @@ export class UserApi implements UserApiInterface { * * @param body List of user object */ - public createUsersWithListInput(body?: Array, extraHttpRequestParams?: any): Observable<{}> { + public createUsersWithListInput(body: Array, extraHttpRequestParams?: any): Observable<{}> { return this.createUsersWithListInputWithHttpInfo(body, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -128,7 +128,7 @@ export class UserApi implements UserApiInterface { * @param username The user name for login * @param password The password for login in clear text */ - public loginUser(username?: string, password?: string, extraHttpRequestParams?: any): Observable { + public loginUser(username: string, password: string, extraHttpRequestParams?: any): Observable { return this.loginUserWithHttpInfo(username, password, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -160,7 +160,7 @@ export class UserApi implements UserApiInterface { * @param username name that need to be deleted * @param body Updated user object */ - public updateUser(username: string, body?: models.User, extraHttpRequestParams?: any): Observable<{}> { + public updateUser(username: string, body: models.User, extraHttpRequestParams?: any): Observable<{}> { return this.updateUserWithHttpInfo(username, body, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -177,19 +177,23 @@ export class UserApi implements UserApiInterface { * This can only be done by the logged in user. * @param body Created user object */ - public createUserWithHttpInfo(body?: models.User, extraHttpRequestParams?: any): Observable { + public createUserWithHttpInfo(body: models.User, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/user'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling createUser.'); + } // to determine the Content-Type header let consumes: string[] = [ ]; // to determine the Accept header let produces: string[] = [ - 'application/json', - 'application/xml' + 'application/xml', + 'application/json' ]; headers.set('Content-Type', 'application/json'); @@ -214,19 +218,23 @@ export class UserApi implements UserApiInterface { * * @param body List of user object */ - public createUsersWithArrayInputWithHttpInfo(body?: Array, extraHttpRequestParams?: any): Observable { + public createUsersWithArrayInputWithHttpInfo(body: Array, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/user/createWithArray'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); + } // to determine the Content-Type header let consumes: string[] = [ ]; // to determine the Accept header let produces: string[] = [ - 'application/json', - 'application/xml' + 'application/xml', + 'application/json' ]; headers.set('Content-Type', 'application/json'); @@ -251,19 +259,23 @@ export class UserApi implements UserApiInterface { * * @param body List of user object */ - public createUsersWithListInputWithHttpInfo(body?: Array, extraHttpRequestParams?: any): Observable { + public createUsersWithListInputWithHttpInfo(body: Array, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/user/createWithList'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); + } // to determine the Content-Type header let consumes: string[] = [ ]; // to determine the Accept header let produces: string[] = [ - 'application/json', - 'application/xml' + 'application/xml', + 'application/json' ]; headers.set('Content-Type', 'application/json'); @@ -304,8 +316,8 @@ export class UserApi implements UserApiInterface { // to determine the Accept header let produces: string[] = [ - 'application/json', - 'application/xml' + 'application/xml', + 'application/json' ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ @@ -343,8 +355,8 @@ export class UserApi implements UserApiInterface { // to determine the Accept header let produces: string[] = [ - 'application/json', - 'application/xml' + 'application/xml', + 'application/json' ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ @@ -367,11 +379,19 @@ export class UserApi implements UserApiInterface { * @param username The user name for login * @param password The password for login in clear text */ - public loginUserWithHttpInfo(username?: string, password?: string, extraHttpRequestParams?: any): Observable { + public loginUserWithHttpInfo(username: string, password: string, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/user/login'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 + // verify required parameter 'username' is not null or undefined + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling loginUser.'); + } + // verify required parameter 'password' is not null or undefined + if (password === null || password === undefined) { + throw new Error('Required parameter password was null or undefined when calling loginUser.'); + } if (username !== undefined) { queryParameters.set('username', username); } @@ -386,8 +406,8 @@ export class UserApi implements UserApiInterface { // to determine the Accept header let produces: string[] = [ - 'application/json', - 'application/xml' + 'application/xml', + 'application/json' ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ @@ -419,8 +439,8 @@ export class UserApi implements UserApiInterface { // to determine the Accept header let produces: string[] = [ - 'application/json', - 'application/xml' + 'application/xml', + 'application/json' ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ @@ -443,7 +463,7 @@ export class UserApi implements UserApiInterface { * @param username name that need to be deleted * @param body Updated user object */ - public updateUserWithHttpInfo(username: string, body?: models.User, extraHttpRequestParams?: any): Observable { + public updateUserWithHttpInfo(username: string, body: models.User, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/user/${username}' .replace('${' + 'username' + '}', String(username)); @@ -453,14 +473,18 @@ export class UserApi implements UserApiInterface { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling updateUser.'); } + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling updateUser.'); + } // to determine the Content-Type header let consumes: string[] = [ ]; // to determine the Accept header let produces: string[] = [ - 'application/json', - 'application/xml' + 'application/xml', + 'application/json' ]; headers.set('Content-Type', 'application/json'); diff --git a/samples/client/petstore/typescript-angular2/with-interfaces/api/UserApiInterface.ts b/samples/client/petstore/typescript-angular2/with-interfaces/api/UserApiInterface.ts index c882866c1c18..067befa18e7f 100644 --- a/samples/client/petstore/typescript-angular2/with-interfaces/api/UserApiInterface.ts +++ b/samples/client/petstore/typescript-angular2/with-interfaces/api/UserApiInterface.ts @@ -1,9 +1,9 @@ /** * Swagger Petstore - * This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@wordnik.com + * Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git @@ -28,21 +28,21 @@ export interface UserApiInterface { * This can only be done by the logged in user. * @param body Created user object */ - createUser(body?: models.User, extraHttpRequestParams?: any): Observable<{}>; + createUser(body: models.User, extraHttpRequestParams?: any): Observable<{}>; /** * Creates list of users with given input array * * @param body List of user object */ - createUsersWithArrayInput(body?: Array, extraHttpRequestParams?: any): Observable<{}>; + createUsersWithArrayInput(body: Array, extraHttpRequestParams?: any): Observable<{}>; /** * Creates list of users with given input array * * @param body List of user object */ - createUsersWithListInput(body?: Array, extraHttpRequestParams?: any): Observable<{}>; + createUsersWithListInput(body: Array, extraHttpRequestParams?: any): Observable<{}>; /** * Delete user @@ -64,7 +64,7 @@ export interface UserApiInterface { * @param username The user name for login * @param password The password for login in clear text */ - loginUser(username?: string, password?: string, extraHttpRequestParams?: any): Observable; + loginUser(username: string, password: string, extraHttpRequestParams?: any): Observable; /** * Logs out current logged in user session @@ -78,6 +78,6 @@ export interface UserApiInterface { * @param username name that need to be deleted * @param body Updated user object */ - updateUser(username: string, body?: models.User, extraHttpRequestParams?: any): Observable<{}>; + updateUser(username: string, body: models.User, extraHttpRequestParams?: any): Observable<{}>; } diff --git a/samples/client/petstore/typescript-angular2/with-interfaces/model/ApiResponse.ts b/samples/client/petstore/typescript-angular2/with-interfaces/model/ApiResponse.ts new file mode 100644 index 000000000000..f86e84f93a3a --- /dev/null +++ b/samples/client/petstore/typescript-angular2/with-interfaces/model/ApiResponse.ts @@ -0,0 +1,25 @@ +/** + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +import * as models from './models'; + +/** + * Describes the result of uploading an image resource + */ +export interface ApiResponse { + code?: number; + + type?: string; + + message?: string; + +} diff --git a/samples/client/petstore/typescript-angular2/with-interfaces/model/Category.ts b/samples/client/petstore/typescript-angular2/with-interfaces/model/Category.ts index ffdacd4f707d..254c3003c89a 100644 --- a/samples/client/petstore/typescript-angular2/with-interfaces/model/Category.ts +++ b/samples/client/petstore/typescript-angular2/with-interfaces/model/Category.ts @@ -1,9 +1,9 @@ /** * Swagger Petstore - * This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@wordnik.com + * Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git @@ -12,6 +12,9 @@ import * as models from './models'; +/** + * A category for a pet + */ export interface Category { id?: number; diff --git a/samples/client/petstore/typescript-angular2/with-interfaces/model/Order.ts b/samples/client/petstore/typescript-angular2/with-interfaces/model/Order.ts index 9c47071c5b67..2b6c7aeebd66 100644 --- a/samples/client/petstore/typescript-angular2/with-interfaces/model/Order.ts +++ b/samples/client/petstore/typescript-angular2/with-interfaces/model/Order.ts @@ -1,9 +1,9 @@ /** * Swagger Petstore - * This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@wordnik.com + * Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git @@ -12,6 +12,9 @@ import * as models from './models'; +/** + * An order for a pets from the pet store + */ export interface Order { id?: number; diff --git a/samples/client/petstore/typescript-angular2/with-interfaces/model/Pet.ts b/samples/client/petstore/typescript-angular2/with-interfaces/model/Pet.ts index d64dc809e532..b878cadb9058 100644 --- a/samples/client/petstore/typescript-angular2/with-interfaces/model/Pet.ts +++ b/samples/client/petstore/typescript-angular2/with-interfaces/model/Pet.ts @@ -1,9 +1,9 @@ /** * Swagger Petstore - * This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@wordnik.com + * Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git @@ -12,6 +12,9 @@ import * as models from './models'; +/** + * A pet for sale in the pet store + */ export interface Pet { id?: number; diff --git a/samples/client/petstore/typescript-angular2/with-interfaces/model/Tag.ts b/samples/client/petstore/typescript-angular2/with-interfaces/model/Tag.ts index 8a3b99ae9ca4..8cbdc4fa145e 100644 --- a/samples/client/petstore/typescript-angular2/with-interfaces/model/Tag.ts +++ b/samples/client/petstore/typescript-angular2/with-interfaces/model/Tag.ts @@ -1,9 +1,9 @@ /** * Swagger Petstore - * This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@wordnik.com + * Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git @@ -12,6 +12,9 @@ import * as models from './models'; +/** + * A tag for a pet + */ export interface Tag { id?: number; diff --git a/samples/client/petstore/typescript-angular2/with-interfaces/model/User.ts b/samples/client/petstore/typescript-angular2/with-interfaces/model/User.ts index 43d00f7b318e..fbf75dfe28e3 100644 --- a/samples/client/petstore/typescript-angular2/with-interfaces/model/User.ts +++ b/samples/client/petstore/typescript-angular2/with-interfaces/model/User.ts @@ -1,9 +1,9 @@ /** * Swagger Petstore - * This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@wordnik.com + * Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git @@ -12,6 +12,9 @@ import * as models from './models'; +/** + * A User who is purchasing from the pet store + */ export interface User { id?: number; diff --git a/samples/client/petstore/typescript-angular2/with-interfaces/model/models.ts b/samples/client/petstore/typescript-angular2/with-interfaces/model/models.ts index 92dac02846c2..f53c1dd42bdd 100644 --- a/samples/client/petstore/typescript-angular2/with-interfaces/model/models.ts +++ b/samples/client/petstore/typescript-angular2/with-interfaces/model/models.ts @@ -1,3 +1,4 @@ +export * from './ApiResponse'; export * from './Category'; export * from './Order'; export * from './Pet'; From e50a4cca361073dd3ccfcc4dec763227c6caddd6 Mon Sep 17 00:00:00 2001 From: wing328 Date: Sun, 2 Jul 2017 22:39:18 +0800 Subject: [PATCH 7/7] update ts angular2 petstore --- .../typescript-angular2/default/api/PetApi.ts | 18 +++++++++--------- .../default/api/StoreApi.ts | 6 +++--- .../typescript-angular2/default/api/UserApi.ts | 16 ++++++++-------- .../typescript-angular2/npm/api/PetApi.ts | 18 +++++++++--------- .../typescript-angular2/npm/api/StoreApi.ts | 6 +++--- .../typescript-angular2/npm/api/UserApi.ts | 16 ++++++++-------- .../with-interfaces/api/PetApi.ts | 18 +++++++++--------- .../with-interfaces/api/StoreApi.ts | 6 +++--- .../with-interfaces/api/UserApi.ts | 16 ++++++++-------- 9 files changed, 60 insertions(+), 60 deletions(-) diff --git a/samples/client/petstore/typescript-angular2/default/api/PetApi.ts b/samples/client/petstore/typescript-angular2/default/api/PetApi.ts index 0587fede3659..e5238eda30d3 100644 --- a/samples/client/petstore/typescript-angular2/default/api/PetApi.ts +++ b/samples/client/petstore/typescript-angular2/default/api/PetApi.ts @@ -191,13 +191,13 @@ export class PetApi { } // to determine the Content-Type header let consumes: string[] = [ - 'application/json', + 'application/json', 'application/xml' ]; // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -253,7 +253,7 @@ export class PetApi { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -304,7 +304,7 @@ export class PetApi { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -355,7 +355,7 @@ export class PetApi { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -403,7 +403,7 @@ export class PetApi { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -442,13 +442,13 @@ export class PetApi { } // to determine the Content-Type header let consumes: string[] = [ - 'application/json', + 'application/json', 'application/xml' ]; // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -504,7 +504,7 @@ export class PetApi { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; diff --git a/samples/client/petstore/typescript-angular2/default/api/StoreApi.ts b/samples/client/petstore/typescript-angular2/default/api/StoreApi.ts index a0847d7049ac..a4257efc4404 100644 --- a/samples/client/petstore/typescript-angular2/default/api/StoreApi.ts +++ b/samples/client/petstore/typescript-angular2/default/api/StoreApi.ts @@ -126,7 +126,7 @@ export class StoreApi { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -202,7 +202,7 @@ export class StoreApi { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -240,7 +240,7 @@ export class StoreApi { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; diff --git a/samples/client/petstore/typescript-angular2/default/api/UserApi.ts b/samples/client/petstore/typescript-angular2/default/api/UserApi.ts index f56801564420..681d58494244 100644 --- a/samples/client/petstore/typescript-angular2/default/api/UserApi.ts +++ b/samples/client/petstore/typescript-angular2/default/api/UserApi.ts @@ -191,7 +191,7 @@ export class UserApi { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -232,7 +232,7 @@ export class UserApi { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -273,7 +273,7 @@ export class UserApi { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -315,7 +315,7 @@ export class UserApi { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -354,7 +354,7 @@ export class UserApi { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -405,7 +405,7 @@ export class UserApi { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -438,7 +438,7 @@ export class UserApi { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -482,7 +482,7 @@ export class UserApi { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; diff --git a/samples/client/petstore/typescript-angular2/npm/api/PetApi.ts b/samples/client/petstore/typescript-angular2/npm/api/PetApi.ts index 0587fede3659..e5238eda30d3 100644 --- a/samples/client/petstore/typescript-angular2/npm/api/PetApi.ts +++ b/samples/client/petstore/typescript-angular2/npm/api/PetApi.ts @@ -191,13 +191,13 @@ export class PetApi { } // to determine the Content-Type header let consumes: string[] = [ - 'application/json', + 'application/json', 'application/xml' ]; // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -253,7 +253,7 @@ export class PetApi { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -304,7 +304,7 @@ export class PetApi { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -355,7 +355,7 @@ export class PetApi { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -403,7 +403,7 @@ export class PetApi { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -442,13 +442,13 @@ export class PetApi { } // to determine the Content-Type header let consumes: string[] = [ - 'application/json', + 'application/json', 'application/xml' ]; // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -504,7 +504,7 @@ export class PetApi { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; diff --git a/samples/client/petstore/typescript-angular2/npm/api/StoreApi.ts b/samples/client/petstore/typescript-angular2/npm/api/StoreApi.ts index a0847d7049ac..a4257efc4404 100644 --- a/samples/client/petstore/typescript-angular2/npm/api/StoreApi.ts +++ b/samples/client/petstore/typescript-angular2/npm/api/StoreApi.ts @@ -126,7 +126,7 @@ export class StoreApi { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -202,7 +202,7 @@ export class StoreApi { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -240,7 +240,7 @@ export class StoreApi { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; diff --git a/samples/client/petstore/typescript-angular2/npm/api/UserApi.ts b/samples/client/petstore/typescript-angular2/npm/api/UserApi.ts index f56801564420..681d58494244 100644 --- a/samples/client/petstore/typescript-angular2/npm/api/UserApi.ts +++ b/samples/client/petstore/typescript-angular2/npm/api/UserApi.ts @@ -191,7 +191,7 @@ export class UserApi { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -232,7 +232,7 @@ export class UserApi { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -273,7 +273,7 @@ export class UserApi { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -315,7 +315,7 @@ export class UserApi { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -354,7 +354,7 @@ export class UserApi { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -405,7 +405,7 @@ export class UserApi { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -438,7 +438,7 @@ export class UserApi { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -482,7 +482,7 @@ export class UserApi { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; 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 5cb93a2d9873..a87a3ba3edb4 100644 --- a/samples/client/petstore/typescript-angular2/with-interfaces/api/PetApi.ts +++ b/samples/client/petstore/typescript-angular2/with-interfaces/api/PetApi.ts @@ -192,13 +192,13 @@ export class PetApi implements PetApiInterface { } // to determine the Content-Type header let consumes: string[] = [ - 'application/json', + 'application/json', 'application/xml' ]; // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -254,7 +254,7 @@ export class PetApi implements PetApiInterface { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -305,7 +305,7 @@ export class PetApi implements PetApiInterface { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -356,7 +356,7 @@ export class PetApi implements PetApiInterface { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -404,7 +404,7 @@ export class PetApi implements PetApiInterface { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -443,13 +443,13 @@ export class PetApi implements PetApiInterface { } // to determine the Content-Type header let consumes: string[] = [ - 'application/json', + 'application/json', 'application/xml' ]; // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -505,7 +505,7 @@ export class PetApi implements PetApiInterface { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; 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 a9e78e0bc41f..4de8fdc315a0 100644 --- a/samples/client/petstore/typescript-angular2/with-interfaces/api/StoreApi.ts +++ b/samples/client/petstore/typescript-angular2/with-interfaces/api/StoreApi.ts @@ -127,7 +127,7 @@ export class StoreApi implements StoreApiInterface { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -203,7 +203,7 @@ export class StoreApi implements StoreApiInterface { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -241,7 +241,7 @@ export class StoreApi implements StoreApiInterface { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; 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 d8d426fd7d19..318c7ba60943 100644 --- a/samples/client/petstore/typescript-angular2/with-interfaces/api/UserApi.ts +++ b/samples/client/petstore/typescript-angular2/with-interfaces/api/UserApi.ts @@ -192,7 +192,7 @@ export class UserApi implements UserApiInterface { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -233,7 +233,7 @@ export class UserApi implements UserApiInterface { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -274,7 +274,7 @@ export class UserApi implements UserApiInterface { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -316,7 +316,7 @@ export class UserApi implements UserApiInterface { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -355,7 +355,7 @@ export class UserApi implements UserApiInterface { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -406,7 +406,7 @@ export class UserApi implements UserApiInterface { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -439,7 +439,7 @@ export class UserApi implements UserApiInterface { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ]; @@ -483,7 +483,7 @@ export class UserApi implements UserApiInterface { // to determine the Accept header let produces: string[] = [ - 'application/xml', + 'application/xml', 'application/json' ];