1
0
Fork 0
mirror of synced 2024-06-11 23:34:45 +12:00

Merge pull request #2547 from appwrite/fix-specs-the-third

fix: specifications definitions
This commit is contained in:
Torsten Dittmann 2022-01-04 12:20:36 +01:00 committed by GitHub
commit 0c87e4ca02
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 22 additions and 27 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -353,6 +353,7 @@ $logs = $this->getParam('logs', null);
<span data-ls-if="{{index.status}} == 'processing'" class="text-size-small text-info">processing&nbsp;</span>
<span data-ls-if="{{index.status}} == 'failed'" class="text-size-small text-danger">failed&nbsp;</span>
<span data-ls-if="{{index.status}} == 'deleting'" class="text-size-small text-danger">deleting&nbsp;</span>
<span data-ls-if="{{index.status}} == 'stuck'" class="text-size-small text-danger">stuck&nbsp;</span>
</td>
<td data-title="Index Key: ">

View file

@ -29,7 +29,7 @@ class OpenAPI3 extends Format
*/
public function parse(): array
{
/*
/**
* Specifications (v3.0.0):
* https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md
*/
@ -393,20 +393,18 @@ 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'])) {
if(\is_array($rule['type'])) {
foreach ($rule['type'] as $value) {
$usedModels[] = $value;
}
}
else {
$usedModels[] = $rule['type'];
}
if (
in_array($model->getType(), $usedModels)
&& !in_array($rule['type'], ['string', 'integer', 'boolean', 'json', 'float'])
) {
$usedModels[] = $rule['type'];
}
}
}
foreach ($this->models as $model) {
if (!in_array($model->getType(), $usedModels) && $model->getType() !== 'error') {
continue;

View file

@ -392,15 +392,11 @@ class Swagger2 extends Format
foreach ($this->models as $model) {
foreach ($model->getRules() as $rule) {
if (!in_array($rule['type'], ['string', 'integer', 'boolean', 'json', 'float'])) {
if(\is_array($rule['type'])) {
foreach ($rule['type'] as $value) {
$usedModels[] = $value;
}
}
else {
$usedModels[] = $rule['type'];
}
if (
in_array($model->getType(), $usedModels)
&& !in_array($rule['type'], ['string', 'integer', 'boolean', 'json', 'float'])
) {
$usedModels[] = $rule['type'];
}
}
}