Skip to content

Commit 428153c

Browse files
Merge pull request #39272 from nextcloud/feature/openapi/sharebymail
sharebymail: Add OpenAPI spec
2 parents de3b6a2 + 9b822a5 commit 428153c

2 files changed

Lines changed: 123 additions & 0 deletions

File tree

apps/sharebymail/lib/Capabilities.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,27 @@ public function __construct(IManager $manager,
4545
$this->settingsManager = $settingsManager;
4646
}
4747

48+
/**
49+
* @return array{
50+
* files_sharing: array{
51+
* sharebymail: array{
52+
* enabled: bool,
53+
* send_password_by_mail: bool,
54+
* upload_files_drop: array{
55+
* enabled: bool,
56+
* },
57+
* password: array{
58+
* enabled: bool,
59+
* enforced: bool,
60+
* },
61+
* expire_date: array{
62+
* enabled: bool,
63+
* enforced: bool,
64+
* },
65+
* }
66+
* }
67+
* }
68+
*/
4869
public function getCapabilities(): array {
4970
return [
5071
'files_sharing' =>

apps/sharebymail/openapi.json

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
{
2+
"openapi": "3.0.3",
3+
"info": {
4+
"title": "sharebymail",
5+
"version": "0.0.1",
6+
"description": "Share provider which allows you to share files by mail",
7+
"license": {
8+
"name": "agpl"
9+
}
10+
},
11+
"components": {
12+
"securitySchemes": {
13+
"basic_auth": {
14+
"type": "http",
15+
"scheme": "basic"
16+
},
17+
"bearer_auth": {
18+
"type": "http",
19+
"scheme": "bearer"
20+
}
21+
},
22+
"schemas": {
23+
"Capabilities": {
24+
"type": "object",
25+
"required": [
26+
"files_sharing"
27+
],
28+
"properties": {
29+
"files_sharing": {
30+
"type": "object",
31+
"required": [
32+
"sharebymail"
33+
],
34+
"properties": {
35+
"sharebymail": {
36+
"type": "object",
37+
"required": [
38+
"enabled",
39+
"send_password_by_mail",
40+
"upload_files_drop",
41+
"password",
42+
"expire_date"
43+
],
44+
"properties": {
45+
"enabled": {
46+
"type": "boolean"
47+
},
48+
"send_password_by_mail": {
49+
"type": "boolean"
50+
},
51+
"upload_files_drop": {
52+
"type": "object",
53+
"required": [
54+
"enabled"
55+
],
56+
"properties": {
57+
"enabled": {
58+
"type": "boolean"
59+
}
60+
}
61+
},
62+
"password": {
63+
"type": "object",
64+
"required": [
65+
"enabled",
66+
"enforced"
67+
],
68+
"properties": {
69+
"enabled": {
70+
"type": "boolean"
71+
},
72+
"enforced": {
73+
"type": "boolean"
74+
}
75+
}
76+
},
77+
"expire_date": {
78+
"type": "object",
79+
"required": [
80+
"enabled",
81+
"enforced"
82+
],
83+
"properties": {
84+
"enabled": {
85+
"type": "boolean"
86+
},
87+
"enforced": {
88+
"type": "boolean"
89+
}
90+
}
91+
}
92+
}
93+
}
94+
}
95+
}
96+
}
97+
}
98+
}
99+
},
100+
"paths": {},
101+
"tags": []
102+
}

0 commit comments

Comments
 (0)