We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c988145 commit 8ea1cc8Copy full SHA for 8ea1cc8
src/Definitions/DefinitionGenerator.php
@@ -161,10 +161,10 @@ function generateSchemas(): array {
161
$type = $returnType->getName();
162
163
if (Str::contains($type, '\\')) {
164
- $data = [
165
- 'type' => 'object',
166
- '$ref' => '#/components/schemas/' . last(explode('\\', $type)),
167
- ];
+ $data = ['type' => 'object'];
+ if (is_subclass_of($type, Model::class)) {
+ $data['$ref'] = '#/components/schemas/' . last(explode('\\', $type));
+ }
168
} else {
169
$data['type'] = $type;
170
$this->addExampleKey($data);
0 commit comments