Skip to content

Commit 881bd00

Browse files
committed
chore(main): check if schema exists
1 parent c328539 commit 881bd00

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

app/Methods/PapiMethods.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,10 @@ public static function getSchemaArrayFromSpecObject(?SpecBaseObject $object)
343343
if ($object !== null) {
344344
$schema = [];
345345
if (isset($object->content['application/json'])) {
346-
$schema = $object->content['application/json']->getSerializableData()->schema;
346+
$serialized_data = $object->content['application/json']->getSerializableData();
347+
if (isset($serialized_data->schema)) {
348+
$schema = $serialized_data->schema;
349+
}
347350
}
348351
return PapiMethods::objectToArray($schema);
349352
} else {

0 commit comments

Comments
 (0)