-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(generate-spec): Ignore index.php routes by default
Signed-off-by: provokateurin <[email protected]>
- Loading branch information
1 parent
b9a7edd
commit 492cfc7
Showing
4 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
*/ | ||
|
||
namespace OCA\Notifications\Controller; | ||
|
||
use OCP\AppFramework\Controller; | ||
use OCP\AppFramework\Http; | ||
use OCP\AppFramework\Http\Attribute\FrontpageRoute; | ||
use OCP\AppFramework\Http\Attribute\NoCSRFRequired; | ||
use OCP\AppFramework\Http\Attribute\OpenAPI; | ||
use OCP\AppFramework\Http\Response; | ||
|
||
class PlainController extends Controller { | ||
#[NoCSRFRequired] | ||
#[FrontpageRoute(verb: 'GET', url: '/plain/ignored')] | ||
public function ignored(): Response { | ||
return new Response(); | ||
} | ||
|
||
|
||
/** | ||
* Route with manual scope to not get ignored | ||
* | ||
* @return Response<Http::STATUS_OK, array{}> | ||
* | ||
* 200: Response returned | ||
*/ | ||
#[NoCSRFRequired] | ||
#[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT)] | ||
#[FrontpageRoute(verb: 'GET', url: '/plain/with-scope')] | ||
public function withScope(): Response { | ||
return new Response(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters