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 1e3cc438126..61a88955700 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 @@ -3309,7 +3309,8 @@ public class DefaultCodegen { parameter.isPrimitiveType = true; } else if (Boolean.TRUE.equals(property.isFile)) { parameter.isFile = true; - parameter.isPrimitiveType = true; + // file is *not* a primitive type + //parameter.isPrimitiveType = true; } else if (Boolean.TRUE.equals(property.isDate)) { parameter.isDate = true; parameter.isPrimitiveType = true; diff --git a/samples/client/petstore/php/SwaggerClient-php/README.md b/samples/client/petstore/php/SwaggerClient-php/README.md index 068d01c9b10..a8d469f5c02 100644 --- a/samples/client/petstore/php/SwaggerClient-php/README.md +++ b/samples/client/petstore/php/SwaggerClient-php/README.md @@ -4,7 +4,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, mod This PHP package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - API version: 1.0.0 -- Build package: class io.swagger.codegen.languages.PhpClientCodegen +- Build package: io.swagger.codegen.languages.PhpClientCodegen ## Requirements diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/Api/FakeApi.md b/samples/client/petstore/php/SwaggerClient-php/docs/Api/FakeApi.md index 2ab4c088caa..714b23996e6 100644 --- a/samples/client/petstore/php/SwaggerClient-php/docs/Api/FakeApi.md +++ b/samples/client/petstore/php/SwaggerClient-php/docs/Api/FakeApi.md @@ -14,6 +14,8 @@ Method | HTTP request | Description To test \"client\" model +To test \"client\" model + ### Example ```php 100.0)) { - throw new \InvalidArgumentException('invalid value for "$integer" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 100.0.'); + if (!is_null($integer) && ($integer > 100)) { + throw new \InvalidArgumentException('invalid value for "$integer" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 100.'); } - if (!is_null($integer) && ($integer < 10.0)) { - throw new \InvalidArgumentException('invalid value for "$integer" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 10.0.'); + if (!is_null($integer) && ($integer < 10)) { + throw new \InvalidArgumentException('invalid value for "$integer" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 10.'); } - if (!is_null($int32) && ($int32 > 200.0)) { - throw new \InvalidArgumentException('invalid value for "$int32" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 200.0.'); + if (!is_null($int32) && ($int32 > 200)) { + throw new \InvalidArgumentException('invalid value for "$int32" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 200.'); } - if (!is_null($int32) && ($int32 < 20.0)) { - throw new \InvalidArgumentException('invalid value for "$int32" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 20.0.'); + if (!is_null($int32) && ($int32 < 20)) { + throw new \InvalidArgumentException('invalid value for "$int32" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 20.'); } if (!is_null($float) && ($float > 987.6)) { @@ -399,7 +399,7 @@ class FakeApi * @param string $enum_header_string Header parameter enum test (string) (optional, default to -efg) * @param string[] $enum_query_string_array Query parameter enum test (string array) (optional) * @param string $enum_query_string Query parameter enum test (string) (optional, default to -efg) - * @param float $enum_query_integer Query parameter enum test (double) (optional) + * @param int $enum_query_integer Query parameter enum test (double) (optional) * @param double $enum_query_double Query parameter enum test (double) (optional) * @throws \Swagger\Client\ApiException on non-2xx response * @return void @@ -421,7 +421,7 @@ class FakeApi * @param string $enum_header_string Header parameter enum test (string) (optional, default to -efg) * @param string[] $enum_query_string_array Query parameter enum test (string array) (optional) * @param string $enum_query_string Query parameter enum test (string) (optional, default to -efg) - * @param float $enum_query_integer Query parameter enum test (double) (optional) + * @param int $enum_query_integer Query parameter enum test (double) (optional) * @param double $enum_query_double Query parameter enum test (double) (optional) * @throws \Swagger\Client\ApiException on non-2xx response * @return array of null, HTTP status code, HTTP response headers (array of strings) diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php index 945b9b3fb1f..7070313661d 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php @@ -279,11 +279,11 @@ class StoreApi if ($order_id === null) { throw new \InvalidArgumentException('Missing the required parameter $order_id when calling getOrderById'); } - if (($order_id > 5.0)) { - throw new \InvalidArgumentException('invalid value for "$order_id" when calling StoreApi.getOrderById, must be smaller than or equal to 5.0.'); + if (($order_id > 5)) { + throw new \InvalidArgumentException('invalid value for "$order_id" when calling StoreApi.getOrderById, must be smaller than or equal to 5.'); } - if (($order_id < 1.0)) { - throw new \InvalidArgumentException('invalid value for "$order_id" when calling StoreApi.getOrderById, must be bigger than or equal to 1.0.'); + if (($order_id < 1)) { + throw new \InvalidArgumentException('invalid value for "$order_id" when calling StoreApi.getOrderById, must be bigger than or equal to 1.'); } // parse inputs diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/FormatTest.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/FormatTest.php index 524904f2af7..29fc74a86eb 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/FormatTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/FormatTest.php @@ -191,20 +191,20 @@ class FormatTest implements ArrayAccess public function listInvalidProperties() { $invalid_properties = []; - if (!is_null($this->container['integer']) && ($this->container['integer'] > 100.0)) { - $invalid_properties[] = "invalid value for 'integer', must be smaller than or equal to 100.0."; + if (!is_null($this->container['integer']) && ($this->container['integer'] > 100)) { + $invalid_properties[] = "invalid value for 'integer', must be smaller than or equal to 100."; } - if (!is_null($this->container['integer']) && ($this->container['integer'] < 10.0)) { - $invalid_properties[] = "invalid value for 'integer', must be bigger than or equal to 10.0."; + if (!is_null($this->container['integer']) && ($this->container['integer'] < 10)) { + $invalid_properties[] = "invalid value for 'integer', must be bigger than or equal to 10."; } - if (!is_null($this->container['int32']) && ($this->container['int32'] > 200.0)) { - $invalid_properties[] = "invalid value for 'int32', must be smaller than or equal to 200.0."; + if (!is_null($this->container['int32']) && ($this->container['int32'] > 200)) { + $invalid_properties[] = "invalid value for 'int32', must be smaller than or equal to 200."; } - if (!is_null($this->container['int32']) && ($this->container['int32'] < 20.0)) { - $invalid_properties[] = "invalid value for 'int32', must be bigger than or equal to 20.0."; + if (!is_null($this->container['int32']) && ($this->container['int32'] < 20)) { + $invalid_properties[] = "invalid value for 'int32', must be bigger than or equal to 20."; } if ($this->container['number'] === null) { @@ -266,16 +266,16 @@ class FormatTest implements ArrayAccess */ public function valid() { - if ($this->container['integer'] > 100.0) { + if ($this->container['integer'] > 100) { return false; } - if ($this->container['integer'] < 10.0) { + if ($this->container['integer'] < 10) { return false; } - if ($this->container['int32'] > 200.0) { + if ($this->container['int32'] > 200) { return false; } - if ($this->container['int32'] < 20.0) { + if ($this->container['int32'] < 20) { return false; } if ($this->container['number'] === null) { @@ -338,11 +338,11 @@ class FormatTest implements ArrayAccess public function setInteger($integer) { - if (!is_null($integer) && ($integer > 100.0)) { - throw new \InvalidArgumentException('invalid value for $integer when calling FormatTest., must be smaller than or equal to 100.0.'); + if (!is_null($integer) && ($integer > 100)) { + throw new \InvalidArgumentException('invalid value for $integer when calling FormatTest., must be smaller than or equal to 100.'); } - if (!is_null($integer) && ($integer < 10.0)) { - throw new \InvalidArgumentException('invalid value for $integer when calling FormatTest., must be bigger than or equal to 10.0.'); + if (!is_null($integer) && ($integer < 10)) { + throw new \InvalidArgumentException('invalid value for $integer when calling FormatTest., must be bigger than or equal to 10.'); } $this->container['integer'] = $integer; @@ -367,11 +367,11 @@ class FormatTest implements ArrayAccess public function setInt32($int32) { - if (!is_null($int32) && ($int32 > 200.0)) { - throw new \InvalidArgumentException('invalid value for $int32 when calling FormatTest., must be smaller than or equal to 200.0.'); + if (!is_null($int32) && ($int32 > 200)) { + throw new \InvalidArgumentException('invalid value for $int32 when calling FormatTest., must be smaller than or equal to 200.'); } - if (!is_null($int32) && ($int32 < 20.0)) { - throw new \InvalidArgumentException('invalid value for $int32 when calling FormatTest., must be bigger than or equal to 20.0.'); + if (!is_null($int32) && ($int32 < 20)) { + throw new \InvalidArgumentException('invalid value for $int32 when calling FormatTest., must be bigger than or equal to 20.'); } $this->container['int32'] = $int32;