I am using FOSRestBundle to handle the API connections in my app, however I stuck with PUTting one to many relation, I don't know, how JSON should be composed.
Note that entire API works, so all the form constructions, mapping, etc is configured well.
Entity
...
/**
* @ORM\OneToMany(targetEntity="MemberTranslation", mappedBy="member")
* @Expose
*/
private $translations;
...
Form
...
$builder
->add('publicBiography', 'text')
;
...
I am expecting (the construction of JSON to be) something like:
{
"member": {
"translations": [
{ "id": 1, "publicBiography": "This is english trans" },
{ "id": 2, "publicBiography": "To jest polskie tłum." },
]
}
}
I actually don't know if this make sense but would be nice if someone could help me out.