From 9c2b9fee1f12e89b156e009ab73a4ec63c3d5fed Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 1 Nov 2021 18:37:08 +0545 Subject: [PATCH 1/4] fix spec --- src/Appwrite/Specification/Format/Swagger2.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Appwrite/Specification/Format/Swagger2.php b/src/Appwrite/Specification/Format/Swagger2.php index 7a9822160a..7c45e9cb53 100644 --- a/src/Appwrite/Specification/Format/Swagger2.php +++ b/src/Appwrite/Specification/Format/Swagger2.php @@ -323,6 +323,13 @@ class Swagger2 extends Format 'type' => 'string', ]; break; + case 'Utopia\Database\Validator\Permissions': + $node['type'] = $validator->getType(); + $node['collectionFormat'] = 'multi'; + $node['items'] = [ + 'type' => 'string', + ]; + break; case 'Appwrite\Auth\Validator\Password': $node['type'] = $validator->getType(); $node['format'] = 'password'; From 404a3c5754c21a3a56f793ac26d7d7545337f398 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 2 Nov 2021 15:02:44 +0545 Subject: [PATCH 2/4] adding example --- src/Appwrite/Specification/Format/Swagger2.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Appwrite/Specification/Format/Swagger2.php b/src/Appwrite/Specification/Format/Swagger2.php index 7c45e9cb53..0155b1a683 100644 --- a/src/Appwrite/Specification/Format/Swagger2.php +++ b/src/Appwrite/Specification/Format/Swagger2.php @@ -329,6 +329,7 @@ class Swagger2 extends Format $node['items'] = [ 'type' => 'string', ]; + $node['x-example'] = '["role:all"]' break; case 'Appwrite\Auth\Validator\Password': $node['type'] = $validator->getType(); From 71baa6cd39bc1c263db457baa66bcfb6bb600efc Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Thu, 18 Nov 2021 17:34:54 +0545 Subject: [PATCH 3/4] permission model for openapi spec --- src/Appwrite/Specification/Format/OpenAPI3.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Appwrite/Specification/Format/OpenAPI3.php b/src/Appwrite/Specification/Format/OpenAPI3.php index 863a7a9627..b52c385039 100644 --- a/src/Appwrite/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/Specification/Format/OpenAPI3.php @@ -335,6 +335,12 @@ class OpenAPI3 extends Format 'type' => 'string', ]; break; + case 'Utopia\Database\Validator\Permissions': + $node['schema']['type'] = $validator->getType(); + $node['schema']['items'] = [ + 'type' => 'string', + ]; + break; case 'Appwrite\Auth\Validator\Password': $node['schema']['type'] = $validator->getType(); $node['schema']['format'] = 'password'; From adc1e3f2aff472cf1007301715e2d2907d5d9ef0 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Thu, 18 Nov 2021 18:32:54 +0545 Subject: [PATCH 4/4] missing semicolon --- src/Appwrite/Specification/Format/Swagger2.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Appwrite/Specification/Format/Swagger2.php b/src/Appwrite/Specification/Format/Swagger2.php index 0155b1a683..ab45ae401c 100644 --- a/src/Appwrite/Specification/Format/Swagger2.php +++ b/src/Appwrite/Specification/Format/Swagger2.php @@ -329,7 +329,7 @@ class Swagger2 extends Format $node['items'] = [ 'type' => 'string', ]; - $node['x-example'] = '["role:all"]' + $node['x-example'] = '["role:all"]'; break; case 'Appwrite\Auth\Validator\Password': $node['type'] = $validator->getType();