Skip to content

Commit 8b814f8

Browse files
docs(tables): update OpenAPI spec for column_order and sort on table
AI-assistant: GitHub Copilot v0.43.0 (Claude Sonnet 4.6) Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
1 parent d7ad33e commit 8b814f8

4 files changed

Lines changed: 215 additions & 1 deletion

File tree

lib/Controller/ApiTablesController.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ public function showScheme(int $id): DataResponse {
130130
* @param string $description description
131131
* @param list<TablesColumn> $columns columns
132132
* @param list<TablesView> $views views
133+
* @param list<array{columnId: int, order: int, readonly: bool}> $columnOrder Default column order settings
134+
* @param list<array{columnId: int, mode: 'ASC'|'DESC'}> $sort Default sort rules
133135
* @return DataResponse<Http::STATUS_OK, TablesTable, array{}>|DataResponse<Http::STATUS_INTERNAL_SERVER_ERROR, array{message: string}, array{}>
134136
*
135137
* 200: Tables returned
@@ -277,6 +279,8 @@ public function create(string $title, ?string $emoji, ?string $description, stri
277279
* @param string|null $emoji New table emoji
278280
* @param bool $archived whether the table is archived
279281
* @param string $description the tables description
282+
* @param list<array{columnId: int, order: int, readonly: bool}>|null $columnSettings Default column order settings
283+
* @param list<array{columnId: int, mode: 'ASC'|'DESC'}>|null $sort Default sort rules
280284
* @return DataResponse<Http::STATUS_OK, TablesTable, array{}>|DataResponse<Http::STATUS_FORBIDDEN|Http::STATUS_INTERNAL_SERVER_ERROR|Http::STATUS_NOT_FOUND, array{message: string}, array{}>
281285
*
282286
* 200: Tables returned

lib/ResponseDefinitions.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@
6666
* rowsCount: int,
6767
* views: list<TablesView>,
6868
* columnsCount: int,
69+
* columnOrder: list<array{columnId: int, order: int, readonly: bool}>,
70+
* sort: list<array{columnId: int, mode: 'ASC'|'DESC'}>,
6971
* }
7072
*
7173
* @psalm-type TablesIndex = array{

openapi.json

Lines changed: 154 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,9 @@
757757
"hasShares",
758758
"rowsCount",
759759
"views",
760-
"columnsCount"
760+
"columnsCount",
761+
"columnOrder",
762+
"sort"
761763
],
762764
"properties": {
763765
"id": {
@@ -842,6 +844,53 @@
842844
"columnsCount": {
843845
"type": "integer",
844846
"format": "int64"
847+
},
848+
"columnOrder": {
849+
"type": "array",
850+
"items": {
851+
"type": "object",
852+
"required": [
853+
"columnId",
854+
"order",
855+
"readonly"
856+
],
857+
"properties": {
858+
"columnId": {
859+
"type": "integer",
860+
"format": "int64"
861+
},
862+
"order": {
863+
"type": "integer",
864+
"format": "int64"
865+
},
866+
"readonly": {
867+
"type": "boolean"
868+
}
869+
}
870+
}
871+
},
872+
"sort": {
873+
"type": "array",
874+
"items": {
875+
"type": "object",
876+
"required": [
877+
"columnId",
878+
"mode"
879+
],
880+
"properties": {
881+
"columnId": {
882+
"type": "integer",
883+
"format": "int64"
884+
},
885+
"mode": {
886+
"type": "string",
887+
"enum": [
888+
"ASC",
889+
"DESC"
890+
]
891+
}
892+
}
893+
}
845894
}
846895
}
847896
},
@@ -6913,6 +6962,59 @@
69136962
"type": "boolean",
69146963
"default": null,
69156964
"description": "whether the table is archived"
6965+
},
6966+
"columnSettings": {
6967+
"type": "array",
6968+
"nullable": true,
6969+
"default": null,
6970+
"description": "Default column order settings",
6971+
"items": {
6972+
"type": "object",
6973+
"required": [
6974+
"columnId",
6975+
"order",
6976+
"readonly"
6977+
],
6978+
"properties": {
6979+
"columnId": {
6980+
"type": "integer",
6981+
"format": "int64"
6982+
},
6983+
"order": {
6984+
"type": "integer",
6985+
"format": "int64"
6986+
},
6987+
"readonly": {
6988+
"type": "boolean"
6989+
}
6990+
}
6991+
}
6992+
},
6993+
"sort": {
6994+
"type": "array",
6995+
"nullable": true,
6996+
"default": null,
6997+
"description": "Default sort rules",
6998+
"items": {
6999+
"type": "object",
7000+
"required": [
7001+
"columnId",
7002+
"mode"
7003+
],
7004+
"properties": {
7005+
"columnId": {
7006+
"type": "integer",
7007+
"format": "int64"
7008+
},
7009+
"mode": {
7010+
"type": "string",
7011+
"enum": [
7012+
"ASC",
7013+
"DESC"
7014+
]
7015+
}
7016+
}
7017+
}
69167018
}
69177019
}
69187020
}
@@ -7595,6 +7697,57 @@
75957697
"items": {
75967698
"$ref": "#/components/schemas/View"
75977699
}
7700+
},
7701+
"columnOrder": {
7702+
"type": "array",
7703+
"default": [],
7704+
"description": "Default column order settings",
7705+
"items": {
7706+
"type": "object",
7707+
"required": [
7708+
"columnId",
7709+
"order",
7710+
"readonly"
7711+
],
7712+
"properties": {
7713+
"columnId": {
7714+
"type": "integer",
7715+
"format": "int64"
7716+
},
7717+
"order": {
7718+
"type": "integer",
7719+
"format": "int64"
7720+
},
7721+
"readonly": {
7722+
"type": "boolean"
7723+
}
7724+
}
7725+
}
7726+
},
7727+
"sort": {
7728+
"type": "array",
7729+
"default": [],
7730+
"description": "Default sort rules",
7731+
"items": {
7732+
"type": "object",
7733+
"required": [
7734+
"columnId",
7735+
"mode"
7736+
],
7737+
"properties": {
7738+
"columnId": {
7739+
"type": "integer",
7740+
"format": "int64"
7741+
},
7742+
"mode": {
7743+
"type": "string",
7744+
"enum": [
7745+
"ASC",
7746+
"DESC"
7747+
]
7748+
}
7749+
}
7750+
}
75987751
}
75997752
}
76007753
}

