mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-10 11:39:25 +03:00
Fix the tests broken by zircote/swagger-php
This commit is contained in:
parent
416d1f2d2a
commit
4436c468f1
@ -263,7 +263,15 @@ class JMSModelDescriber implements ModelDescriberInterface, ModelRegistryAwareIn
|
|||||||
$groups = $this->computeGroups($context, $type);
|
$groups = $this->computeGroups($context, $type);
|
||||||
|
|
||||||
$model = new Model(new Type(Type::BUILTIN_TYPE_OBJECT, false, $type['name']), $groups);
|
$model = new Model(new Type(Type::BUILTIN_TYPE_OBJECT, false, $type['name']), $groups);
|
||||||
$property->ref = $this->modelRegistry->register($model);
|
$modelRef = $this->modelRegistry->register($model);
|
||||||
|
|
||||||
|
$customFields = (array) $property->jsonSerialize();
|
||||||
|
unset($customFields['property']);
|
||||||
|
if (empty($customFields)) { // no custom fields
|
||||||
|
$property->ref = $modelRef;
|
||||||
|
} else {
|
||||||
|
$property->allOf = [new OA\Schema(['ref' => $modelRef])];
|
||||||
|
}
|
||||||
|
|
||||||
$this->contexts[$model->getHash()] = $context;
|
$this->contexts[$model->getHash()] = $context;
|
||||||
$this->metadataStacks[$model->getHash()] = clone $context->getMetadataStack();
|
$this->metadataStacks[$model->getHash()] = clone $context->getMetadataStack();
|
||||||
|
@ -146,11 +146,11 @@ class JMSFunctionalTest extends WebTestCase
|
|||||||
],
|
],
|
||||||
'virtual_type1' => [
|
'virtual_type1' => [
|
||||||
'title' => 'JMS custom types handled via Custom Type Handlers.',
|
'title' => 'JMS custom types handled via Custom Type Handlers.',
|
||||||
'$ref' => '#/components/schemas/VirtualTypeClassDoesNotExistsHandlerDefined',
|
'allOf' => [['$ref' => '#/components/schemas/VirtualTypeClassDoesNotExistsHandlerDefined']],
|
||||||
],
|
],
|
||||||
'virtual_type2' => [
|
'virtual_type2' => [
|
||||||
'title' => 'JMS custom types handled via Custom Type Handlers.',
|
'title' => 'JMS custom types handled via Custom Type Handlers.',
|
||||||
'$ref' => '#/components/schemas/VirtualTypeClassDoesNotExistsHandlerNotDefined',
|
'allOf' => [['$ref' => '#/components/schemas/VirtualTypeClassDoesNotExistsHandlerNotDefined']],
|
||||||
],
|
],
|
||||||
'last_update' => [
|
'last_update' => [
|
||||||
'type' => 'date',
|
'type' => 'date',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user