diff --git a/src/Appwrite/SDK/Specification/Format/OpenAPI3.php b/src/Appwrite/SDK/Specification/Format/OpenAPI3.php index 4410385545..294e2d72ca 100644 --- a/src/Appwrite/SDK/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/SDK/Specification/Format/OpenAPI3.php @@ -731,9 +731,9 @@ class OpenAPI3 extends Format $node['schema']['format'] = 'url'; $node['schema']['example'] = ($param['example'] ?? '') !== '' ? $param['example'] : 'https://example.com'; break; - case \Utopia\Validator\JSON::class: - case \Utopia\Validator\JSON\ObjectValidator::class: case \Utopia\Validator\Assoc::class: + // Assoc reports TYPE_ARRAY, so only an explicit case publishes + // it as an object. TYPE_OBJECT is handled by the default. $node['schema']['type'] = 'object'; $node['schema']['default'] = (empty($param['default'])) ? new \stdClass() : $param['default']; $node['schema']['example'] = ($param['example'] ?? '') !== '' ? $param['example'] : '{}'; @@ -943,10 +943,6 @@ class OpenAPI3 extends Format } break; default: - // The cases above match on the concrete validator class, so a - // validator that declares itself an object but is not listed - // reaches here and would be published as a string. That is how - // JSON\FCM narrowed serviceAccountJSON in every generated SDK. if ($validator->getType() === Validator::TYPE_OBJECT) { $node['schema']['type'] = 'object'; $node['schema']['default'] = empty($param['default']) ? new \stdClass() : $param['default'];