Skip to content

Commit

Permalink
allow schema source
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskapp committed Dec 30, 2024
1 parent 02163d9 commit 818e0a7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
use PSX\Schema\Exception\InvalidSchemaException;
use PSX\Schema\Exception\TraverserException;
use PSX\Schema\SchemaInterface;
use PSX\Schema\SchemaSource;
use PSX\Schema\SchemaTraverser;
use PSX\Schema\Visitor\TypeVisitor;
use PSX\Schema\VisitorInterface as SchemaVisitorInterface;
Expand Down Expand Up @@ -238,7 +239,7 @@ protected function getDefaultTransformer(?string $contentType): ?TransformerInte
*/
protected function getSchema(mixed $schema): SchemaInterface
{
if (is_string($schema)) {
if (is_string($schema) || $schema instanceof SchemaSource) {
return $this->config->getSchemaManager()->getSchema($schema);
} elseif ($schema instanceof SchemaInterface) {
return $schema;
Expand Down

0 comments on commit 818e0a7

Please sign in to comment.