diff --git a/src/Appwrite/Specification/Format/OpenAPI3.php b/src/Appwrite/Specification/Format/OpenAPI3.php index 6b32f1005..591fda709 100644 --- a/src/Appwrite/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/Specification/Format/OpenAPI3.php @@ -310,7 +310,13 @@ class OpenAPI3 extends Format $output['paths'][$url][\strtolower($route->getMethod())] = $temp; } - + foreach ($this->models as $model) { + foreach ($model->getRules() as $rule) { + if (!in_array($rule['type'], ['string', 'integer', 'boolean', 'json', 'float'])) { + $usedModels[] = $rule['type']; + } + } + } foreach ($this->models as $model) { if (!in_array($model->getType(), $usedModels)) { continue; diff --git a/src/Appwrite/Specification/Format/Swagger2.php b/src/Appwrite/Specification/Format/Swagger2.php index b91546693..0e639e9a8 100644 --- a/src/Appwrite/Specification/Format/Swagger2.php +++ b/src/Appwrite/Specification/Format/Swagger2.php @@ -4,6 +4,7 @@ namespace Appwrite\Specification\Format; use Appwrite\Specification\Format; use Appwrite\Template\Template; +use Appwrite\Utopia\Response\Model; use stdClass; class Swagger2 extends Format @@ -311,7 +312,13 @@ class Swagger2 extends Format $output['paths'][$url][\strtolower($route->getMethod())] = $temp; } - + foreach ($this->models as $model) { + foreach ($model->getRules() as $rule) { + if (!in_array($rule['type'], ['string', 'integer', 'boolean', 'json', 'float'])) { + $usedModels[] = $rule['type']; + } + } + } foreach ($this->models as $model) { if (!in_array($model->getType(), $usedModels)) { continue;