Skip to content

Commit

Permalink
add toProperty method
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskapp committed Oct 9, 2024
1 parent ea9063d commit 5b419f9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Generator/JsonSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
use PSX\Schema\Type\Factory\PropertyTypeFactory;
use PSX\Schema\Type\GenericPropertyType;
use PSX\Schema\Type\MapTypeInterface;
use PSX\Schema\Type\PropertyTypeAbstract;
use PSX\Schema\Type\ReferencePropertyType;
use PSX\Schema\Type\StructDefinitionType;
use PSX\Schema\TypeInterface;
Expand Down Expand Up @@ -76,6 +77,11 @@ public function toArray(DefinitionsInterface $definitions, ?string $root): array
return array_merge($result, $object);
}

public function toProperty(PropertyTypeAbstract $type, DefinitionsInterface $definitions): mixed
{
return $this->generateType($type, $definitions);
}

protected function generateDefinitions(DefinitionsInterface $definitions): array
{
$result = [];
Expand Down

0 comments on commit 5b419f9

Please sign in to comment.