Skip to content

Instantly share code, notes, and snippets.

@merltron-pa
Last active November 25, 2020 15:50
Show Gist options
  • Save merltron-pa/bf2937b326ad3c3a2a62a2ebb48f69c7 to your computer and use it in GitHub Desktop.
Save merltron-pa/bf2937b326ad3c3a2a62a2ebb48f69c7 to your computer and use it in GitHub Desktop.
PHP/JMS Article: Added JUST the body converter
<?php
...
class TestAddressController extends AbstractFOSRestController
{
/**
* @Route("/test/address", methods={"POST"})
* @ParamConverter("address", converter="fos_rest.request_body")
*/
public function post(Address $address): Response
{
return new Response($this->serializer->serialize($a, 'xml'));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment