API
4 exercises work on this concept, by writing code in the browser.
In Practice
- A JSON array in a text field, with allow_array_submission A text field receiving a JSON array was rejected before any listener. allow_array_submission lets PRE_SUBMIT transform it first.
- A generic page of results, Page<Produit> Symfony 8.2's Serializer understands PHPDoc generics: a single Page class, holding Produit or Avis objects depending on the property that carries it.
- One name per API version, and groups to leave out #[SerializedName('name', groups: 'v1')]: a property changes name depending on the group; ignored_groups leaves a group out without touching the class.
- Let a ValidationFailedException bubble up An uncaught ValidationFailedException now gives a 422 with the list of violations: no more need to wrap it.