Skip to content

[Serializer] Handle default context in Serializer #58889

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

Merged
merged 1 commit into from
Jan 28, 2025

Conversation

Valmonzo
Copy link
Contributor

@Valmonzo Valmonzo commented Nov 15, 2024

Q A
Branch? 6.4
Bug fix? yes
New feature? no
Deprecations? no
Issues Fix #58628
License MIT

This fixes the default context not taken into account by the Serializer class.

chalasr
chalasr previously approved these changes Nov 26, 2024
@chalasr chalasr dismissed their stale review November 26, 2024 10:14

high-deps tests are broken. We either need a conflict rule or find a way to make FrameworkBundle's code compatible with all maintained branches

@Valmonzo Valmonzo force-pushed the fix/serializer-default-context branch from 1a47369 to f1bac8a Compare January 15, 2025 01:25
@Valmonzo Valmonzo changed the base branch from 6.4 to 7.3 January 15, 2025 01:25
@Valmonzo Valmonzo force-pushed the fix/serializer-default-context branch from f1bac8a to c6573b2 Compare January 15, 2025 01:29
@Valmonzo Valmonzo changed the base branch from 7.3 to 6.4 January 15, 2025 01:41
@Valmonzo Valmonzo changed the base branch from 6.4 to 7.3 January 15, 2025 01:41
@mtarld
Copy link
Contributor

mtarld commented Jan 17, 2025

Handling that as a feature won't fix the bug for the older branches.

Maybe we can create a new PR aiming to fix the bug that:

  • Add an internal setter on the Serializer class to set the default context
  • Call that setter from the SerializerPass

@chalasr chalasr modified the milestones: 7.3, 6.4 Jan 28, 2025
@chalasr
Copy link
Member

chalasr commented Jan 28, 2025

rebase+retarget on 6.4 needed also

@Valmonzo Valmonzo force-pushed the fix/serializer-default-context branch from 609b7c1 to 4400674 Compare January 28, 2025 18:52
@Valmonzo Valmonzo changed the base branch from 7.3 to 6.4 January 28, 2025 18:52
@chalasr
Copy link
Member

chalasr commented Jan 28, 2025

Thank you @Valmonzo.

