-
-
Notifications
You must be signed in to change notification settings - Fork 313
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
Mapping random key-value pair of XML payload in Symfony2 #470
Comments
Issues barely get answers here but I hope someone answers this question! |
You have defined the mapping of Randoms multiple times, you can only define this once as the last one will overwrite the previous ones. I'm not sure its possible to set multiple accepted types in There are a big number of open issues in https://github.com/schmittjoh/serializer/issues Also /**
* @Serializer\Type("array")
*/
public $randoms;
/**
* @Serializer\Type("array")
*/
public $randoms = []; This is really weird, if $ransoms must be an array set the default value to an array. |
@sstok - As I noted in my question "I listed all
|
Hi,
Well, I hope this is correct place to ask this question unless it is more relevant to Symfony!
Key
randoms
below can contain any key-value pair so whatever you feed in (as long as it is in value-key pair) will be accepted. e.g.<tomato>nonsense</tomato>
. However my mapping doesn't pick them up so I get an empty array forrandoms
. What am I missing?Note: I'm using
"jms/serializer-bundle": "0.13.0",
composer package with Symfony2.PAYLOAD
MODEL MAPPING - I listed all
public $randoms;
below I tried.JSON RESPONSE
The text was updated successfully, but these errors were encountered: