Skip to content

[Serializer] Serialization versioning #38478

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

Open
wants to merge 11 commits into
base: 7.3
Choose a base branch
from

Conversation

ArnaudTarroux
Copy link

Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #30848
License MIT
Doc PR n/a

Add Serialization versioning.

  • Added @Since annotation
  • Added @Until annotation
  • Added support of since and until to the xml and yaml mapping
  • Added version context option
  • Added the possibility to configure the serializer.default_version in the framework config

@ArnaudTarroux
Copy link
Author

Old PR => #35617

@nicolas-grekas nicolas-grekas added this to the 5.x milestone Oct 12, 2020
@fabpot fabpot modified the milestones: 5.4, 6.1 Nov 16, 2021
@fabpot
Copy link
Member

fabpot commented Dec 11, 2021

@dunglas I would love to get your input here whenever you have time.

@@ -934,6 +934,7 @@ private function addSerializerSection(ArrayNodeDefinition $rootNode)
->end()
->end()
->end()
->scalarNode('default_version')->end()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From #38542 serializer.default_context config option is avalable now.

Why not use serializer.default_context.version instead?

@fabpot fabpot modified the milestones: 6.1, 6.2 May 20, 2022
@nicolas-grekas nicolas-grekas modified the milestones: 6.2, 6.3 Nov 5, 2022
@connorhu
Copy link
Contributor

connorhu commented Jan 9, 2023

I have made some updates to this PR.

  • added Since and Until annotations
  • fixed some tests
  • fixed merge conflicts (with rebase to 6.3)

You can find it here:
6.3...connorhu:symfony:feature/serializer-version

@ArnaudTarroux
Copy link
Author

I have made some updates to this PR.

  • added Since and Until annotations
  • fixed some tests
  • fixed merge conflicts (with rebase to 6.3)

You can find it here: 6.3...connorhu:symfony:feature/serializer-version

Thank for your work @connorhu !
I don'y know if this PR will be merged one day 🤷

@nicolas-grekas nicolas-grekas removed this from the 6.3 milestone May 23, 2023
@nicolas-grekas nicolas-grekas added this to the 6.4 milestone May 23, 2023
@nicolas-grekas nicolas-grekas modified the milestones: 6.4, 7.1 Nov 15, 2023
@xabbuh xabbuh modified the milestones: 7.1, 7.2 May 15, 2024
use Symfony\Component\Serializer\Exception\InvalidArgumentException;

/**
* Annotation class for @Since().
Copy link
Contributor

@Seb33300 Seb33300 Aug 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if you're still maintaining this PR, but this probably needs to be changed into an attribute now.

@fabpot fabpot modified the milestones: 7.2, 7.3 Nov 20, 2024
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.

8 participants