This commit is contained in:
2023-01-11 15:28:47 +01:00
parent 4c51403daa
commit 05fd209204
7 changed files with 61 additions and 5 deletions

View File

@@ -77,7 +77,12 @@ class Parameter {
public function getTypeName(): string {
$typeName = Parameter::names[$this->type] ?? "INVALID";
if ($this->choices) {
$typeName .= ", choices: " . json_encode($this->choices);
$typeName .= ", choices=" . json_encode($this->choices);
}
$format = $this->getSwaggerFormat();
if ($format && $this->type !== self::TYPE_EMAIL) {
$typeName .= ", format='$format'";
}
return $typeName;

View File

@@ -12,7 +12,8 @@ use Core\Objects\DatabaseEntity\User;
trait Pagination {
static function getPaginationParameters(array $orderColumns, string $defaultOrderBy = "id", string $defaultSortOrder = "asc"): array {
function getPaginationParameters(array $orderColumns, string $defaultOrderBy = "id", string $defaultSortOrder = "asc"): array {
$this->paginationOrderColumns = $orderColumns;
return [
'page' => new Parameter('page', Parameter::TYPE_INT, true, 1),
'count' => new Parameter('count', Parameter::TYPE_INT, true, 20),