-
-
Notifications
You must be signed in to change notification settings - Fork 853
feat(#1461): filter JMS properties by route area #2407
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
base: 4.x
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 4.x #2407 +/- ##
==========================================
+ Coverage 89.50% 89.51% +0.01%
==========================================
Files 78 78
Lines 2896 2910 +14
==========================================
+ Hits 2592 2605 +13
- Misses 304 305 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@@ -232,6 +233,11 @@ public function getSerializationContext(Model $model): Context | |||
} | |||
} | |||
|
|||
$area = $model->getArea(); | |||
if (null !== $area) { | |||
$context->addExclusionStrategy(new VersionExclusionStrategy($area)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you write a test? 😄
Description
This PR uses the area configured in the route (like
/api/{area}/doc/
) to filter out properties on the model, which should be excluded based on JMS's versioning (also see demo below.)Closes #1461
Refs #2129
What type of PR is this? (check all applicable)
Checklist
docs/
)CHANGELOG.md
)Demo from our project
We have an entity property:
Opening the docs on the route:
/api/v4.3/doc/
,which is configured as:
before this PR


after this PR
Implementation
I opted for the word "area", since it is used in the route definition.
I proceeded as adviced in #1461.
Could you point me to where you would like to see tests created/adjusted?