File tree Expand file tree Collapse file tree 1 file changed +9
-12
lines changed
Expand file tree Collapse file tree 1 file changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -67,23 +67,20 @@ public function deserializeValue(mixed $value, Context $context): mixed
6767
6868 protected function getDataSchema (JsonApi $ api ): array
6969 {
70- return [
71- 'oneOf ' => [
70+ $ linkage = [
71+ 'allOf ' => [
72+ ['$ref ' => '#/components/schemas/jsonApiResourceIdentifier ' ],
7273 [
73- 'allOf ' => [
74- ['$ref ' => '#/components/schemas/jsonApiResourceIdentifier ' ],
75- [
76- 'properties ' => [
77- 'type ' => [
78- 'type ' => 'string ' ,
79- 'enum ' => $ this ->getRelatedResources ($ api ),
80- ],
81- ],
74+ 'properties ' => [
75+ 'type ' => [
76+ 'type ' => 'string ' ,
77+ 'enum ' => $ this ->getRelatedResources ($ api ),
8278 ],
8379 ],
8480 ],
85- ['type ' => 'null ' ],
8681 ],
8782 ];
83+
84+ return $ this ->nullable ? ['oneOf ' => [$ linkage , ['type ' => 'null ' ]]] : $ linkage ;
8885 }
8986}
You can’t perform that action at this time.
0 commit comments