Skip to content

Commit

Permalink
Fixed extraction of parent class (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
supersmile2009 authored and Webonaute committed Oct 30, 2017
1 parent a65ffa3 commit eeab451
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Extraction/Extractor/JmsExtractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,12 @@ public function extract($reflectionClass, $schema, ExtractionContextInterface $e
$exclusionStrategies[] = new GroupsExclusionStrategy($schema->serializerGroups);
}
// If this is child class with discriminator map, store information about parent class alias
// and extract parent class
if (isset($meta->discriminatorBaseClass)
&& $meta->discriminatorBaseClass !== $reflectionClass->getName()
) {
$schema->parentAlias = $this->typeSchemaExtractor->getAliasFor($reflectionClass->getParentClass()->getName());
$this->extractTypeSchema($reflectionClass->getParentClass()->getName(), $subContext);
}

foreach ($meta->propertyMetadata as $property => $item) {
Expand Down Expand Up @@ -235,4 +237,4 @@ private function shouldSkipProperty($exclusionStrategies, $item)

return false;
}
}
}

0 comments on commit eeab451

Please sign in to comment.