summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2024-03-14 16:19:21 +0100
committerGitHub <noreply@github.com>2024-03-14 16:19:21 +0100
commit380f456c146f0b312f728b7b43e41650f4a8e1e1 (patch)
tree3ea85467e68fdfd0ac7cf0eda291cb1095286460
parentb197842ae23df0f5de7107a4b3ce9cfe5f4ab3db (diff)
parent7d46ee503069045463ab7b58837944ee33c8e582 (diff)
Merge pull request #11802 from nextcloud/bugfix/noid/better-parameter-types
fix(openapi): Provide better message parameter definitions
-rw-r--r--lib/ResponseDefinitions.php30
-rw-r--r--openapi-backend-sipbridge.json106
-rw-r--r--openapi-federation.json106
-rw-r--r--openapi-full.json106
-rw-r--r--openapi.json106
-rw-r--r--src/types/openapi/openapi-backend-sipbridge.ts37
-rw-r--r--src/types/openapi/openapi-federation.ts37
-rw-r--r--src/types/openapi/openapi-full.ts37
-rw-r--r--src/types/openapi/openapi.ts37
9 files changed, 544 insertions, 58 deletions
diff --git a/lib/ResponseDefinitions.php b/lib/ResponseDefinitions.php
index 4189222da..263f3deb2 100644
--- a/lib/ResponseDefinitions.php
+++ b/lib/ResponseDefinitions.php
@@ -67,6 +67,32 @@ namespace OCA\Talk;
* statusMessage: ?string,
* }
*
+ * @psalm-type TalkRichObjectParameter = array{
+ * type: string,
+ * id: string,
+ * name: string,
+ * server?: string,
+ * link?: string,
+ * 'call-type'?: 'one2one'|'group'|'public',
+ * 'icon-url'?: string,
+ * 'message-id'?: string,
+ * boardname?: string,
+ * stackname?: string,
+ * size?: string,
+ * path?: string,
+ * mimetype?: string,
+ * 'preview-available'?: 'yes'|'no',
+ * mtime?: string,
+ * latitude?: string,
+ * longitude?: string,
+ * description?: string,
+ * thumb?: string,
+ * website?: string,
+ * visibility?: '0'|'1',
+ * assignable?: '0'|'1',
+ * conversation?: string,
+ * }
+ *
* @psalm-type TalkChatMessage = array{
* actorDisplayName: string,
* actorId: string,
@@ -77,7 +103,7 @@ namespace OCA\Talk;
* isReplyable: bool,
* markdown: bool,
* message: string,
- * messageParameters: array<string, array<string, mixed>>,
+ * messageParameters: array<string, TalkRichObjectParameter>,
* messageType: string,
* reactions: array<string, integer>|\stdClass,
* referenceId: string,
@@ -97,7 +123,7 @@ namespace OCA\Talk;
* actorType: string,
* expirationTimestamp: int,
* message: string,
- * messageParameters: array<string, array<string, mixed>>,
+ * messageParameters: array<string, TalkRichObjectParameter>,
* messageType: string,
* systemMessage: string,
* }
diff --git a/openapi-backend-sipbridge.json b/openapi-backend-sipbridge.json
index 109f038f0..6af28b900 100644
--- a/openapi-backend-sipbridge.json
+++ b/openapi-backend-sipbridge.json
@@ -263,10 +263,7 @@
"messageParameters": {
"type": "object",
"additionalProperties": {
- "type": "object",
- "additionalProperties": {
- "type": "object"
- }
+ "$ref": "#/components/schemas/RichObjectParameter"
}
},
"messageType": {
@@ -353,6 +350,102 @@
}
]
},
+ "RichObjectParameter": {
+ "type": "object",
+ "required": [
+ "type",
+ "id",
+ "name"
+ ],
+ "properties": {
+ "type": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "server": {
+ "type": "string"
+ },
+ "link": {
+ "type": "string"
+ },
+ "call-type": {
+ "type": "string",
+ "enum": [
+ "one2one",
+ "group",
+ "public"
+ ]
+ },
+ "icon-url": {
+ "type": "string"
+ },
+ "message-id": {
+ "type": "string"
+ },
+ "boardname": {
+ "type": "string"
+ },
+ "stackname": {
+ "type": "string"
+ },
+ "size": {
+ "type": "string"
+ },
+ "path": {
+ "type": "string"
+ },
+ "mimetype": {
+ "type": "string"
+ },
+ "preview-available": {
+ "type": "string",
+ "enum": [
+ "yes",
+ "no"
+ ]
+ },
+ "mtime": {
+ "type": "string"
+ },
+ "latitude": {
+ "type": "string"
+ },
+ "longitude": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "thumb": {
+ "type": "string"
+ },
+ "website": {
+ "type": "string"
+ },
+ "visibility": {
+ "type": "string",
+ "enum": [
+ "0",
+ "1"
+ ]
+ },
+ "assignable": {
+ "type": "string",
+ "enum": [
+ "0",
+ "1"
+ ]
+ },
+ "conversation": {
+ "type": "string"
+ }
+ }
+ },
"Room": {
"type": "object",
"required": [
@@ -655,10 +748,7 @@
"messageParameters": {
"type": "object",
"additionalProperties": {
- "type": "object",
- "additionalProperties": {
- "type": "object"
- }
+ "$ref": "#/components/schemas/RichObjectParameter"
}
},
"messageType": {
diff --git a/openapi-federation.json b/openapi-federation.json
index 7336aaa20..73c525706 100644
--- a/openapi-federation.json
+++ b/openapi-federation.json
@@ -263,10 +263,7 @@
"messageParameters": {
"type": "object",
"additionalProperties": {
- "type": "object",
- "additionalProperties": {
- "type": "object"
- }
+ "$ref": "#/components/schemas/RichObjectParameter"
}
},
"messageType": {
@@ -407,6 +404,102 @@
}
]
},
+ "RichObjectParameter": {
+ "type": "object",
+ "required": [
+ "type",
+ "id",
+ "name"
+ ],
+ "properties": {
+ "type": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "server": {
+ "type": "string"
+ },
+ "link": {
+ "type": "string"
+ },
+ "call-type": {
+ "type": "string",
+ "enum": [
+ "one2one",
+ "group",
+ "public"
+ ]
+ },
+ "icon-url": {
+ "type": "string"
+ },
+ "message-id": {
+ "type": "string"
+ },
+ "boardname": {
+ "type": "string"
+ },
+ "stackname": {
+ "type": "string"
+ },
+ "size": {
+ "type": "string"
+ },
+ "path": {
+ "type": "string"
+ },
+ "mimetype": {
+ "type": "string"
+ },
+ "preview-available": {
+ "type": "string",
+ "enum": [
+ "yes",
+ "no"
+ ]
+ },
+ "mtime": {
+ "type": "string"
+ },
+ "latitude": {
+ "type": "string"
+ },
+ "longitude": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "thumb": {
+ "type": "string"
+ },
+ "website": {
+ "type": "string"
+ },
+ "visibility": {
+ "type": "string",
+ "enum": [
+ "0",
+ "1"
+ ]
+ },
+ "assignable": {
+ "type": "string",
+ "enum": [
+ "0",
+ "1"
+ ]
+ },
+ "conversation": {
+ "type": "string"
+ }
+ }
+ },
"Room": {
"type": "object",
"required": [
@@ -709,10 +802,7 @@
"messageParameters": {
"type": "object",
"additionalProperties": {
- "type": "object",
- "additionalProperties": {
- "type": "object"
- }
+ "$ref": "#/components/schemas/RichObjectParameter"
}
},
"messageType": {
diff --git a/openapi-full.json b/openapi-full.json
index cef8274f8..cec04ca57 100644
--- a/openapi-full.json
+++ b/openapi-full.json
@@ -424,10 +424,7 @@
"messageParameters": {
"type": "object",
"additionalProperties": {
- "type": "object",
- "additionalProperties": {
- "type": "object"
- }
+ "$ref": "#/components/schemas/RichObjectParameter"
}
},
"messageType": {
@@ -872,6 +869,102 @@
}
}
},
+ "RichObjectParameter": {
+ "type": "object",
+ "required": [
+ "type",
+ "id",
+ "name"
+ ],
+ "properties": {
+ "type": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "server": {
+ "type": "string"
+ },
+ "link": {
+ "type": "string"
+ },
+ "call-type": {
+ "type": "string",
+ "enum": [
+ "one2one",
+ "group",
+ "public"
+ ]
+ },
+ "icon-url": {
+ "type": "string"
+ },
+ "message-id": {
+ "type": "string"
+ },
+ "boardname": {
+ "type": "string"
+ },
+ "stackname": {
+ "type": "string"
+ },
+ "size": {
+ "type": "string"
+ },
+ "path": {
+ "type": "string"
+ },
+ "mimetype": {
+ "type": "string"
+ },
+ "preview-available": {
+ "type": "string",
+ "enum": [
+ "yes",
+ "no"
+ ]
+ },
+ "mtime": {
+ "type": "string"
+ },
+ "latitude": {
+ "type": "string"
+ },
+ "longitude": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "thumb": {
+ "type": "string"
+ },
+ "website": {
+ "type": "string"
+ },
+ "visibility": {
+ "type": "string",
+ "enum": [
+ "0",
+ "1"
+ ]
+ },
+ "assignable": {
+ "type": "string",
+ "enum": [
+ "0",
+ "1"
+ ]
+ },
+ "conversation": {
+ "type": "string"
+ }
+ }
+ },
"Room": {
"type": "object",
"required": [
@@ -1174,10 +1267,7 @@
"messageParameters": {
"type": "object",
"additionalProperties": {
- "type": "object",
- "additionalProperties": {
- "type": "object"
- }
+ "$ref": "#/components/schemas/RichObjectParameter"
}
},
"messageType": {
diff --git a/openapi.json b/openapi.json
index 9f7862926..93fb28bc7 100644
--- a/openapi.json
+++ b/openapi.json
@@ -365,10 +365,7 @@
"messageParameters": {
"type": "object",
"additionalProperties": {
- "type": "object",
- "additionalProperties": {
- "type": "object"
- }
+ "$ref": "#/components/schemas/RichObjectParameter"
}
},
"messageType": {
@@ -759,6 +756,102 @@
}
}
},
+ "RichObjectParameter": {
+ "type": "object",
+ "required": [
+ "type",
+ "id",
+ "name"
+ ],
+ "properties": {
+ "type": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "server": {
+ "type": "string"
+ },
+ "link": {
+ "type": "string"
+ },
+ "call-type": {
+ "type": "string",
+ "enum": [
+ "one2one",
+ "group",
+ "public"
+ ]
+ },
+ "icon-url": {
+ "type": "string"
+ },
+ "message-id": {
+ "type": "string"
+ },
+ "boardname": {
+ "type": "string"
+ },
+ "stackname": {
+ "type": "string"
+ },
+ "size": {
+ "type": "string"
+ },
+ "path": {
+ "type": "string"
+ },
+ "mimetype": {
+ "type": "string"
+ },
+ "preview-available": {
+ "type": "string",
+ "enum": [
+ "yes",
+ "no"
+ ]
+ },
+ "mtime": {
+ "type": "string"
+ },
+ "latitude": {