mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 15:51:48 +03:00
Allow to define the input name for the JmsMetadataParser
This commit is contained in:
parent
b7464a93b9
commit
81274509da
@ -87,7 +87,30 @@ class JmsMetadataParser implements ParserInterface, PostParserInterface
|
|||||||
$className = $input['class'];
|
$className = $input['class'];
|
||||||
$groups = $input['groups'];
|
$groups = $input['groups'];
|
||||||
|
|
||||||
return $this->doParse($className, array(), $groups);
|
$result = $this->doParse($className, array(), $groups);
|
||||||
|
|
||||||
|
if (!isset($input['name']) || empty($input['name'])) {
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (class_exists($className)) {
|
||||||
|
$parts = explode('\\', $className);
|
||||||
|
$dataType = sprintf('object (%s)', end($parts));
|
||||||
|
} else {
|
||||||
|
$dataType = sprintf('object (%s)', $className);
|
||||||
|
}
|
||||||
|
|
||||||
|
return array(
|
||||||
|
$input['name'] => array(
|
||||||
|
'required' => null,
|
||||||
|
'readonly' => null,
|
||||||
|
'default' => null,
|
||||||
|
'dataType' => $dataType,
|
||||||
|
'actualType' => DataTypes::MODEL,
|
||||||
|
'subType' => $dataType,
|
||||||
|
'children' => $result,
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user