From 773c14ab4354fa0cdaf0d33fe39f30087ce8e8cf Mon Sep 17 00:00:00 2001 From: wubiandaxian <49140684+wubiandaxian@users.noreply.github.com> Date: Fri, 28 Jul 2023 11:00:48 +0800 Subject: [PATCH] Fix lost type 'object' when create new allOfPropertiesSchema MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When merge allOf, a new schema "allOfPropertiesSchema" will be created, but this schema lost ”type“ property. This not feed the rules, and will cause some question when I use generate tool to create web api code which based the result json. --- src/Processors/AugmentSchemas.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Processors/AugmentSchemas.php b/src/Processors/AugmentSchemas.php index 44298fc1..b43ac0b9 100644 --- a/src/Processors/AugmentSchemas.php +++ b/src/Processors/AugmentSchemas.php @@ -131,6 +131,7 @@ protected function mergeAllOf(Analysis $analysis, array $schemas): void } if (!$allOfPropertiesSchema) { $allOfPropertiesSchema = new OA\Schema([ + 'type' => 'object', 'properties' => [], '_context' => new Context(['generated' => true], $schema->_context), ]);