forked from loafle/openapi-generator-original
fix #2688
This commit is contained in:
parent
5602cb6db8
commit
f1d75f46cf
@ -1889,7 +1889,7 @@ public class DefaultCodegen {
|
|||||||
// set the example value
|
// set the example value
|
||||||
// if not specified in x-example, generate a default value
|
// if not specified in x-example, generate a default value
|
||||||
if (p.vendorExtensions.containsKey("x-example")) {
|
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)) {
|
} else if (Boolean.TRUE.equals(p.isString)) {
|
||||||
p.example = p.paramName + "_example";
|
p.example = p.paramName + "_example";
|
||||||
} else if (Boolean.TRUE.equals(p.isBoolean)) {
|
} else if (Boolean.TRUE.equals(p.isBoolean)) {
|
||||||
|
@ -5,7 +5,7 @@ This PHP package is automatically generated by the [Swagger Codegen](https://git
|
|||||||
|
|
||||||
- API version: 1.0.0
|
- API version: 1.0.0
|
||||||
- Package 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
|
- Build package: class io.swagger.codegen.languages.PhpClientCodegen
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
@ -122,6 +122,12 @@ Class | Method | HTTP request | Description
|
|||||||
## Documentation For Authorization
|
## Documentation For Authorization
|
||||||
|
|
||||||
|
|
||||||
|
## api_key
|
||||||
|
|
||||||
|
- **Type**: API key
|
||||||
|
- **API key parameter name**: api_key
|
||||||
|
- **Location**: HTTP header
|
||||||
|
|
||||||
## petstore_auth
|
## petstore_auth
|
||||||
|
|
||||||
- **Type**: OAuth
|
- **Type**: OAuth
|
||||||
@ -131,12 +137,6 @@ Class | Method | HTTP request | Description
|
|||||||
- **write:pets**: modify pets in your account
|
- **write:pets**: modify pets in your account
|
||||||
- **read:pets**: read your pets
|
- **read:pets**: read your pets
|
||||||
|
|
||||||
## api_key
|
|
||||||
|
|
||||||
- **Type**: API key
|
|
||||||
- **API key parameter name**: api_key
|
|
||||||
- **Location**: HTTP header
|
|
||||||
|
|
||||||
|
|
||||||
## Author
|
## Author
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ Name | Type | Description | Notes
|
|||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**name** | **int** | |
|
**name** | **int** | |
|
||||||
**snake_case** | **int** | | [optional]
|
**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)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
@ -58,7 +58,8 @@ class Name implements ArrayAccess
|
|||||||
*/
|
*/
|
||||||
static $swaggerTypes = array(
|
static $swaggerTypes = array(
|
||||||
'name' => 'int',
|
'name' => 'int',
|
||||||
'snake_case' => 'int'
|
'snake_case' => 'int',
|
||||||
|
'property' => 'string'
|
||||||
);
|
);
|
||||||
|
|
||||||
static function swaggerTypes() {
|
static function swaggerTypes() {
|
||||||
@ -71,7 +72,8 @@ class Name implements ArrayAccess
|
|||||||
*/
|
*/
|
||||||
static $attributeMap = array(
|
static $attributeMap = array(
|
||||||
'name' => 'name',
|
'name' => 'name',
|
||||||
'snake_case' => 'snake_case'
|
'snake_case' => 'snake_case',
|
||||||
|
'property' => 'property'
|
||||||
);
|
);
|
||||||
|
|
||||||
static function attributeMap() {
|
static function attributeMap() {
|
||||||
@ -84,7 +86,8 @@ class Name implements ArrayAccess
|
|||||||
*/
|
*/
|
||||||
static $setters = array(
|
static $setters = array(
|
||||||
'name' => 'setName',
|
'name' => 'setName',
|
||||||
'snake_case' => 'setSnakeCase'
|
'snake_case' => 'setSnakeCase',
|
||||||
|
'property' => 'setProperty'
|
||||||
);
|
);
|
||||||
|
|
||||||
static function setters() {
|
static function setters() {
|
||||||
@ -97,7 +100,8 @@ class Name implements ArrayAccess
|
|||||||
*/
|
*/
|
||||||
static $getters = array(
|
static $getters = array(
|
||||||
'name' => 'getName',
|
'name' => 'getName',
|
||||||
'snake_case' => 'getSnakeCase'
|
'snake_case' => 'getSnakeCase',
|
||||||
|
'property' => 'getProperty'
|
||||||
);
|
);
|
||||||
|
|
||||||
static function getters() {
|
static function getters() {
|
||||||
@ -114,6 +118,11 @@ class Name implements ArrayAccess
|
|||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
protected $snake_case;
|
protected $snake_case;
|
||||||
|
/**
|
||||||
|
* $property
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $property;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
@ -126,6 +135,7 @@ class Name implements ArrayAccess
|
|||||||
if ($data != null) {
|
if ($data != null) {
|
||||||
$this->name = $data["name"];
|
$this->name = $data["name"];
|
||||||
$this->snake_case = $data["snake_case"];
|
$this->snake_case = $data["snake_case"];
|
||||||
|
$this->property = $data["property"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@ -168,6 +178,26 @@ class Name implements ArrayAccess
|
|||||||
$this->snake_case = $snake_case;
|
$this->snake_case = $snake_case;
|
||||||
return $this;
|
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.
|
* Returns true if offset exists. False otherwise.
|
||||||
* @param integer $offset Offset
|
* @param integer $offset Offset
|
||||||
|
@ -256,7 +256,7 @@ class ObjectSerializer
|
|||||||
} else {
|
} else {
|
||||||
return null;
|
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);
|
settype($data, $class);
|
||||||
return $data;
|
return $data;
|
||||||
} elseif ($class === '\SplFileObject') {
|
} elseif ($class === '\SplFileObject') {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user