We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Does anyone know why XML mapping for extended property doesn't work as it does for JSON version?
extended
MODEL
namespace My\Bundle\Model; use JMS\Serializer\Annotation as Serializer; /** * @Serializer\XmlRoot("product") */ class Create { /** * @Serializer\Type("string") */ public $title; /** * @Serializer\Type("array<string, string>") * @Serializer\XmlKeyValuePairs */ public $extended; }
JSON REQUEST
{ "title": "Created name", "extended": { "crt_key_1": "crt_val_1", "crt_key_2": "crt_val_2" } }
Mapping result
My\Bundle\Model\Create Object ( [title] => Created name [extended] => Array ( [crt_key_1] => crt_val_1 [crt_key_2] => crt_val_2 ) )
XML REQUEST
<?xml version="1.0" encoding="UTF-8"?> <product> <title>Created name</title> <extended> <crt_key_1>crt_val_1</crt_key_1> <crt_key_2>crt_val_2</crt_key_2> </extended> </product>
My\Bundle\Model\Create Object ( [title] => Created name [extended] => Array ( ) )
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Does anyone know why XML mapping for
extended
property doesn't work as it does for JSON version?MODEL
JSON REQUEST
Mapping result
XML REQUEST
Mapping result
The text was updated successfully, but these errors were encountered: