nextcloud / nextcloud/openapi-extractor
Extractor doesn't consider inherited functions to implement routes
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 11
- Forks
- 4
- Avg merge
- 10h 18m
- Merged PRs (30d)
- 8
Description
If a route is configured that is implemented by a controller's parent class, an error is thrown saying 'Missing controller method'.
In my case, the method in question is the method authenticate from OCP\AppFramework\AuthPublicShareController which can't be overwritten by my controller because it is final.
As a workaround, I'll try to a proxy function that forwards its parameters to parent::authenticate, but ideally that should not be necessary.
My relevant routes:
<?php
declare(strict_types=1);
return [
'routes' => [
// ....
['name' => 'SecretShare#authenticate', 'root' => '/secret',
'url' => '/show/{token}/authenticate/{redirect}', 'verb' => 'POST'],
],
'ocs' => [
// ....
]
];
Excerpt from my controller class:
<?php
declare(strict_types=1);
namespace OCA\Secrets\Controller;
use OCP\AppFramework\AuthPublicShareController;
class SecretShareController extends AuthPublicShareController {
// ...
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the route configuration for SecretShare#authenticate and the SecretShareController extending OCP\AppFramework\AuthPublicShareController. Trace the extractor's controller-method lookup to determine why inherited methods are rejected, then verify that the route is accepted without the missing-method error while preserving handling of final parent methods.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100