Skip to content

Commit 8d80361

Browse files
committed
mevdschee#571 Added support for multiple filters
1 parent 30a0712 commit 8d80361

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

src/Tqdev/PhpCrudApi/OpenApi/OpenApiRecordsBuilder.php

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ private function setPath(string $tableName) /*: void*/
133133
if (in_array($operation, ['list', 'create'])) {
134134
$path = sprintf('/records/%s', $tableName);
135135
if ($operation == 'list') {
136-
$parameters = ['filter', 'include', 'exclude', 'order', 'size', 'page', 'join'];
136+
$parameters = ['filter', 'filter1', 'filter2', 'filter3', 'include', 'exclude', 'order', 'size', 'page', 'join'];
137137
}
138138
} else {
139139
$path = sprintf('/records/%s/{id}', $tableName);
@@ -336,6 +336,27 @@ private function setComponentParameters() /*: void*/
336336
$this->openapi->set("components|parameters|filter|description", "Filters to be applied. Each filter consists of a column, an operator and a value (comma separated). Example: id,eq,1");
337337
$this->openapi->set("components|parameters|filter|required", false);
338338

339+
$this->openapi->set("components|parameters|filter|name", "filter1");
340+
$this->openapi->set("components|parameters|filter|in", "query");
341+
$this->openapi->set("components|parameters|filter|schema|type", "array");
342+
$this->openapi->set("components|parameters|filter|schema|items|type", "string");
343+
$this->openapi->set("components|parameters|filter|description", "Filters to be applied. Each filter consists of a column, an operator and a value (comma separated). Example: id,eq,1");
344+
$this->openapi->set("components|parameters|filter|required", false);
345+
346+
$this->openapi->set("components|parameters|filter|name", "filter2");
347+
$this->openapi->set("components|parameters|filter|in", "query");
348+
$this->openapi->set("components|parameters|filter|schema|type", "array");
349+
$this->openapi->set("components|parameters|filter|schema|items|type", "string");
350+
$this->openapi->set("components|parameters|filter|description", "Filters to be applied. Each filter consists of a column, an operator and a value (comma separated). Example: id,eq,1");
351+
$this->openapi->set("components|parameters|filter|required", false);
352+
353+
$this->openapi->set("components|parameters|filter|name", "filter3");
354+
$this->openapi->set("components|parameters|filter|in", "query");
355+
$this->openapi->set("components|parameters|filter|schema|type", "array");
356+
$this->openapi->set("components|parameters|filter|schema|items|type", "string");
357+
$this->openapi->set("components|parameters|filter|description", "Filters to be applied. Each filter consists of a column, an operator and a value (comma separated). Example: id,eq,1");
358+
$this->openapi->set("components|parameters|filter|required", false);
359+
339360
$this->openapi->set("components|parameters|include|name", "include");
340361
$this->openapi->set("components|parameters|include|in", "query");
341362
$this->openapi->set("components|parameters|include|schema|type", "string");

0 commit comments

Comments
 (0)