Skip to content

Commit 8d60dd8

Browse files
committed
Commit problem before lunch
1 parent fd01672 commit 8d60dd8

3 files changed

Lines changed: 92 additions & 0 deletions

File tree

tests/appinfo/routes.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
['name' => 'Settings#adminScope', 'url' => '/api/{apiVersion}/admin', 'verb' => 'POST', 'requirements' => ['apiVersion' => '(v2)']],
3333
['name' => 'Settings#doubleScope', 'url' => '/api/{apiVersion}/double', 'verb' => 'POST', 'requirements' => ['apiVersion' => '(v2)']],
3434
['name' => 'Settings#throwing', 'url' => '/api/{apiVersion}/throwing', 'verb' => 'POST', 'requirements' => ['apiVersion' => '(v2)']],
35+
['name' => 'Settings#nestedSchemas', 'url' => '/api/{apiVersion}/nested-schemas', 'verb' => 'POST', 'requirements' => ['apiVersion' => '(v2)']],
3536

3637
['name' => 'Settings2#defaultAdminScopeOverwritten', 'url' => '/api/{apiVersion}/default-admin-overwritten', 'verb' => 'POST', 'requirements' => ['apiVersion' => '(v2)']],
3738
['name' => 'Settings2#defaultAdminScope', 'url' => '/api/{apiVersion}/default-admin', 'verb' => 'POST', 'requirements' => ['apiVersion' => '(v2)']],

tests/lib/Controller/SettingsController.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535

3636
/**
3737
* @psalm-import-type NotificationsPushDevice from ResponseDefinitions
38+
* @psalm-import-type NotificationsNotification from ResponseDefinitions
3839
*/
3940
#[OpenAPI(scope: OpenAPI::SCOPE_FEDERATION)]
4041
class SettingsController extends OCSController {
@@ -134,4 +135,18 @@ public function doubleScope(): DataResponse {
134135
public function throwing(): DataResponse {
135136
throw new OCSNotFoundException();
136137
}
138+
139+
/**
140+
* @NoAdminRequired
141+
*
142+
* Route is ignored because of scope on the controller
143+
*
144+
* @return DataResponse<Http::STATUS_OK, list<NotificationsNotification>, array{}>
145+
*
146+
* 200: OK
147+
*/
148+
#[OpenAPI]
149+
public function nestedSchemas(): DataResponse {
150+
return new DataResponse();
151+
}
137152
}

tests/openapi.json

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,82 @@
189189
}
190190
}
191191
},
192+
"/ocs/v2.php/apps/notifications/api/{apiVersion}/nested-schemas": {
193+
"post": {
194+
"operationId": "settings-nested-schemas",
195+
"summary": "Route is ignored because of scope on the controller",
196+
"tags": [
197+
"settings"
198+
],
199+
"security": [
200+
{
201+
"bearer_auth": []
202+
},
203+
{
204+
"basic_auth": []
205+
}
206+
],
207+
"parameters": [
208+
{
209+
"name": "apiVersion",
210+
"in": "path",
211+
"required": true,
212+
"schema": {
213+
"type": "string",
214+
"enum": [
215+
"v2"
216+
],
217+
"default": "v2"
218+
}
219+
},
220+
{
221+
"name": "OCS-APIRequest",
222+
"in": "header",
223+
"description": "Required to be true for the API request to pass",
224+
"required": true,
225+
"schema": {
226+
"type": "boolean",
227+
"default": true
228+
}
229+
}
230+
],
231+
"responses": {
232+
"200": {
233+
"description": "OK",
234+
"content": {
235+
"application/json": {
236+
"schema": {
237+
"type": "object",
238+
"required": [
239+
"ocs"
240+
],
241+
"properties": {
242+
"ocs": {
243+
"type": "object",
244+
"required": [
245+
"meta",
246+
"data"
247+
],
248+
"properties": {
249+
"meta": {
250+
"$ref": "#/components/schemas/OCSMeta"
251+
},
252+
"data": {
253+
"type": "array",
254+
"items": {
255+
"$ref": "#/components/schemas/Notification"
256+
}
257+
}
258+
}
259+
}
260+
}
261+
}
262+
}
263+
}
264+
}
265+
}
266+
}
267+
},
192268
"/ocs/v2.php/apps/notifications/api/{apiVersion}/default-admin-overwritten": {
193269
"post": {
194270
"operationId": "settings2-default-admin-scope-overwritten",

0 commit comments

Comments
 (0)