dogado-group / json-api-common

Common php interfaces and classes which represent the JSON:API protocol in order to build a client or server application.
https://www.dogado.de
MIT License
1 stars 0 forks source link

[1.x] Resource converter - add support for union types #8

Closed chris-doehring closed 3 years ago

chris-doehring commented 3 years ago

The resource conveter currently supports no union types. Since php 8 is now the only support php version for new releases, we can continue adding union type support. It's currently disabled in src/Converter/ResourceConverter.php:82.

chris-doehring commented 3 years ago

After some investigation I have to say that union type support for the resource converter doesn't really make sense. The converter simply can't decide which of the specified types to use for conversion and would only support standard data types anyway. So you would be required to use the custom setter, hence we will keep ignoring union types.