This commit is contained in:
wing328 2016-04-23 16:49:52 +08:00
parent 5602cb6db8
commit f1d75f46cf
5 changed files with 44 additions and 13 deletions

View File

@ -1889,7 +1889,7 @@ public class DefaultCodegen {
// set the example value
// if not specified in x-example, generate a default value
if (p.vendorExtensions.containsKey("x-example")) {
p.example = (String) p.vendorExtensions.get("x-example");
p.example = Objects.toString(p.vendorExtensions.get("x-example"));
} else if (Boolean.TRUE.equals(p.isString)) {
p.example = p.paramName + "_example";
} else if (Boolean.TRUE.equals(p.isBoolean)) {

View File

@ -5,7 +5,7 @@ This PHP package is automatically generated by the [Swagger Codegen](https://git
- API version: 1.0.0
- Package version: 1.0.0
- Build date: 2016-04-19T21:31:44.449+02:00
- Build date: 2016-04-23T16:49:49.572+08:00
- Build package: class io.swagger.codegen.languages.PhpClientCodegen
## Requirements
@ -122,6 +122,12 @@ Class | Method | HTTP request | Description
## Documentation For Authorization
## api_key
- **Type**: API key
- **API key parameter name**: api_key
- **Location**: HTTP header
## petstore_auth
- **Type**: OAuth
@ -131,12 +137,6 @@ Class | Method | HTTP request | Description
- **write:pets**: modify pets in your account
- **read:pets**: read your pets
## api_key
- **Type**: API key
- **API key parameter name**: api_key
- **Location**: HTTP header
## Author

View File

@ -5,6 +5,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **int** | |
**snake_case** | **int** | | [optional]
**property** | **string** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -58,7 +58,8 @@ class Name implements ArrayAccess
*/
static $swaggerTypes = array(
'name' => 'int',
'snake_case' => 'int'
'snake_case' => 'int',
'property' => 'string'
);
static function swaggerTypes() {
@ -71,7 +72,8 @@ class Name implements ArrayAccess
*/
static $attributeMap = array(
'name' => 'name',
'snake_case' => 'snake_case'
'snake_case' => 'snake_case',
'property' => 'property'
);
static function attributeMap() {
@ -84,7 +86,8 @@ class Name implements ArrayAccess
*/
static $setters = array(
'name' => 'setName',
'snake_case' => 'setSnakeCase'
'snake_case' => 'setSnakeCase',
'property' => 'setProperty'
);
static function setters() {
@ -97,7 +100,8 @@ class Name implements ArrayAccess
*/
static $getters = array(
'name' => 'getName',
'snake_case' => 'getSnakeCase'
'snake_case' => 'getSnakeCase',
'property' => 'getProperty'
);
static function getters() {
@ -114,6 +118,11 @@ class Name implements ArrayAccess
* @var int
*/
protected $snake_case;
/**
* $property
* @var string
*/
protected $property;
/**
* Constructor
@ -126,6 +135,7 @@ class Name implements ArrayAccess
if ($data != null) {
$this->name = $data["name"];
$this->snake_case = $data["snake_case"];
$this->property = $data["property"];
}
}
/**
@ -168,6 +178,26 @@ class Name implements ArrayAccess
$this->snake_case = $snake_case;
return $this;
}
/**
* Gets property
* @return string
*/
public function getProperty()
{
return $this->property;
}
/**
* Sets property
* @param string $property
* @return $this
*/
public function setProperty($property)
{
$this->property = $property;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
* @param integer $offset Offset

View File

@ -256,7 +256,7 @@ class ObjectSerializer
} else {
return null;
}
} elseif (in_array($class, array('void', 'bool', 'string', 'double', 'byte', 'mixed', 'integer', 'float', 'int', 'DateTime', 'number', 'boolean', 'object'))) {
} elseif (in_array($class, array('integer', 'int', 'void', 'number', 'object', 'double', 'float', 'byte', 'DateTime', 'string', 'mixed', 'boolean', 'bool'))) {
settype($data, $class);
return $data;
} elseif ($class === '\SplFileObject') {