aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorjld3103 <jld3103yt@gmail.com>2023-03-15 17:29:32 +0100
committerjld3103 <jld3103yt@gmail.com>2023-07-13 07:24:15 +0200
commit1be836273ddba6e0ddb3509a1d898535df9fd169 (patch)
tree5aa57fed3c2173484ffcd082f61aaef5015fc3f3 /lib
parent706c141fffce928d344fe2f039da549fad065393 (diff)
downloadnextcloud-server-1be836273ddba6e0ddb3509a1d898535df9fd169.tar.gz
nextcloud-server-1be836273ddba6e0ddb3509a1d898535df9fd169.zip
core: Add OpenAPI spec
Signed-off-by: jld3103 <jld3103yt@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/CapabilitiesManager.php2
-rw-r--r--lib/private/Contacts/ContactsMenu/Actions/LinkAction.php3
-rw-r--r--lib/private/Contacts/ContactsMenu/Entry.php3
-rw-r--r--lib/private/Updater/ChangesCheck.php1
-rw-r--r--lib/public/Collaboration/Reference/Reference.php4
-rw-r--r--lib/public/Translation/LanguageTuple.php1
6 files changed, 13 insertions, 1 deletions
diff --git a/lib/private/CapabilitiesManager.php b/lib/private/CapabilitiesManager.php
index 9e63798475b..7885a98869d 100644
--- a/lib/private/CapabilitiesManager.php
+++ b/lib/private/CapabilitiesManager.php
@@ -50,7 +50,7 @@ class CapabilitiesManager {
*
* @param bool $public get public capabilities only
* @throws \InvalidArgumentException
- * @return array
+ * @return array<string, mixed>
*/
public function getCapabilities(bool $public = false, bool $initialState = false) : array {
$capabilities = [];
diff --git a/lib/private/Contacts/ContactsMenu/Actions/LinkAction.php b/lib/private/Contacts/ContactsMenu/Actions/LinkAction.php
index 9fc021435a4..e0d3515f421 100644
--- a/lib/private/Contacts/ContactsMenu/Actions/LinkAction.php
+++ b/lib/private/Contacts/ContactsMenu/Actions/LinkAction.php
@@ -76,6 +76,9 @@ class LinkAction implements ILinkAction {
return $this->appId;
}
+ /**
+ * @return array{title: string, icon: string, hyperlink: string, appId: string}
+ */
public function jsonSerialize(): array {
return [
'title' => $this->name,
diff --git a/lib/private/Contacts/ContactsMenu/Entry.php b/lib/private/Contacts/ContactsMenu/Entry.php
index 649c83ae7d8..f1cb4f9c52f 100644
--- a/lib/private/Contacts/ContactsMenu/Entry.php
+++ b/lib/private/Contacts/ContactsMenu/Entry.php
@@ -141,6 +141,9 @@ class Entry implements IEntry {
return $this->properties[$key];
}
+ /**
+ * @return array{id: int|string|null, fullName: string, avatar: string|null, topAction: mixed, actions: array, lastMessage: '', emailAddresses: string[], profileTitle: string|null, profileUrl: string|null}
+ */
public function jsonSerialize(): array {
$topAction = !empty($this->actions) ? $this->actions[0]->jsonSerialize() : null;
$otherActions = array_map(function (IAction $action) {
diff --git a/lib/private/Updater/ChangesCheck.php b/lib/private/Updater/ChangesCheck.php
index 2c1eb321ee0..ee4d1f1fcee 100644
--- a/lib/private/Updater/ChangesCheck.php
+++ b/lib/private/Updater/ChangesCheck.php
@@ -51,6 +51,7 @@ class ChangesCheck {
/**
* @throws DoesNotExistException
+ * @return array{changelogURL: string, whatsNew: array<string, array{admin: string[], regular: string[]}>}
*/
public function getChangesForVersion(string $version): array {
$version = $this->normalizeVersion($version);
diff --git a/lib/public/Collaboration/Reference/Reference.php b/lib/public/Collaboration/Reference/Reference.php
index 6b92a0fae52..0dcb665713c 100644
--- a/lib/public/Collaboration/Reference/Reference.php
+++ b/lib/public/Collaboration/Reference/Reference.php
@@ -27,6 +27,7 @@ namespace OCP\Collaboration\Reference;
/**
* @since 25.0.0
+ * @psalm-type OpenGraphObject = array{id: string, name: string, description: ?string, thumb: ?string, link: string}
*/
class Reference implements IReference {
protected string $reference;
@@ -176,6 +177,7 @@ class Reference implements IReference {
/**
* @inheritdoc
* @since 25.0.0
+ * @return array<string, mixed>
*/
public function getRichObject(): array {
if ($this->richObject === null) {
@@ -187,6 +189,7 @@ class Reference implements IReference {
/**
* @inheritdoc
* @since 25.0.0
+ * @return OpenGraphObject
*/
public function getOpenGraphObject(): array {
return [
@@ -237,6 +240,7 @@ class Reference implements IReference {
/**
* @inheritdoc
* @since 25.0.0
+ * @return array{richObjectType: string, richObject: array<string, mixed>, openGraphObject: OpenGraphObject, accessible: bool}
*/
public function jsonSerialize() {
return [
diff --git a/lib/public/Translation/LanguageTuple.php b/lib/public/Translation/LanguageTuple.php
index 9defb17e4b6..27f932f0a64 100644
--- a/lib/public/Translation/LanguageTuple.php
+++ b/lib/public/Translation/LanguageTuple.php
@@ -45,6 +45,7 @@ class LanguageTuple implements JsonSerializable {
/**
* @since 26.0.0
+ * @return array{from: string, fromLabel: string, to: string, toLabel: string}
*/
public function jsonSerialize(): array {
return [