forked from loafle/openapi-generator-original
Merge pull request #4421 from wing328/fix_isfile_boolean
Fix `isPrimitiveType` for file property
This commit is contained in:
commit
43ff85db76
@ -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;
|
||||
|
@ -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
|
||||
|
||||
|
@ -14,6 +14,8 @@ Method | HTTP request | Description
|
||||
|
||||
To test \"client\" model
|
||||
|
||||
To test \"client\" model
|
||||
|
||||
### Example
|
||||
```php
|
||||
<?php
|
||||
@ -131,6 +133,8 @@ void (empty response body)
|
||||
|
||||
To test enum parameters
|
||||
|
||||
To test enum parameters
|
||||
|
||||
### Example
|
||||
```php
|
||||
<?php
|
||||
@ -143,7 +147,7 @@ $enum_header_string_array = array("enum_header_string_array_example"); // string
|
||||
$enum_header_string = "-efg"; // string | Header parameter enum test (string)
|
||||
$enum_query_string_array = array("enum_query_string_array_example"); // string[] | Query parameter enum test (string array)
|
||||
$enum_query_string = "-efg"; // string | Query parameter enum test (string)
|
||||
$enum_query_integer = 3.4; // float | Query parameter enum test (double)
|
||||
$enum_query_integer = 56; // int | Query parameter enum test (double)
|
||||
$enum_query_double = 1.2; // double | Query parameter enum test (double)
|
||||
|
||||
try {
|
||||
@ -164,7 +168,7 @@ Name | Type | Description | Notes
|
||||
**enum_header_string** | **string**| Header parameter enum test (string) | [optional] [default to -efg]
|
||||
**enum_query_string_array** | [**string[]**](../Model/string.md)| Query parameter enum test (string array) | [optional]
|
||||
**enum_query_string** | **string**| Query parameter enum test (string) | [optional] [default to -efg]
|
||||
**enum_query_integer** | **float**| Query parameter enum test (double) | [optional]
|
||||
**enum_query_integer** | **int**| Query parameter enum test (double) | [optional]
|
||||
**enum_query_double** | **double**| Query parameter enum test (double) | [optional]
|
||||
|
||||
### Return type
|
||||
|
@ -256,18 +256,18 @@ class FakeApi
|
||||
if ($byte === null) {
|
||||
throw new \InvalidArgumentException('Missing the required parameter $byte when calling testEndpointParameters');
|
||||
}
|
||||
if (!is_null($integer) && ($integer > 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)
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user