src/types/openapi/openapi.ts

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,6 +1135,19 @@ export type components = {
11351135
readonly views: readonly components["schemas"]["View"][];
11361136
/** Format: int64 */
11371137
readonly columnsCount: number;
1138+
readonly columnOrder: readonly {
1139+
/** Format: int64 */
1140+
readonly columnId: number;
1141+
/** Format: int64 */
1142+
readonly order: number;
1143+
readonly readonly: boolean;
1144+
}[];
1145+
readonly sort: readonly {
1146+
/** Format: int64 */
1147+
readonly columnId: number;
1148+
/** @enum {string} */
1149+
readonly mode: "ASC" | "DESC";
1150+
}[];
11381151
};
11391152
readonly View: {
11401153
/** Format: int64 */
@@ -4498,6 +4511,27 @@ export interface operations {
44984511
* @default null
44994512
*/
45004513
readonly archived?: boolean;
4514+
/**
4515+
* @description Default column order settings
4516+
* @default null
4517+
*/
4518+
readonly columnSettings?: readonly {
4519+
/** Format: int64 */
4520+
readonly columnId: number;
4521+
/** Format: int64 */
4522+
readonly order: number;
4523+
readonly readonly: boolean;
4524+
}[] | null;
4525+
/**
4526+
* @description Default sort rules
4527+
* @default null
4528+
*/
4529+
readonly sort?: readonly {
4530+
/** Format: int64 */
4531+
readonly columnId: number;
4532+
/** @enum {string} */
4533+
readonly mode: "ASC" | "DESC";
4534+
}[] | null;
45014535
};
45024536
};
45034537
};
@@ -4786,6 +4820,27 @@ export interface operations {
47864820
readonly columns: readonly components["schemas"]["Column"][];
47874821
/** @description views */
47884822
readonly views: readonly components["schemas"]["View"][];
4823+
/**
4824+
* @description Default column order settings
4825+
* @default []
4826+
*/
4827+
readonly columnOrder?: readonly {
4828+
/** Format: int64 */
4829+
readonly columnId: number;
4830+
/** Format: int64 */
4831+
readonly order: number;
4832+
readonly readonly: boolean;
4833+
}[];
4834+
/**
4835+
* @description Default sort rules
4836+
* @default []
4837+
*/
4838+
readonly sort?: readonly {
4839+
/** Format: int64 */
4840+
readonly columnId: number;
4841+
/** @enum {string} */
4842+
readonly mode: "ASC" | "DESC";
4843+
}[];
47894844
};
47904845
};
47914846
};

0 commit comments

Comments
 (0)