diff --git a/README.md b/README.md
index 4cc3194646fd..a53004522793 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/)| 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)
[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)
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/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java
index f500d72fc8fc..b5726b57ea74 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));
}
/**
@@ -3572,9 +3572,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/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/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/modules/swagger-codegen/src/test/resources/integrationtests/typescript/petstore-expected/api/user.service.ts b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/petstore-expected/api/user.service.ts
index 2246435f5a09..8c92494c894f 100644
--- a/modules/swagger-codegen/src/test/resources/integrationtests/typescript/petstore-expected/api/user.service.ts
+++ b/modules/swagger-codegen/src/test/resources/integrationtests/typescript/petstore-expected/api/user.service.ts
@@ -221,7 +221,7 @@ export class UserService {
// to determine the Accept header
let produces: string[] = [
- 'application/xml',
+ 'application/xml',
'application/json'
];
@@ -267,7 +267,7 @@ export class UserService {
// to determine the Accept header
let produces: string[] = [
- 'application/xml',
+ 'application/xml',
'application/json'
];
@@ -313,7 +313,7 @@ export class UserService {
// to determine the Accept header
let produces: string[] = [
- 'application/xml',
+ 'application/xml',
'application/json'
];
@@ -359,7 +359,7 @@ export class UserService {
// to determine the Accept header
let produces: string[] = [
- 'application/xml',
+ 'application/xml',
'application/json'
];
@@ -403,7 +403,7 @@ export class UserService {
// to determine the Accept header
let produces: string[] = [
- 'application/xml',
+ 'application/xml',
'application/json'
];
@@ -458,7 +458,7 @@ export class UserService {
// to determine the Accept header
let produces: string[] = [
- 'application/xml',
+ 'application/xml',
'application/json'
];
@@ -497,7 +497,7 @@ export class UserService {
// to determine the Accept header
let produces: string[] = [
- 'application/xml',
+ 'application/xml',
'application/json'
];
@@ -546,7 +546,7 @@ export class UserService {
// to determine the Accept header
let produces: string[] = [
- 'application/xml',
+ 'application/xml',
'application/json'
];
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/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/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)
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'
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 e8f290f135db..0303ca70d3a5 100644
--- a/samples/client/petstore/typescript-angular2/default/api/pet.service.ts
+++ b/samples/client/petstore/typescript-angular2/default/api/pet.service.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
@@ -20,6 +20,7 @@ import { Response, ResponseContentType } from '@angular/http
import { Observable } from 'rxjs/Observable';
import '../rxjs-operators';
+import { ApiResponse } from '../model/apiResponse';
import { Pet } from '../model/pet';
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
@@ -77,7 +78,7 @@ export class PetService {
*
* @param body Pet object that needs to be added to the store
*/
- public addPet(body?: Pet, extraHttpRequestParams?: any): Observable<{}> {
+ public addPet(body: Pet, extraHttpRequestParams?: any): Observable<{}> {
return this.addPetWithHttpInfo(body, extraHttpRequestParams)
.map((response: Response) => {
if (response.status === 204) {
@@ -110,7 +111,7 @@ export class PetService {
* 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) {
@@ -126,7 +127,7 @@ export class PetService {
* 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) {
@@ -139,8 +140,8 @@ export class PetService {
/**
* 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)
@@ -158,7 +159,7 @@ export class PetService {
*
* @param body Pet object that needs to be added to the store
*/
- public updatePet(body?: Pet, extraHttpRequestParams?: any): Observable<{}> {
+ public updatePet(body: Pet, extraHttpRequestParams?: any): Observable<{}> {
return this.updatePetWithHttpInfo(body, extraHttpRequestParams)
.map((response: Response) => {
if (response.status === 204) {
@@ -176,7 +177,7 @@ export class PetService {
* @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) {
@@ -194,7 +195,7 @@ export class PetService {
* @param additionalMetadata Additional data to pass to server
* @param file file to upload
*/
- public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, extraHttpRequestParams?: any): Observable<{}> {
+ public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, extraHttpRequestParams?: any): Observable {
return this.uploadFileWithHttpInfo(petId, additionalMetadata, file, extraHttpRequestParams)
.map((response: Response) => {
if (response.status === 204) {
@@ -211,17 +212,21 @@ export class PetService {
*
* @param body Pet object that needs to be added to the store
*/
- public addPetWithHttpInfo(body?: Pet, extraHttpRequestParams?: any): Observable {
+ public addPetWithHttpInfo(body: 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 Accept header
let produces: string[] = [
- 'application/json',
- 'application/xml'
+ 'application/xml',
+ 'application/json'
];
// authentication (petstore_auth) required
@@ -275,8 +280,8 @@ export class PetService {
// to determine the Accept header
let produces: string[] = [
- 'application/json',
- 'application/xml'
+ 'application/xml',
+ 'application/json'
];
// authentication (petstore_auth) required
@@ -308,23 +313,25 @@ export class PetService {
* 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 Accept header
let produces: string[] = [
- 'application/json',
- 'application/xml'
+ 'application/xml',
+ 'application/json'
];
// authentication (petstore_auth) required
@@ -356,23 +363,25 @@ export class PetService {
* 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 Accept header
let produces: string[] = [
- 'application/json',
- 'application/xml'
+ 'application/xml',
+ 'application/json'
];
// authentication (petstore_auth) required
@@ -401,8 +410,8 @@ export class PetService {
/**
* 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}'
@@ -418,8 +427,8 @@ export class PetService {
// to determine the Accept header
let produces: string[] = [
- 'application/json',
- 'application/xml'
+ 'application/xml',
+ 'application/json'
];
// authentication (api_key) required
@@ -427,15 +436,6 @@ export class PetService {
headers.set('api_key', this.configuration.apiKeys["api_key"]);
}
- // 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,
@@ -456,17 +456,21 @@ export class PetService {
*
* @param body Pet object that needs to be added to the store
*/
- public updatePetWithHttpInfo(body?: Pet, extraHttpRequestParams?: any): Observable {
+ public updatePetWithHttpInfo(body: 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 Accept header
let produces: string[] = [
- 'application/json',
- 'application/xml'
+ 'application/xml',
+ 'application/json'
];
// authentication (petstore_auth) required
@@ -503,7 +507,7 @@ export class PetService {
* @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));
@@ -526,8 +530,8 @@ export class PetService {
// to determine the Accept header
let produces: string[] = [
- 'application/json',
- 'application/xml'
+ 'application/xml',
+ 'application/json'
];
// authentication (petstore_auth) required
@@ -594,8 +598,7 @@ export class PetService {
// 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/default/api/store.service.ts b/samples/client/petstore/typescript-angular2/default/api/store.service.ts
index 937130527af7..877c8df7e08a 100644
--- a/samples/client/petstore/typescript-angular2/default/api/store.service.ts
+++ b/samples/client/petstore/typescript-angular2/default/api/store.service.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
@@ -108,7 +108,7 @@ export class StoreService {
* 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) {
@@ -124,7 +124,7 @@ export class StoreService {
*
* @param body order placed for purchasing the pet
*/
- public placeOrder(body?: Order, extraHttpRequestParams?: any): Observable {
+ public placeOrder(body: Order, extraHttpRequestParams?: any): Observable {
return this.placeOrderWithHttpInfo(body, extraHttpRequestParams)
.map((response: Response) => {
if (response.status === 204) {
@@ -155,8 +155,8 @@ export class StoreService {
// to determine the Accept header
let produces: string[] = [
- 'application/json',
- 'application/xml'
+ 'application/xml',
+ 'application/json'
];
@@ -187,8 +187,7 @@ export class StoreService {
// to determine the Accept header
let produces: string[] = [
- 'application/json',
- 'application/xml'
+ 'application/json'
];
// authentication (api_key) required
@@ -216,7 +215,7 @@ export class StoreService {
* 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));
@@ -230,8 +229,8 @@ export class StoreService {
// to determine the Accept header
let produces: string[] = [
- 'application/json',
- 'application/xml'
+ 'application/xml',
+ 'application/json'
];
@@ -254,17 +253,21 @@ export class StoreService {
*
* @param body order placed for purchasing the pet
*/
- public placeOrderWithHttpInfo(body?: Order, extraHttpRequestParams?: any): Observable {
+ public placeOrderWithHttpInfo(body: 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 Accept header
let produces: string[] = [
- 'application/json',
- '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 a9d12993aff2..5a5761dcdd37 100644
--- a/samples/client/petstore/typescript-angular2/default/api/user.service.ts
+++ b/samples/client/petstore/typescript-angular2/default/api/user.service.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
@@ -77,7 +77,7 @@ export class UserService {
* This can only be done by the logged in user.
* @param body Created user object
*/
- public createUser(body?: User, extraHttpRequestParams?: any): Observable<{}> {
+ public createUser(body: User, extraHttpRequestParams?: any): Observable<{}> {
return this.createUserWithHttpInfo(body, extraHttpRequestParams)
.map((response: Response) => {
if (response.status === 204) {
@@ -93,7 +93,7 @@ export class UserService {
*
* @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) {
@@ -109,7 +109,7 @@ export class UserService {
*
* @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) {
@@ -158,7 +158,7 @@ export class UserService {
* @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) {
@@ -190,7 +190,7 @@ export class UserService {
* @param username name that need to be deleted
* @param body Updated user object
*/
- public updateUser(username: string, body?: User, extraHttpRequestParams?: any): Observable<{}> {
+ public updateUser(username: string, body: User, extraHttpRequestParams?: any): Observable<{}> {
return this.updateUserWithHttpInfo(username, body, extraHttpRequestParams)
.map((response: Response) => {
if (response.status === 204) {
@@ -207,17 +207,21 @@ export class UserService {
* This can only be done by the logged in user.
* @param body Created user object
*/
- public createUserWithHttpInfo(body?: User, extraHttpRequestParams?: any): Observable {
+ public createUserWithHttpInfo(body: 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 Accept header
let produces: string[] = [
- 'application/json',
- 'application/xml'
+ 'application/xml',
+ 'application/json'
];
@@ -243,17 +247,21 @@ export class UserService {
*
* @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 Accept header
let produces: string[] = [
- 'application/json',
- 'application/xml'
+ 'application/xml',
+ 'application/json'
];
@@ -279,17 +287,21 @@ export class UserService {
*
* @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 Accept header
let produces: string[] = [
- 'application/json',
- 'application/xml'
+ 'application/xml',
+ 'application/json'
];
@@ -329,8 +341,8 @@ export class UserService {
// to determine the Accept header
let produces: string[] = [
- 'application/json',
- 'application/xml'
+ 'application/xml',
+ 'application/json'
];
@@ -367,8 +379,8 @@ export class UserService {
// to determine the Accept header
let produces: string[] = [
- 'application/json',
- 'application/xml'
+ 'application/xml',
+ 'application/json'
];
@@ -392,12 +404,20 @@ export class UserService {
* @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);
}
@@ -409,8 +429,8 @@ export class UserService {
// to determine the Accept header
let produces: string[] = [
- 'application/json',
- 'application/xml'
+ 'application/xml',
+ 'application/json'
];
@@ -441,8 +461,8 @@ export class UserService {
// to determine the Accept header
let produces: string[] = [
- 'application/json',
- 'application/xml'
+ 'application/xml',
+ 'application/json'
];
@@ -466,7 +486,7 @@ export class UserService {
* @param username name that need to be deleted
* @param body Updated user object
*/
- public updateUserWithHttpInfo(username: string, body?: User, extraHttpRequestParams?: any): Observable {
+ public updateUserWithHttpInfo(username: string, body: User, extraHttpRequestParams?: any): Observable {
const path = this.basePath + '/user/${username}'
.replace('${' + 'username' + '}', String(username));
@@ -477,11 +497,15 @@ export class UserService {
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 Accept header
let produces: string[] = [
- 'application/json',
- 'application/xml'
+ 'application/xml',
+ 'application/json'
];
diff --git a/samples/client/petstore/typescript-angular2/default/model/category.ts b/samples/client/petstore/typescript-angular2/default/model/category.ts
index 202faef0d43c..d09f8d7b265f 100644
--- a/samples/client/petstore/typescript-angular2/default/model/category.ts
+++ b/samples/client/petstore/typescript-angular2/default/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 @@
+/**
+ * A category for a pet
+ */
export interface Category {
id?: number;
diff --git a/samples/client/petstore/typescript-angular2/default/model/models.ts b/samples/client/petstore/typescript-angular2/default/model/models.ts
index 1f152369d803..8607c5dabd0c 100644
--- a/samples/client/petstore/typescript-angular2/default/model/models.ts
+++ b/samples/client/petstore/typescript-angular2/default/model/models.ts
@@ -1,3 +1,4 @@
+export * from './apiResponse';
export * from './category';
export * from './order';
export * from './pet';
diff --git a/samples/client/petstore/typescript-angular2/default/model/order.ts b/samples/client/petstore/typescript-angular2/default/model/order.ts
index 7e2cb037074c..402a86689c82 100644
--- a/samples/client/petstore/typescript-angular2/default/model/order.ts
+++ b/samples/client/petstore/typescript-angular2/default/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 @@
+/**
+ * An order for a pets from the pet store
+ */
export interface Order {
id?: number;
diff --git a/samples/client/petstore/typescript-angular2/default/model/pet.ts b/samples/client/petstore/typescript-angular2/default/model/pet.ts
index 7a429abf483c..0d6137d02cf2 100644
--- a/samples/client/petstore/typescript-angular2/default/model/pet.ts
+++ b/samples/client/petstore/typescript-angular2/default/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
@@ -14,6 +14,9 @@ import { Category } from './category';
import { Tag } from './tag';
+/**
+ * A pet for sale in the pet store
+ */
export interface Pet {
id?: number;
diff --git a/samples/client/petstore/typescript-angular2/default/model/tag.ts b/samples/client/petstore/typescript-angular2/default/model/tag.ts
index 56cbe04b7a38..3ed1eeff8f32 100644
--- a/samples/client/petstore/typescript-angular2/default/model/tag.ts
+++ b/samples/client/petstore/typescript-angular2/default/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 @@
+/**
+ * A tag for a pet
+ */
export interface Tag {
id?: number;
diff --git a/samples/client/petstore/typescript-angular2/default/model/user.ts b/samples/client/petstore/typescript-angular2/default/model/user.ts
index 202adb58c73c..f4914ae26080 100644
--- a/samples/client/petstore/typescript-angular2/default/model/user.ts
+++ b/samples/client/petstore/typescript-angular2/default/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 @@
+/**
+ * A User who is purchasing from the pet store
+ */
export interface User {
id?: number;
diff --git a/samples/client/petstore/typescript-angular2/default/variables.ts b/samples/client/petstore/typescript-angular2/default/variables.ts
index 7ef7e51c24f2..6fe58549f395 100644
--- a/samples/client/petstore/typescript-angular2/default/variables.ts
+++ b/samples/client/petstore/typescript-angular2/default/variables.ts
@@ -6,4 +6,4 @@ export const COLLECTION_FORMATS = {
'tsv': ' ',
'ssv': ' ',
'pipes': '|'
-}
\ No newline at end of file
+}
diff --git a/samples/client/petstore/typescript-angular2/npm/variables.ts b/samples/client/petstore/typescript-angular2/npm/variables.ts
index d06561e7dac2..6fe58549f395 100644
--- a/samples/client/petstore/typescript-angular2/npm/variables.ts
+++ b/samples/client/petstore/typescript-angular2/npm/variables.ts
@@ -1,4 +1,4 @@
-import { InjectionToken } from '@angular/core';
+import { InjectionToken } from '@angular/core';
export const BASE_PATH = new InjectionToken('basePath');
export const COLLECTION_FORMATS = {
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..a87a3ba3edb4 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,21 +181,25 @@ 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',
+ 'application/json',
'application/xml'
];
// 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,21 +432,25 @@ 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',
+ 'application/json',
'application/xml'
];
// 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..4de8fdc315a0 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..318c7ba60943 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/api/pet.service.ts b/samples/client/petstore/typescript-angular2/with-interfaces/api/pet.service.ts
index 5bc5d2aa437e..5198ead65e09 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
@@ -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
@@ -20,6 +20,7 @@ import { Response, ResponseContentType } from '@angular/http
import { Observable } from 'rxjs/Observable';
import '../rxjs-operators';
+import { ApiResponse } from '../model/apiResponse';
import { Pet } from '../model/pet';
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
@@ -78,7 +79,7 @@ export class PetService implements PetServiceInterface {
*
* @param body Pet object that needs to be added to the store
*/
- public addPet(body?: Pet, extraHttpRequestParams?: any): Observable<{}> {
+ public addPet(body: Pet, extraHttpRequestParams?: any): Observable<{}> {
return this.addPetWithHttpInfo(body, extraHttpRequestParams)
.map((response: Response) => {
if (response.status === 204) {
@@ -111,7 +112,7 @@ export class PetService implements PetServiceInterface {
* 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) {
@@ -127,7 +128,7 @@ export class PetService implements PetServiceInterface {
* 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) {
@@ -140,8 +141,8 @@ export class PetService implements PetServiceInterface {
/**
* 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)
@@ -159,7 +160,7 @@ export class PetService implements PetServiceInterface {
*
* @param body Pet object that needs to be added to the store
*/
- public updatePet(body?: Pet, extraHttpRequestParams?: any): Observable<{}> {
+ public updatePet(body: Pet, extraHttpRequestParams?: any): Observable<{}> {
return this.updatePetWithHttpInfo(body, extraHttpRequestParams)
.map((response: Response) => {
if (response.status === 204) {
@@ -177,7 +178,7 @@ export class PetService implements PetServiceInterface {
* @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) {
@@ -195,7 +196,7 @@ export class PetService implements PetServiceInterface {
* @param additionalMetadata Additional data to pass to server
* @param file file to upload
*/
- public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, extraHttpRequestParams?: any): Observable<{}> {
+ public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, extraHttpRequestParams?: any): Observable {
return this.uploadFileWithHttpInfo(petId, additionalMetadata, file, extraHttpRequestParams)
.map((response: Response) => {
if (response.status === 204) {
@@ -212,17 +213,21 @@ export class PetService implements PetServiceInterface {
*
* @param body Pet object that needs to be added to the store
*/
- public addPetWithHttpInfo(body?: Pet, extraHttpRequestParams?: any): Observable {
+ public addPetWithHttpInfo(body: 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 Accept header
let produces: string[] = [
- 'application/json',
- 'application/xml'
+ 'application/xml',
+ 'application/json'
];
// authentication (petstore_auth) required
@@ -276,8 +281,8 @@ export class PetService implements PetServiceInterface {
// to determine the Accept header
let produces: string[] = [
- 'application/json',
- 'application/xml'
+ 'application/xml',
+ 'application/json'
];
// authentication (petstore_auth) required
@@ -309,23 +314,25 @@ export class PetService implements PetServiceInterface {
* 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 Accept header
let produces: string[] = [
- 'application/json',
- 'application/xml'
+ 'application/xml',
+ 'application/json'
];
// authentication (petstore_auth) required
@@ -357,23 +364,25 @@ export class PetService implements PetServiceInterface {
* 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 Accept header
let produces: string[] = [
- 'application/json',
- 'application/xml'
+ 'application/xml',
+ 'application/json'
];
// authentication (petstore_auth) required
@@ -402,8 +411,8 @@ export class PetService implements PetServiceInterface {
/**
* 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}'
@@ -419,8 +428,8 @@ export class PetService implements PetServiceInterface {
// to determine the Accept header
let produces: string[] = [
- 'application/json',
- 'application/xml'
+ 'application/xml',
+ 'application/json'
];
// authentication (api_key) required
@@ -428,15 +437,6 @@ export class PetService implements PetServiceInterface {
headers.set('api_key', this.configuration.apiKeys["api_key"]);
}
- // 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,
@@ -457,17 +457,21 @@ export class PetService implements PetServiceInterface {
*
* @param body Pet object that needs to be added to the store
*/
- public updatePetWithHttpInfo(body?: Pet, extraHttpRequestParams?: any): Observable {
+ public updatePetWithHttpInfo(body: 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 Accept header
let produces: string[] = [
- 'application/json',
- 'application/xml'
+ 'application/xml',
+ 'application/json'
];
// authentication (petstore_auth) required
@@ -504,7 +508,7 @@ export class PetService implements PetServiceInterface {
* @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));
@@ -527,8 +531,8 @@ export class PetService implements PetServiceInterface {
// to determine the Accept header
let produces: string[] = [
- 'application/json',
- 'application/xml'
+ 'application/xml',
+ 'application/json'
];
// authentication (petstore_auth) required
@@ -595,8 +599,7 @@ export class PetService implements PetServiceInterface {
// 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/pet.serviceInterface.ts b/samples/client/petstore/typescript-angular2/with-interfaces/api/pet.serviceInterface.ts
index 6aa9ddfd5ee4..5ee39b3ab696 100644
--- a/samples/client/petstore/typescript-angular2/with-interfaces/api/pet.serviceInterface.ts
+++ b/samples/client/petstore/typescript-angular2/with-interfaces/api/pet.serviceInterface.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 PetServiceInterface {
*
* @param body Pet object that needs to be added to the store
*/
- addPet(body?: Pet, extraHttpRequestParams?: any): Observable<{}>;
+ addPet(body: Pet, extraHttpRequestParams?: any): Observable<{}>;
/**
* Deletes a pet
@@ -43,19 +43,19 @@ export interface PetServiceInterface {
* 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 PetServiceInterface {
*
* @param body Pet object that needs to be added to the store
*/
- updatePet(body?: Pet, extraHttpRequestParams?: any): Observable<{}>;
+ updatePet(body: Pet, extraHttpRequestParams?: any): Observable<{}>;
/**
* Updates a pet in the store with form data
@@ -73,7 +73,7 @@ export interface PetServiceInterface {
* @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 PetServiceInterface {
* @param additionalMetadata Additional data to pass to server
* @param file file to upload
*/
- uploadFile(petId: number, additionalMetadata?: string, file?: Blob, extraHttpRequestParams?: any): Observable<{}>;
+ uploadFile(petId: number, additionalMetadata?: string, file?: Blob, extraHttpRequestParams?: any): Observable;
}
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 ba50bbc99974..811e2ea5574c 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
@@ -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
@@ -109,7 +109,7 @@ export class StoreService implements StoreServiceInterface {
* 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) {
@@ -125,7 +125,7 @@ export class StoreService implements StoreServiceInterface {
*
* @param body order placed for purchasing the pet
*/
- public placeOrder(body?: Order, extraHttpRequestParams?: any): Observable {
+ public placeOrder(body: Order, extraHttpRequestParams?: any): Observable {
return this.placeOrderWithHttpInfo(body, extraHttpRequestParams)
.map((response: Response) => {
if (response.status === 204) {
@@ -156,8 +156,8 @@ export class StoreService implements StoreServiceInterface {
// to determine the Accept header
let produces: string[] = [
- 'application/json',
- 'application/xml'
+ 'application/xml',
+ 'application/json'
];
@@ -188,8 +188,7 @@ export class StoreService implements StoreServiceInterface {
// to determine the Accept header
let produces: string[] = [
- 'application/json',
- 'application/xml'
+ 'application/json'
];
// authentication (api_key) required
@@ -217,7 +216,7 @@ export class StoreService implements StoreServiceInterface {
* 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));
@@ -231,8 +230,8 @@ export class StoreService implements StoreServiceInterface {
// to determine the Accept header
let produces: string[] = [
- 'application/json',
- 'application/xml'
+ 'application/xml',
+ 'application/json'
];
@@ -255,17 +254,21 @@ export class StoreService implements StoreServiceInterface {
*
* @param body order placed for purchasing the pet
*/
- public placeOrderWithHttpInfo(body?: Order, extraHttpRequestParams?: any): Observable {
+ public placeOrderWithHttpInfo(body: 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 Accept header
let produces: string[] = [
- 'application/json',
- 'application/xml'
+ 'application/xml',
+ 'application/json'
];
diff --git a/samples/client/petstore/typescript-angular2/with-interfaces/api/store.serviceInterface.ts b/samples/client/petstore/typescript-angular2/with-interfaces/api/store.serviceInterface.ts
index e08c0dc354b9..a40dcc47b83d 100644
--- a/samples/client/petstore/typescript-angular2/with-interfaces/api/store.serviceInterface.ts
+++ b/samples/client/petstore/typescript-angular2/with-interfaces/api/store.serviceInterface.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 StoreServiceInterface {
* 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?: Order, extraHttpRequestParams?: any): Observable;
+ placeOrder(body: Order, extraHttpRequestParams?: any): Observable;
}
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 20f0c1338b25..03ab33592f63 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
@@ -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 UserService implements UserServiceInterface {
* This can only be done by the logged in user.
* @param body Created user object
*/
- public createUser(body?: User, extraHttpRequestParams?: any): Observable<{}> {
+ public createUser(body: User, extraHttpRequestParams?: any): Observable<{}> {
return this.createUserWithHttpInfo(body, extraHttpRequestParams)
.map((response: Response) => {
if (response.status === 204) {
@@ -94,7 +94,7 @@ export class UserService implements UserServiceInterface {
*
* @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) {
@@ -110,7 +110,7 @@ export class UserService implements UserServiceInterface {
*
* @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) {
@@ -159,7 +159,7 @@ export class UserService implements UserServiceInterface {
* @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) {
@@ -191,7 +191,7 @@ export class UserService implements UserServiceInterface {
* @param username name that need to be deleted
* @param body Updated user object
*/
- public updateUser(username: string, body?: User, extraHttpRequestParams?: any): Observable<{}> {
+ public updateUser(username: string, body: User, extraHttpRequestParams?: any): Observable<{}> {
return this.updateUserWithHttpInfo(username, body, extraHttpRequestParams)
.map((response: Response) => {
if (response.status === 204) {
@@ -208,17 +208,21 @@ export class UserService implements UserServiceInterface {
* This can only be done by the logged in user.
* @param body Created user object
*/
- public createUserWithHttpInfo(body?: User, extraHttpRequestParams?: any): Observable {
+ public createUserWithHttpInfo(body: 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 Accept header
let produces: string[] = [
- 'application/json',
- 'application/xml'
+ 'application/xml',
+ 'application/json'
];
@@ -244,17 +248,21 @@ export class UserService implements UserServiceInterface {
*
* @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 Accept header
let produces: string[] = [
- 'application/json',
- 'application/xml'
+ 'application/xml',
+ 'application/json'
];
@@ -280,17 +288,21 @@ export class UserService implements UserServiceInterface {
*
* @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 Accept header
let produces: string[] = [
- 'application/json',
- 'application/xml'
+ 'application/xml',
+ 'application/json'
];
@@ -330,8 +342,8 @@ export class UserService implements UserServiceInterface {
// to determine the Accept header
let produces: string[] = [
- 'application/json',
- 'application/xml'
+ 'application/xml',
+ 'application/json'
];
@@ -368,8 +380,8 @@ export class UserService implements UserServiceInterface {
// to determine the Accept header
let produces: string[] = [
- 'application/json',
- 'application/xml'
+ 'application/xml',
+ 'application/json'
];
@@ -393,12 +405,20 @@ export class UserService implements UserServiceInterface {
* @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);
}
@@ -410,8 +430,8 @@ export class UserService implements UserServiceInterface {
// to determine the Accept header
let produces: string[] = [
- 'application/json',
- 'application/xml'
+ 'application/xml',
+ 'application/json'
];
@@ -442,8 +462,8 @@ export class UserService implements UserServiceInterface {
// to determine the Accept header
let produces: string[] = [
- 'application/json',
- 'application/xml'
+ 'application/xml',
+ 'application/json'
];
@@ -467,7 +487,7 @@ export class UserService implements UserServiceInterface {
* @param username name that need to be deleted
* @param body Updated user object
*/
- public updateUserWithHttpInfo(username: string, body?: User, extraHttpRequestParams?: any): Observable {
+ public updateUserWithHttpInfo(username: string, body: User, extraHttpRequestParams?: any): Observable {
const path = this.basePath + '/user/${username}'
.replace('${' + 'username' + '}', String(username));
@@ -478,11 +498,15 @@ export class UserService implements UserServiceInterface {
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 Accept header
let produces: string[] = [
- 'application/json',
- 'application/xml'
+ 'application/xml',
+ 'application/json'
];
diff --git a/samples/client/petstore/typescript-angular2/with-interfaces/api/user.serviceInterface.ts b/samples/client/petstore/typescript-angular2/with-interfaces/api/user.serviceInterface.ts
index 8bce8ce30337..3cab3a9c64b7 100644
--- a/samples/client/petstore/typescript-angular2/with-interfaces/api/user.serviceInterface.ts
+++ b/samples/client/petstore/typescript-angular2/with-interfaces/api/user.serviceInterface.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 UserServiceInterface {
* This can only be done by the logged in user.
* @param body Created user object
*/
- createUser(body?: User, extraHttpRequestParams?: any): Observable<{}>;
+ createUser(body: 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 UserServiceInterface {
* @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 UserServiceInterface {
* @param username name that need to be deleted
* @param body Updated user object
*/
- updateUser(username: string, body?: User, extraHttpRequestParams?: any): Observable<{}>;
+ updateUser(username: string, body: 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..3af781cf5804
--- /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.
+ */
+
+
+
+/**
+ * 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 202faef0d43c..d09f8d7b265f 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 @@
+/**
+ * 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 7e2cb037074c..402a86689c82 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 @@
+/**
+ * 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 7a429abf483c..0d6137d02cf2 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
@@ -14,6 +14,9 @@ import { Category } from './category';
import { Tag } from './tag';
+/**
+ * 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 56cbe04b7a38..3ed1eeff8f32 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 @@
+/**
+ * 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 202adb58c73c..f4914ae26080 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 @@
+/**
+ * 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 1f152369d803..8607c5dabd0c 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';
diff --git a/samples/client/petstore/typescript-angular2/with-interfaces/variables.ts b/samples/client/petstore/typescript-angular2/with-interfaces/variables.ts
index d06561e7dac2..6fe58549f395 100644
--- a/samples/client/petstore/typescript-angular2/with-interfaces/variables.ts
+++ b/samples/client/petstore/typescript-angular2/with-interfaces/variables.ts
@@ -1,4 +1,4 @@
-import { InjectionToken } from '@angular/core';
+import { InjectionToken } from '@angular/core';
export const BASE_PATH = new InjectionToken('basePath');
export const COLLECTION_FORMATS = {
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", "");