From 7a8ffacae21595b12c1bb6ce212abfeb292012e6 Mon Sep 17 00:00:00 2001 From: Chris Lloyd Date: Sat, 23 Mar 2024 13:26:46 +0000 Subject: [PATCH] WIP --- src/PathSegment/OpenAPI.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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];