-
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handling stdClass and other datasource objects #67
Comments
jms/serializer has Xml* attributes for that - see https://jmsyst.com/libs/serializer/master/reference/annotations use JMS\Serializer\Annotation\XmlAttribute;
use JMS\Serializer\Annotation\XmlValue;
use JMS\Serializer\Annotation\XmlRoot;
/** @XmlRoot("price") */
class Price
{
/** @XmlAttribute */
private $currency = 'EUR';
/** @XmlValue */
private $amount = 1.23;
} XmlValue should probably be default |
symfony/serializer does something similar too, but the exact format should be mainly declared by the object and not in global config |
For now I removed support for stdClass from processor. Proper support for various formats will be implemented later 5edbc1a |
TIL that any Most like this to blame:
I might add a test case for this and we might also want to add error to type when this happens.
|
Description
Currently if processor is given an output from
json_decode($value)
, anstdClass
is casted toarray
in case it's in place of aMappedObjectValue
. ButstdClass
makes sense to handle also in case of anArrayOf
and aListOf
.Handling should be also available in
Value
in case printer decides to print an invalid value.We should also consider that fix on user side is as simple as
json_decode($value, true)
and that it may work only for some formats:stdClass
and adds an extra properties.SimpleXMLElement
and we have no way of casting it to an array, handling attributes or printing errors while maintaining the original xml structureAddition information
No response
Related issues
No response
The text was updated successfully, but these errors were encountered: