Skip to content
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

Merged
merged 3 commits into from
Oct 17, 2016

Conversation

Simperfit
Copy link
Contributor

@Simperfit Simperfit commented Sep 17, 2016

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>';
Copy link
Contributor Author

@Simperfit Simperfit Sep 17, 2016

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) {
Copy link
Contributor Author

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

Copy link
Contributor Author

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

@vincentchalamon vincentchalamon changed the title WIP fix: fix nelmio documenation #728 WIP fix: fix nelmio documentation #728 Sep 30, 2016
$classOperations = $this->getGroupsForItemAndCollectionOperation($resourceMetadata, $operationName, $io);
echo '<pre>';
var_dump($classOperations['serializer_groups'], !empty($classOperations['serializer_groups']));
echo '</pre>';
Copy link
Member

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

Copy link
Contributor Author

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)
Copy link
Member

Choose a reason for hiding this comment

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

norm?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed

@Simperfit Simperfit changed the title WIP fix: fix nelmio documentation #728 fix: fix nelmio documentation #728 Oct 2, 2016
@Simperfit Simperfit added the bug label Oct 6, 2016
@dunglas dunglas merged commit 4d3a2c5 into api-platform:master Oct 17, 2016
@dunglas dunglas deleted the hotfix/fix-nelmio-doc branch October 17, 2016 12:28
@dunglas
Copy link
Member

dunglas commented Oct 17, 2016

Thanks @Simperfit

@teohhanhui
Copy link
Contributor

No tests? 😢

@Simperfit
Copy link
Contributor Author

@teohhanhui I will add them.

magarzon pushed a commit to magarzon/core that referenced this pull request Feb 12, 2017
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.

None yet

4 participants