feat: support unions in arrays#1552
Conversation
8ad44a6 to
00bfa52
Compare
|
@idbentley can you help with code review, please? :) |
|
@simPod I think we need also E2E test of deserialisation - I think it should already work for simple types :) |
|
My main feedback is that this PR seems rather incomplete. The changes to the The only tests seem to be of the docblockparser (which is good), but no tests of any serialization/deserialization, no tests of the Type annotation lexer changes. What is the expected behaviour of Overall, I think this is a great feature, but needs some extra help. |
|
This is indeed rather incomplete. I'm now stuck with DeserializationGraphNavigator that does not know how to handle unions. |
| 'params' => [ | ||
| ['name' => 'int', 'params' => []], | ||
| ['name' => Product::class, 'params' => []], | ||
| ['name' => Vehicle::class, 'params' => []], |
There was a problem hiding this comment.
@simPod It seems like array<int, string> and array<int|string> will create exactly the same metadata 😓 I would consider using Union pseudo type same as for the unions, so it will be handled by the Union Handler :D
Uh oh!
There was an error while loading. Please reload this page.