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
391d0e32d0
commit
c6dbdc726e
@ -87,7 +87,30 @@ class JmsMetadataParser implements ParserInterface, PostParserInterface
|
||||
$className = $input['class'];
|
||||
$groups = $input['groups'];
|
||||
|
||||
return $this->doParse($className, array(), $groups);
|
||||
$result = $this->doParse($className, array(), $groups);
|
||||
|
||||
if (!isset($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' => false,
|
||||
'readonly' => false,
|
||||
'default' => null,
|
||||
'dataType' => $dataType,
|
||||
'actualType' => DataTypes::MODEL,
|
||||
'subType' => $dataType,
|
||||
'children' => $result,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -86,7 +86,6 @@ class ValidationParser implements ParserInterface, PostParserInterface
|
||||
$input['name'] => array(
|
||||
'required' => false,
|
||||
'readonly' => false,
|
||||
'description' => '',
|
||||
'default' => null,
|
||||
'dataType' => $dataType,
|
||||
'actualType' => DataTypes::MODEL,
|
||||
|
Loading…
x
Reference in New Issue
Block a user