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
|
||||
// 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)) {
|
||||
|
@ -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
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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
|
||||
|
@ -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') {
|
||||
|
Loading…
x
Reference in New Issue
Block a user