@chalasr chalasr merged commit 12e473a into symfony:6.4 Jan 28, 2025
11 checks passed
@Valmonzo Valmonzo deleted the fix/serializer-default-context branch January 28, 2025 19:45
This was referenced Jan 29, 2025
renovate bot added a commit to Runroom/archetype-symfony that referenced this pull request Jan 29, 2025
This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [symfony/doctrine-messenger](https://symfony.com)
([source](https://redirect.github.com/symfony/doctrine-messenger)) |
`7.2.2` -> `7.2.3` |
[![age](https://developer.mend.io/api/mc/badges/age/packagist/symfony%2fdoctrine-messenger/7.2.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/packagist/symfony%2fdoctrine-messenger/7.2.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/packagist/symfony%2fdoctrine-messenger/7.2.2/7.2.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/packagist/symfony%2fdoctrine-messenger/7.2.2/7.2.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
| [symfony/framework-bundle](https://symfony.com)
([source](https://redirect.github.com/symfony/framework-bundle)) |
`7.2.2` -> `7.2.3` |
[![age](https://developer.mend.io/api/mc/badges/age/packagist/symfony%2fframework-bundle/7.2.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/packagist/symfony%2fframework-bundle/7.2.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/packagist/symfony%2fframework-bundle/7.2.2/7.2.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/packagist/symfony%2fframework-bundle/7.2.2/7.2.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
| [symfony/mailer](https://symfony.com)
([source](https://redirect.github.com/symfony/mailer)) | `7.2.0` ->
`7.2.3` |
[![age](https://developer.mend.io/api/mc/badges/age/packagist/symfony%2fmailer/7.2.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/packagist/symfony%2fmailer/7.2.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/packagist/symfony%2fmailer/7.2.0/7.2.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/packagist/symfony%2fmailer/7.2.0/7.2.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
| [symfony/messenger](https://symfony.com)
([source](https://redirect.github.com/symfony/messenger)) | `7.2.1` ->
`7.2.3` |
[![age](https://developer.mend.io/api/mc/badges/age/packagist/symfony%2fmessenger/7.2.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/packagist/symfony%2fmessenger/7.2.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/packagist/symfony%2fmessenger/7.2.1/7.2.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/packagist/symfony%2fmessenger/7.2.1/7.2.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
| [symfony/runtime](https://symfony.com)
([source](https://redirect.github.com/symfony/runtime)) | `7.2.0` ->
`7.2.3` |
[![age](https://developer.mend.io/api/mc/badges/age/packagist/symfony%2fruntime/7.2.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/packagist/symfony%2fruntime/7.2.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/packagist/symfony%2fruntime/7.2.0/7.2.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/packagist/symfony%2fruntime/7.2.0/7.2.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
| [symfony/security-bundle](https://symfony.com)
([source](https://redirect.github.com/symfony/security-bundle)) |
`7.2.2` -> `7.2.3` |
[![age](https://developer.mend.io/api/mc/badges/age/packagist/symfony%2fsecurity-bundle/7.2.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/packagist/symfony%2fsecurity-bundle/7.2.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/packagist/symfony%2fsecurity-bundle/7.2.2/7.2.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/packagist/symfony%2fsecurity-bundle/7.2.2/7.2.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
| [symfony/web-profiler-bundle](https://symfony.com)
([source](https://redirect.github.com/symfony/web-profiler-bundle)) |
`7.2.2` -> `7.2.3` |
[![age](https://developer.mend.io/api/mc/badges/age/packagist/symfony%2fweb-profiler-bundle/7.2.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/packagist/symfony%2fweb-profiler-bundle/7.2.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/packagist/symfony%2fweb-profiler-bundle/7.2.2/7.2.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/packagist/symfony%2fweb-profiler-bundle/7.2.2/7.2.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>symfony/doctrine-messenger
(symfony/doctrine-messenger)</summary>

###
[`v7.2.3`](https://redirect.github.com/symfony/doctrine-messenger/compare/v7.2.2...v7.2.3)

[Compare
Source](https://redirect.github.com/symfony/doctrine-messenger/compare/v7.2.2...v7.2.3)

</details>

<details>
<summary>symfony/framework-bundle (symfony/framework-bundle)</summary>

###
[`v7.2.3`](https://redirect.github.com/symfony/framework-bundle/releases/tag/v7.2.3)

[Compare
Source](https://redirect.github.com/symfony/framework-bundle/compare/v7.2.2...v7.2.3)

**Changelog**
(symfony/framework-bundle@v7.2.2...v7.2.3)

- bug
[symfony/symfony#58889](https://redirect.github.com/symfony/symfony/issues/58889)
\[Serializer] Handle default context in Serializer
([@&#8203;Valmonzo](https://redirect.github.com/Valmonzo))
- bug
[symfony/symfony#59625](https://redirect.github.com/symfony/symfony/issues/59625)
\[FrameworkBundle] Add missing `not-compromised-password` entry in XSD
(@&#8203;alexandre-daubois)
- bug
[symfony/symfony#59581](https://redirect.github.com/symfony/symfony/issues/59581)
\[Cache] Don't clear system caches on `cache:clear`
(@&#8203;nicolas-grekas)
- bug
[symfony/symfony#59579](https://redirect.github.com/symfony/symfony/issues/59579)
\[FrameworkBundle] Fix patching refs to the tmp warmup dir in files
generated by optional cache warmers
([@&#8203;nicolas-grekas](https://redirect.github.com/nicolas-grekas))
- bug
[symfony/symfony#59515](https://redirect.github.com/symfony/symfony/issues/59515)
\[FrameworkBundle] Fix wiring ConsoleProfilerListener
([@&#8203;nicolas-grekas](https://redirect.github.com/nicolas-grekas))
- bug
[symfony/symfony#59136](https://redirect.github.com/symfony/symfony/issues/59136)
\[DependencyInjection] Reset env vars with `kernel.reset`
(@&#8203;faizanakram99)
- bug
[symfony/symfony#59403](https://redirect.github.com/symfony/symfony/issues/59403)
\[FrameworkBundle]\[HttpFoundation] Reset Request's formats using the
service resetter
([@&#8203;nicolas-grekas](https://redirect.github.com/nicolas-grekas))
- bug
[symfony/symfony#59188](https://redirect.github.com/symfony/symfony/issues/59188)
\[HttpClient] Fix `reset()` not called on decorated clients
(@&#8203;HypeMC)

</details>

<details>
<summary>symfony/mailer (symfony/mailer)</summary>

###
[`v7.2.3`](https://redirect.github.com/symfony/mailer/compare/v7.2.0...v7.2.3)

[Compare
Source](https://redirect.github.com/symfony/mailer/compare/v7.2.0...v7.2.3)

</details>

<details>
<summary>symfony/messenger (symfony/messenger)</summary>

###
[`v7.2.3`](https://redirect.github.com/symfony/messenger/releases/tag/v7.2.3)

[Compare
Source](https://redirect.github.com/symfony/messenger/compare/v7.2.1...v7.2.3)

**Changelog**
(symfony/messenger@v7.2.2...v7.2.3)

- bug
[symfony/symfony#59513](https://redirect.github.com/symfony/symfony/issues/59513)
\[Messenger ] Extract retry delay from nested
`RecoverableExceptionInterface` (@&#8203;AydinHassan)
- bug
[symfony/symfony#59508](https://redirect.github.com/symfony/symfony/issues/59508)
\[Messenger] \[AMQP] Improve AMQP connection issues
([@&#8203;AurelienPillevesse](https://redirect.github.com/AurelienPillevesse))
- bug
[symfony/symfony#59352](https://redirect.github.com/symfony/symfony/issues/59352)
\[Messenger] Fix `TransportMessageIdStamp` not always added
(@&#8203;HypeMC)
- bug
[symfony/symfony#59362](https://redirect.github.com/symfony/symfony/issues/59362)
\[Doctrine]\[Messenger] Prevents multiple TransportMessageIdStamp being
stored in envelope
([@&#8203;rtreffler](https://redirect.github.com/rtreffler))

</details>

<details>
<summary>symfony/runtime (symfony/runtime)</summary>

###
[`v7.2.3`](https://redirect.github.com/symfony/runtime/releases/tag/v7.2.3)

[Compare
Source](https://redirect.github.com/symfony/runtime/compare/v7.2.0...v7.2.3)

**Changelog**
(symfony/runtime@v7.2.2...v7.2.3)

-   no significant changes

</details>

<details>
<summary>symfony/security-bundle (symfony/security-bundle)</summary>

###
[`v7.2.3`](https://redirect.github.com/symfony/security-bundle/releases/tag/v7.2.3)

[Compare
Source](https://redirect.github.com/symfony/security-bundle/compare/v7.2.2...v7.2.3)

**Changelog**
(symfony/security-bundle@v7.2.2...v7.2.3)

- bug
[symfony/symfony#59339](https://redirect.github.com/symfony/symfony/issues/59339)
\[SecurityBundle] Remove outdated guard from security xsd schema
([@&#8203;chalasr](https://redirect.github.com/chalasr))
- bug
[symfony/symfony#59342](https://redirect.github.com/symfony/symfony/issues/59342)
\[SecurityBundle] Do not pass traceable authenticators to
`security.helper` (@&#8203;MatTheCat)

</details>

<details>
<summary>symfony/web-profiler-bundle
(symfony/web-profiler-bundle)</summary>

###
[`v7.2.3`](https://redirect.github.com/symfony/web-profiler-bundle/releases/tag/v7.2.3)

[Compare
Source](https://redirect.github.com/symfony/web-profiler-bundle/compare/v7.2.2...v7.2.3)

**Changelog**
(symfony/web-profiler-bundle@v7.2.2...v7.2.3)

- bug
[symfony/symfony#59292](https://redirect.github.com/symfony/symfony/issues/59292)
\[WebProfilerBundle] Fix event delegation on links inside toggles
([@&#8203;MatTheCat](https://redirect.github.com/MatTheCat))
- bug
[symfony/symfony#59229](https://redirect.github.com/symfony/symfony/issues/59229)
\[WebProfilerBundle] fix loading of toolbar stylesheet
([@&#8203;alexislefebvre](https://redirect.github.com/alexislefebvre))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these
updates again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/Runroom/archetype-symfony).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMjUuMSIsInVwZGF0ZWRJblZlciI6IjM5LjEyNS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
nicolas-grekas added a commit that referenced this pull request Feb 5, 2025
…ypeMC)

This PR was merged into the 7.2 branch.

Discussion
----------

[Serializer] Handle default context in named Serializer

| Q             | A
| ------------- | ---
| Branch?       | 7.2
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | -
| License       | MIT

Follow up to #58889.

Same should be applied to named serializers.

Commits
-------

8cb8f55 [Serializer] Handle default context in named Serializer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Serializer] Setting COLLECT_DENORMALIZATION_ERRORS in default_context of framework config has no effect
6 participants