Skip to content

Commit

Permalink
import all annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskapp committed Nov 9, 2024
1 parent 038a677 commit afa47a9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Generator/Java.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ protected function writeStruct(Code\Name $name, array $properties, ?string $exte

$discriminator = $origin->getDiscriminator();
if ($discriminator !== null) {
$code.= '@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "' . $discriminator . '")' . "\n";
$code.= '@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "' . $discriminator . '")' . "\n";
}

$mapping = $origin->getMapping();
Expand Down Expand Up @@ -153,8 +153,7 @@ protected function writeHeader(DefinitionTypeAbstract $origin, Code\Name $classN
private function getImports(DefinitionTypeAbstract $origin): array
{
$imports = [];
$imports[] = 'import com.fasterxml.jackson.annotation.JsonGetter;';
$imports[] = 'import com.fasterxml.jackson.annotation.JsonSetter;';
$imports[] = 'import com.fasterxml.jackson.annotation.*;';

return $imports;
}
Expand Down

0 comments on commit afa47a9

Please sign in to comment.