Skip to content

Conversation

meyerbaptiste
Copy link
Member

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #673
License MIT
Doc PR N/A

This PR fixes #673 by adding the support of the name converter system to Swagger and NelmioApiDocBundle.

($propertyMetadata->isWritable() && self::IN_PREFIX === $io)
) {
$data[$propertyName] = $this->parseProperty($resourceMetadata, $propertyMetadata, $io, null, $visited);
$normalizedPropertyName = null !== $this->nameConverter ? $this->nameConverter->normalize($propertyName) : $propertyName;
Copy link
Member

Choose a reason for hiding this comment

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

$this->nameConverter ? $this->nameConverter->normalize($propertyName) : $propertyName;? It doesn't hurt here because $this->nameConverter can only be null or a reference.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done for both @dunglas.

$options = isset($serializerContext['groups']) ? ['serializer_groups' => $serializerContext['groups']] : [];
foreach ($this->propertyNameCollectionFactory->create($resourceClass, $options) as $propertyName) {
$propertyMetadata = $this->propertyMetadataFactory->create($resourceClass, $propertyName);
$normalizedPropertyName = null !== $this->nameConverter ? $this->nameConverter->normalize($propertyName) : $propertyName;
Copy link
Member

Choose a reason for hiding this comment

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

Same here

@teohhanhui teohhanhui added the bug label Sep 28, 2016
@dunglas dunglas merged commit c8d7403 into api-platform:master Sep 28, 2016
@dunglas
Copy link
Member

dunglas commented Sep 28, 2016

Thanks @meyerbaptiste

@meyerbaptiste meyerbaptiste deleted the fix_673 branch October 3, 2016 10:19
magarzon pushed a commit to magarzon/core that referenced this pull request Feb 12, 2017
Fix api-platform#673: name converter for Swagger and NelmioApiDocBundle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Using a nameconvert is not reflected in the api doc

3 participants