From d61f4e4d2da8b90c2c225fb72f374488d49a1ec0 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 20 Feb 2024 20:15:08 +1300 Subject: [PATCH] Add compound UID to spec generator --- src/Appwrite/Specification/Format/OpenAPI3.php | 4 ++++ src/Appwrite/Specification/Format/Swagger2.php | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/Appwrite/Specification/Format/OpenAPI3.php b/src/Appwrite/Specification/Format/OpenAPI3.php index 6672631ff..b405ec6d1 100644 --- a/src/Appwrite/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/Specification/Format/OpenAPI3.php @@ -451,6 +451,10 @@ class OpenAPI3 extends Format $node['format'] = 'int32'; } break; + case 'Appwrite\Utopia\Database\Validator\CompoundUID': + $node['schema']['type'] = $validator->getType(); + $node['schema']['x-example'] = '[ID1:ID2]'; + break; default: $node['schema']['type'] = 'string'; break; diff --git a/src/Appwrite/Specification/Format/Swagger2.php b/src/Appwrite/Specification/Format/Swagger2.php index 20aeb9622..b2ccef6c0 100644 --- a/src/Appwrite/Specification/Format/Swagger2.php +++ b/src/Appwrite/Specification/Format/Swagger2.php @@ -446,6 +446,10 @@ class Swagger2 extends Format $node['format'] = 'int32'; } break; + case 'Appwrite\Utopia\Database\Validator\CompoundUID': + $node['type'] = $validator->getType(); + $node['x-example'] = '[ID1:ID2]'; + break; default: $node['type'] = 'string'; break;