Skip to content

Commit 81f4419

Browse files
committed
Added service descriptions
1 parent 8662a88 commit 81f4419

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

specs/swagger-appwrite.0.7.0.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/Spec/Swagger2.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ public function getServices()
9696
$list = [];
9797

9898
$paths = $this->getAttribute('paths', []);
99+
$tags = $this->getAttribute('tags', []);
99100

100101
foreach ($paths as $path) {
101102
foreach ($path as $method) {
@@ -112,6 +113,14 @@ public function getServices()
112113
}
113114
}
114115

116+
foreach($tags as $tag) { // Fetch descriptions
117+
$name = $tag['name'];
118+
119+
if(isset($list[$name])) {
120+
$list[$name]['description'] = $tag['description'] ?? '';
121+
}
122+
}
123+
115124
return $list;
116125
}
117126

0 commit comments

Comments
 (0)