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
67
67
68
68
protected function getDataSchema (JsonApi $ api ): array
69
69
{
70
- return [
71
- 'oneOf ' => [
70
+ $ linkage = [
71
+ 'allOf ' => [
72
+ ['$ref ' => '#/components/schemas/jsonApiResourceIdentifier ' ],
72
73
[
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 ),
82
78
],
83
79
],
84
80
],
85
- ['type ' => 'null ' ],
86
81
],
87
82
];
83
+
84
+ return $ this ->nullable ? ['oneOf ' => [$ linkage , ['type ' => 'null ' ]]] : $ linkage ;
88
85
}
89
86
}
You can’t perform that action at this time.
0 commit comments