Skip to content

Commit 2b53709

Browse files
authored
feat(openapi): document error outputs using json-schemas (#6923)
1 parent 3671f5b commit 2b53709

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Eloquent/Metadata/Factory/Property/EloquentPropertyMetadataFactory.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ public function __construct(
4646
*/
4747
public function create(string $resourceClass, string $property, array $options = []): ApiProperty
4848
{
49+
if (!is_a($resourceClass, Model::class, true)) {
50+
return $this->decorated?->create($resourceClass, $property, $options) ?? new ApiProperty();
51+
}
52+
4953
try {
5054
$refl = new \ReflectionClass($resourceClass);
5155
$model = $refl->newInstanceWithoutConstructor();

0 commit comments

Comments
 (0)