<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/new-in-symfony-8-2-serializer-improvements-symfony-blog--xwv5bm7ju" -->

---
title: New in Symfony 8.2: Serializer Improvements (Symfony Blog)
description: Symfony 8.2 makes the Serializer more flexible and more tolerant of bad input. Child classes can register themselves in a parent's discriminator map with the...
canonical: https://daily.dev/posts/new-in-symfony-8-2-serializer-improvements-symfony-blog--xwv5bm7ju
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: New in Symfony 8.2: Serializer Improvements (Symfony Blog) | daily.dev
og:description: Symfony 8.2 makes the Serializer more flexible and more tolerant of bad input. Child classes can register themselves in a parent's discriminator map with the...
og:url: https://daily.dev/posts/new-in-symfony-8-2-serializer-improvements-symfony-blog--xwv5bm7ju
og:image: https://api.daily.dev/og/posts/XWv5BM7ju.png
og:image:alt: New in Symfony 8.2: Serializer Improvements (Symfony Blog)
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# New in Symfony 8.2: Serializer Improvements (Symfony Blog)

**[Symfony](https://daily.dev/sources/symfony)** · 6 min read · 0 upvotes · 0 comments

## Summary

Symfony 8.2 makes the Serializer more flexible and more tolerant of bad input. Child classes can register themselves in a parent's discriminator map with the new repeatable #[DiscriminatorMapType] attribute, so the parent no longer needs editing. Aliased type names now survive a serialization round trip. The new skip_invalid_attributes option treats invalid values as missing, so ?page=foo falls back to the default instead of returning a 404. CSV headers can map labels to nested values. PHPDoc types and @extends templates are now inherited, which can change how existing properties denormalize.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://symfony.com/blog/new-in-symfony-8-2-serializer-improvements>

## Questions this post answers

### How can a child class register itself in a Symfony Serializer discriminator map without editing the parent class?

Symfony 8.2 adds a repeatable #[DiscriminatorMapType] attribute that lets each class add itself to the map declared by one of its parents or interfaces. The mapping argument of #[DiscriminatorMap] is now optional. Types added this way merge with listed ones and also extend YAML or XML maps. Duplicates and classes not extending the parent are reported when building the container.

_Developers maintaining Symfony bundles follow Serializer changes like this on daily.dev._

### How do I stop Symfony's #[MapQueryString] from returning a 404 when a query parameter has the wrong type?

Symfony 8.2 adds a skip_invalid_attributes serialization context option that treats invalid values as if they were absent. Set it via #[MapQueryString(serializationContext: ['skip_invalid_attributes' => true])], and /search?page=foo falls back to the default of 1. A required constructor argument without a default still fails, and skipped values are not reported by collect_denormalization_errors.

_Symfony developers hardening request handling track changes like this on daily.dev._

### How can I choose and reorder columns in Symfony's CsvEncoder output?

In Symfony 8.2, the csv_headers option of the CSV encoder accepts an associative array mapping each column label to the value it holds, such as ['City' => 'address.city', 'Customer' => 'name']. Only listed columns are included, in that order. Nested values use the flattening separator ('.' by default), and missing values give an empty cell. It applies only when encoding.

_PHP developers building data exports keep up with Symfony component changes on daily.dev._

## Similar posts on daily.dev

- [New in Symfony 8.2: Generics and Stricter Types in the Serializer \(Symfony Blog\)](https://daily.dev/posts/new-in-symfony-8-2-generics-and-stricter-types-in-the-serializer-symfony-blog--txfzewrmy) · Symfony · 0 upvotes · 0 comments
- [New in Symfony 8.2: More Flexible Serialization Groups \(Symfony Blog\)](https://daily.dev/posts/new-in-symfony-8-2-more-flexible-serialization-groups-symfony-blog--s7l6m91ib) · Symfony · 2 upvotes · 0 comments
- [New in Symfony 8.2: Doctrine improvements \(Symfony Blog\)](https://daily.dev/posts/new-in-symfony-8-2-doctrine-improvements-symfony-blog--2z7xn3o28) · Symfony · 0 upvotes · 0 comments
- [New in Symfony 8.2: Performance Improvements \(Symfony Blog\)](https://daily.dev/posts/new-in-symfony-8-2-performance-improvements-symfony-blog--ef0ps6tns) · Symfony · 4 upvotes · 0 comments
- [Symfony 8.1 curated new features \(Symfony Blog\)](https://daily.dev/posts/symfony-8-1-curated-new-features-symfony-blog--9qonflcdy) · Symfony · 4 upvotes · 0 comments

---

Tags: [#php](https://daily.dev/tags/php), [#symfony](https://daily.dev/tags/symfony)

[View this post on daily.dev](https://daily.dev/posts/new-in-symfony-8-2-serializer-improvements-symfony-blog--xwv5bm7ju)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"New in Symfony 8.2: Serializer Improvements (Symfony Blog)","url":"https://daily.dev/posts/new-in-symfony-8-2-serializer-improvements-symfony-blog--xwv5bm7ju","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/new-in-symfony-8-2-serializer-improvements-symfony-blog--xwv5bm7ju"},"datePublished":"2026-11-28T12:56:09.149Z","dateModified":"2026-11-28T12:56:33.998Z","description":"Symfony 8.2 makes the Serializer more flexible and more tolerant of bad input. Child classes can register themselves in a parent's discriminator map with the...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/327b244859fddae8f3a20d0225898aa0?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/327b244859fddae8f3a20d0225898aa0?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Symfony","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Symfony","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/cc07051b7112472f9729e73c14660a64","url":"https://daily.dev/sources/symfony"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/new-in-symfony-8-2-serializer-improvements-symfony-blog--xwv5bm7ju","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"php,symfony","timeRequired":"PT6M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Symfony","item":"https://daily.dev/sources/symfony"},{"@type":"ListItem","position":3,"name":"New in Symfony 8.2: Serializer Improvements (Symfony Blog)"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/new-in-symfony-8-2-serializer-improvements-symfony-blog--xwv5bm7ju#faq","mainEntity":[{"@type":"Question","name":"How can a child class register itself in a Symfony Serializer discriminator map without editing the parent class?","acceptedAnswer":{"@type":"Answer","text":"Symfony 8.2 adds a repeatable #[DiscriminatorMapType] attribute that lets each class add itself to the map declared by one of its parents or interfaces. The mapping argument of #[DiscriminatorMap] is now optional. Types added this way merge with listed ones and also extend YAML or XML maps. Duplicates and classes not extending the parent are reported when building the container. Developers maintaining Symfony bundles follow Serializer changes like this on daily.dev."}},{"@type":"Question","name":"How do I stop Symfony's #[MapQueryString] from returning a 404 when a query parameter has the wrong type?","acceptedAnswer":{"@type":"Answer","text":"Symfony 8.2 adds a skip_invalid_attributes serialization context option that treats invalid values as if they were absent. Set it via #[MapQueryString(serializationContext: ['skip_invalid_attributes' =\u003e true])], and /search?page=foo falls back to the default of 1. A required constructor argument without a default still fails, and skipped values are not reported by collect_denormalization_errors. Symfony developers hardening request handling track changes like this on daily.dev."}},{"@type":"Question","name":"How can I choose and reorder columns in Symfony's CsvEncoder output?","acceptedAnswer":{"@type":"Answer","text":"In Symfony 8.2, the csv_headers option of the CSV encoder accepts an associative array mapping each column label to the value it holds, such as ['City' =\u003e 'address.city', 'Customer' =\u003e 'name']. Only listed columns are included, in that order. Nested values use the flattening separator ('.' by default), and missing values give an empty cell. It applies only when encoding. PHP developers building data exports keep up with Symfony component changes on daily.dev."}}]}
```

