We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
.x
We are using the versioning of the jms serializer.
I first did have this:
<property name="sections" expose="true" since-version="3.0"/> <virtual-property name="areas_without_section" serialized-name="areas" method="getAreasWithoutSections" expose="true" since-version="1.0" until-version="2.0" /> <virtual-property name="areas" serialized-name="areas" method="getAreas" expose="true" since-version="2.0" until-version="3.0" />
Then I did find out that the areas is still returned when using 3.0 version. So I did see in the docs: https://jmsyst.com/libs/serializer/master/cookbook/exclusion_strategies
areas
3.0
There is something like 1.0.x used so I did use:
1.0.x
<property name="sections" expose="true" since-version="3.0"/> <virtual-property name="areas_without_section" serialized-name="areas" method="getAreasWithoutSections" expose="true" since-version="1.0" until-version="1.x" /> <virtual-property name="areas" serialized-name="areas" method="getAreas" expose="true" since-version="2.0" until-version="2.x" />
but this didn't work the areas where not returned when requested with 2.0
2.0
"sections": [ { "_hash": "@string@", "uuid": "@string@", "name": "Section 1", "areas": [ { "_hash": "@string@", "uuid": "@string@", "name": "1" }, { "_hash": "@string@", "uuid": "@string@", "name": "1A" }, { "_hash": "@string@", "uuid": "@string@", "name": "2A" }, { "_hash": "@string@", "uuid": "@string@", "name": "2B" } ] }, { "_hash": "@string@", "uuid": "@string@", "name": "Section 2", "areas": [ { "_hash": "@string@", "uuid": "@string@", "name": "1" }, { "_hash": "@string@", "uuid": "@string@", "name": "1A" }, { "_hash": "@string@", "uuid": "@string@", "name": "2A" }, { "_hash": "@string@", "uuid": "@string@", "name": "2B" } ] } ],
"areas": [ { "section": "Section 1", "areas": [ "1", "1A", "2A", "2B" ] }, { "section": "Section 2", "areas": [ "1", "1A", "2A", "2B" ] } ],
"areas": [ "1", "1A", "2A", "2B", "1", "1A", "2A", "2B" ],
See above.
Currently I did workaround by using .9999 as until version:
<property name="sections" expose="true" since-version="3.0"/> <virtual-property name="areas_without_section" serialized-name="areas" method="getAreasWithoutSections" expose="true" since-version="1.0" until-version="1.9999" /> <virtual-property name="areas" serialized-name="areas" method="getAreas" expose="true" since-version="2.0" until-version="2.9999" />
The text was updated successfully, but these errors were encountered:
The version exclusion strategy uses under the hood https://www.php.net/manual/en/function.version-compare.php
Whatever is supported by version_compare should work here.
version_compare
It would be nice to move to https://github.com/composer/semver instead of version_compare
Sorry, something went wrong.
I don't think that the 1.0.x example from the docs have ever worked.
I gave this a try in #1361 by adding a version-constraints attribute/VersionConstraints annotation which accept composer version constraints
version-constraints
VersionConstraints
No branches or pull requests
Steps required to reproduce the problem
We are using the versioning of the jms serializer.
I first did have this:
Then I did find out that the
areas
is still returned when using3.0
version. So I did see in the docs: https://jmsyst.com/libs/serializer/master/cookbook/exclusion_strategiesThere is something like
1.0.x
used so I did use:but this didn't work the
areas
where not returned when requested with2.0
Expected Result
**3.0**: Return `sections` without `areas`:
**2.0** Return `areas` without `sections`:
**1.0** Return `areas` in old format without `sections`:
Actual Result
See above.
Current workaround
Currently I did workaround by using .9999 as until version:
The text was updated successfully, but these errors were encountered: