-
-
Notifications
You must be signed in to change notification settings - Fork 901
Fix #673: name converter for Swagger and NelmioApiDocBundle #770
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
Conversation
7b0c567
to
a89e2f2
Compare
@@ -171,7 +174,8 @@ private function getPropertyMetadata(ResourceMetadata $resourceMetadata, string | |||
($propertyMetadata->isReadable() && self::OUT_PREFIX === $io) || | |||
($propertyMetadata->isWritable() && self::IN_PREFIX === $io) | |||
) { | |||
$data[$propertyName] = $this->parseProperty($resourceMetadata, $propertyMetadata, $io, null, $visited); | |||
$normalizedPropertyName = null !== $this->nameConverter ? $this->nameConverter->normalize($propertyName) : $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.
$this->nameConverter ? $this->nameConverter->normalize($propertyName) : $propertyName;
? It doesn't hurt here because $this->nameConverter
can only be null or a reference.
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.
Done for both @dunglas.
@@ -378,12 +381,13 @@ private function getDefinitionSchema(string $resourceClass, ResourceMetadata $re | |||
$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; |
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.
Same here
a89e2f2
to
5c8df74
Compare
Thanks @meyerbaptiste |
Fix api-platform#673: name converter for Swagger and NelmioApiDocBundle
This PR fixes #673 by adding the support of the name converter system to Swagger and NelmioApiDocBundle.