-
-
Notifications
You must be signed in to change notification settings - Fork 848
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: fix nelmio documentation #728 #756
Conversation
Simperfit
commented
Sep 17, 2016
•
edited by teohhanhui
Loading
edited by teohhanhui
Q | A |
---|---|
Bug fix? | yes |
New feature? | no |
BC breaks? | no |
Deprecations? | no |
Tests pass? | yes |
Fixed tickets | #728 |
License | MIT |
Doc PR | N/A |
@@ -82,11 +82,11 @@ public function parse(array $item) : array | |||
list($io, $resourceClass, $operationName) = explode(':', $item['class'], 3); | |||
$resourceMetadata = $this->resourceMetadataFactory->create($resourceClass); | |||
|
|||
$classOperations = $this->getGroupsForItemAndCollectionOperation($resourceMetadata, $operationName); | |||
$classOperations = $this->getGroupsForItemAndCollectionOperation($resourceMetadata, $operationName, $io); | |||
echo '<pre>';var_dump($classOperations['serializer_groups'], !empty($classOperations['serializer_groups'])); echo '</pre>'; |
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.
If you recall the exemple i've put in the issue, than you should understand why it is strange, because it's return positive values :
array(2) {
[0]=>
string(8) "dummy_in"
[1]=>
string(12) "custom_dummy"
}
bool(true)
@@ -166,15 +168,13 @@ private function getPropertyMetadata(ResourceMetadata $resourceMetadata, string | |||
|
|||
foreach ($this->propertyNameCollectionFactory->create($resourceClass, $options) as $propertyName) { |
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.
I may think that this is bugging, and that we are not calling the good property with the good groups, @api-platform/core-team any opinion ?
If you run this with the Dummy entity, you will see that this is not totally wrong
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.
It could be a problem in nelmio docs
4a09030
to
cf6421e
Compare
$classOperations = $this->getGroupsForItemAndCollectionOperation($resourceMetadata, $operationName, $io); | ||
echo '<pre>'; | ||
var_dump($classOperations['serializer_groups'], !empty($classOperations['serializer_groups'])); | ||
echo '</pre>'; |
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.
^^ You can use dump
with symfony 3.x
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.
removed :p.
Yup I know, just the old good habits to change ;)
@@ -122,6 +125,16 @@ private function parseResource(ResourceMetadata $resourceMetadata, string $resou | |||
return $this->getPropertyMetadata($resourceMetadata, $resourceClass, $io, $visited, $options); | |||
} | |||
|
|||
private function getGroupsContext(ResourceMetadata $resourceMetadata, string $operationName, bool $norm) |
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.
norm
?
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.
changed
cf6421e
to
0779521
Compare
Thanks @Simperfit |
No tests? 😢 |
@teohhanhui I will add them. |