diff --git a/src/PathSegment/OpenAPI.php b/src/PathSegment/OpenAPI.php index f37c9adb1..c9596f967 100644 --- a/src/PathSegment/OpenAPI.php +++ b/src/PathSegment/OpenAPI.php @@ -555,8 +555,10 @@ public function emitJson(Transaction $transaction): void foreach (Lodata::getComplexTypes() as $complexType) { $schemas->{$complexType->getIdentifier()} = $complexType->getOpenAPISchema(); - $schemas->{$complexType->getIdentifier().'-create'} = $complexType->getOpenAPICreateSchema(); - $schemas->{$complexType->getIdentifier().'-update'} = $complexType->getOpenAPIUpdateSchema(); + if (!config('lodata.readonly')) { + $schemas->{$complexType->getIdentifier().'-create'} = $complexType->getOpenAPICreateSchema(); + $schemas->{$complexType->getIdentifier().'-update'} = $complexType->getOpenAPIUpdateSchema(); + } } $schemas->{Identifier::from(ComplexType::identifier)} = ['type' => Constants::oapiObject];