-
-
Notifications
You must be signed in to change notification settings - Fork 926
fix issue #1717 - Support Subresources MaxDepth for yaml and xml #2019
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
fix issue #1717 - Support Subresources MaxDepth for yaml and xml #2019
Conversation
The code coverage seems to have an issue: https://codecov.io/gh/api-platform/core/pull/2019/diff It seems it doesn't take into account |
Thanks for the bug fix, can you target the |
The diff is weird, you need to rebase on 2.2 I think |
It's when I change target from master to 2.2 If I rebase it messed up everything.... EDIT: I finally achieved to rebase properly but I lost my other PR in the procedure... I will recreate it quickly when it is fresh in my head... |
7e66193
to
8760548
Compare
8760548
to
c7c4f3b
Compare
@@ -146,13 +146,15 @@ private function createSubresourceMetadata($subresource, PropertyMetadata $prope | |||
if (null !== $type) { | |||
$isCollection = $type->isCollection(); | |||
$resourceClass = $isCollection ? $type->getCollectionValueType()->getClassName() : $type->getClassName(); | |||
$maxDepth = null; // for Type we can't configure maxDepth, maxDepth is always null |
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.
can you declare this var l145 instead?
we don't need the comment, null is default anyway
Thanks @Nightbr ! |
I found it needed more integration in Extractor and Property Factory in order to use Subresources MaxDepth.
I have update related test cases.
Question about Type class which is used in ExtractorPropertyMetadataFactory:
$type = $propertyMetadata->getType();
It uses the built-in symfony Type class and we can't retrieve maxDepth info. So I set maxDepth to null in this case. If you have better idea.