Fix broken map

This commit is contained in:
akihito.nakano 2018-03-29 20:46:22 +09:00
parent dd3d798f02
commit 75e354ed71
11 changed files with 35 additions and 35 deletions

View File

@ -371,7 +371,7 @@ public class PhpClientCodegen extends DefaultCodegen implements CodegenConfig {
ArraySchema ap = (ArraySchema) p;
Schema inner = ap.getItems();
return getTypeDeclaration(inner) + "[]";
} else if (p instanceof MapSchema) {
} else if (p.getAdditionalProperties() != null) {
Schema inner = (Schema) p.getAdditionalProperties();
return getSchemaType(p) + "[string," + getTypeDeclaration(inner) + "]";
} else if (StringUtils.isNotBlank(p.get$ref())) {

View File

@ -382,7 +382,7 @@ $apiInstance = new Swagger\Client\Api\FakeApi(
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$UNKNOWN_PARAM_NAME = new \Swagger\Client\Model\map(); // map | request body
$UNKNOWN_PARAM_NAME = new \Swagger\Client\Model\map(); // map[string,string] | request body
try {
$apiInstance->testInlineAdditionalProperties($UNKNOWN_PARAM_NAME);
@ -396,7 +396,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**UNKNOWN_PARAM_NAME** | [**map**](../Model/map.md)| request body |
**UNKNOWN_PARAM_NAME** | [**map[string,string]**](../Model/map.md)| request body |
### Return type

View File

@ -59,7 +59,7 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
# **getInventory**
> map getInventory()
> map[string,int] getInventory()
Returns pet inventories by status
@ -96,7 +96,7 @@ This endpoint does not need any parameter.
### Return type
[**map**](../Model/map.md)
[**map[string,int]**](../Model/map.md)
### Authorization

View File

@ -3,8 +3,8 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**map_property** | **map** | | [optional]
**map_of_map_property** | [**map**](map.md) | | [optional]
**map_property** | **map[string,string]** | | [optional]
**map_of_map_property** | [**map[string,map[string,string]]**](map.md) | | [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

@ -3,8 +3,8 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**map_map_of_string** | [**map**](map.md) | | [optional]
**map_of_enum_string** | **map** | | [optional]
**map_map_of_string** | [**map[string,map[string,string]]**](map.md) | | [optional]
**map_of_enum_string** | **map[string,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

@ -5,7 +5,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**uuid** | **string** | | [optional]
**date_time** | [**\DateTime**](\DateTime.md) | | [optional]
**map** | [**map**](Animal.md) | | [optional]
**map** | [**map[string,\Swagger\Client\Model\Animal]**](Animal.md) | | [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

@ -1801,7 +1801,7 @@ class FakeApi
*
* test inline additionalProperties
*
* @param map $UNKNOWN_PARAM_NAME request body (required)
* @param map[string,string] $UNKNOWN_PARAM_NAME request body (required)
*
* @throws \Swagger\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
@ -1817,7 +1817,7 @@ class FakeApi
*
* test inline additionalProperties
*
* @param map $UNKNOWN_PARAM_NAME request body (required)
* @param map[string,string] $UNKNOWN_PARAM_NAME request body (required)
*
* @throws \Swagger\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
@ -1870,7 +1870,7 @@ class FakeApi
*
* test inline additionalProperties
*
* @param map $UNKNOWN_PARAM_NAME request body (required)
* @param map[string,string] $UNKNOWN_PARAM_NAME request body (required)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface
@ -1890,7 +1890,7 @@ class FakeApi
*
* test inline additionalProperties
*
* @param map $UNKNOWN_PARAM_NAME request body (required)
* @param map[string,string] $UNKNOWN_PARAM_NAME request body (required)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface
@ -1926,7 +1926,7 @@ class FakeApi
/**
* Create request for operation 'testInlineAdditionalProperties'
*
* @param map $UNKNOWN_PARAM_NAME request body (required)
* @param map[string,string] $UNKNOWN_PARAM_NAME request body (required)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request

View File

@ -320,7 +320,7 @@ class StoreApi
*
* @throws \Swagger\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return map
* @return map[string,int]
*/
public function getInventory()
{
@ -336,11 +336,11 @@ class StoreApi
*
* @throws \Swagger\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of map, HTTP status code, HTTP response headers (array of strings)
* @return array of map[string,int], HTTP status code, HTTP response headers (array of strings)
*/
public function getInventoryWithHttpInfo()
{
$returnType = 'map';
$returnType = 'map[string,int]';
$request = $this->getInventoryRequest();
try {
@ -392,7 +392,7 @@ class StoreApi
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'map',
'map[string,int]',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
@ -432,7 +432,7 @@ class StoreApi
*/
public function getInventoryAsyncWithHttpInfo()
{
$returnType = 'map';
$returnType = 'map[string,int]';
$request = $this->getInventoryRequest();
return $this->client

View File

@ -57,8 +57,8 @@ class AdditionalPropertiesClass implements ModelInterface, ArrayAccess
* @var string[]
*/
protected static $swaggerTypes = [
'map_property' => 'map',
'map_of_map_property' => 'map'
'map_property' => 'map[string,string]',
'map_of_map_property' => 'map[string,map[string,string]]'
];
/**
@ -214,7 +214,7 @@ class AdditionalPropertiesClass implements ModelInterface, ArrayAccess
/**
* Gets map_property
*
* @return map
* @return map[string,string]
*/
public function getMapProperty()
{
@ -224,7 +224,7 @@ class AdditionalPropertiesClass implements ModelInterface, ArrayAccess
/**
* Sets map_property
*
* @param map $map_property map_property
* @param map[string,string] $map_property map_property
*
* @return $this
*/
@ -238,7 +238,7 @@ class AdditionalPropertiesClass implements ModelInterface, ArrayAccess
/**
* Gets map_of_map_property
*
* @return map
* @return map[string,map[string,string]]
*/
public function getMapOfMapProperty()
{
@ -248,7 +248,7 @@ class AdditionalPropertiesClass implements ModelInterface, ArrayAccess
/**
* Sets map_of_map_property
*
* @param map $map_of_map_property map_of_map_property
* @param map[string,map[string,string]] $map_of_map_property map_of_map_property
*
* @return $this
*/

View File

@ -57,8 +57,8 @@ class MapTest implements ModelInterface, ArrayAccess
* @var string[]
*/
protected static $swaggerTypes = [
'map_map_of_string' => 'map',
'map_of_enum_string' => 'map'
'map_map_of_string' => 'map[string,map[string,string]]',
'map_of_enum_string' => 'map[string,string]'
];
/**
@ -229,7 +229,7 @@ class MapTest implements ModelInterface, ArrayAccess
/**
* Gets map_map_of_string
*
* @return map
* @return map[string,map[string,string]]
*/
public function getMapMapOfString()
{
@ -239,7 +239,7 @@ class MapTest implements ModelInterface, ArrayAccess
/**
* Sets map_map_of_string
*
* @param map $map_map_of_string map_map_of_string
* @param map[string,map[string,string]] $map_map_of_string map_map_of_string
*
* @return $this
*/
@ -253,7 +253,7 @@ class MapTest implements ModelInterface, ArrayAccess
/**
* Gets map_of_enum_string
*
* @return map
* @return map[string,string]
*/
public function getMapOfEnumString()
{
@ -263,7 +263,7 @@ class MapTest implements ModelInterface, ArrayAccess
/**
* Sets map_of_enum_string
*
* @param map $map_of_enum_string map_of_enum_string
* @param map[string,string] $map_of_enum_string map_of_enum_string
*
* @return $this
*/

View File

@ -59,7 +59,7 @@ class MixedPropertiesAndAdditionalPropertiesClass implements ModelInterface, Arr
protected static $swaggerTypes = [
'uuid' => 'string',
'date_time' => '\DateTime',
'map' => 'map'
'map' => 'map[string,\Swagger\Client\Model\Animal]'
];
/**
@ -268,7 +268,7 @@ class MixedPropertiesAndAdditionalPropertiesClass implements ModelInterface, Arr
/**
* Gets map
*
* @return map
* @return map[string,\Swagger\Client\Model\Animal]
*/
public function getMap()
{
@ -278,7 +278,7 @@ class MixedPropertiesAndAdditionalPropertiesClass implements ModelInterface, Arr
/**
* Sets map
*
* @param map $map map
* @param map[string,\Swagger\Client\Model\Animal] $map map
*
* @return $this
*/