We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing controller method
I tried to add OpenAPI docs for the workflowengine by migrating away from "ocs-resources":
diff --git a/apps/workflowengine/appinfo/routes.php b/apps/workflowengine/appinfo/routes.php index b5436e86daa..97fa4a2020d 100644 --- a/apps/workflowengine/appinfo/routes.php +++ b/apps/workflowengine/appinfo/routes.php @@ -27,8 +27,17 @@ return [ 'routes' => [ ['name' => 'requestTime#getTimezones', 'url' => '/timezones', 'verb' => 'GET'], ], - 'ocs-resources' => [ - 'global_workflows' => ['url' => '/api/v1/workflows/global'], - 'user_workflows' => ['url' => '/api/v1/workflows/user'], + 'ocs' => [ + ['name' => 'global_workflows#index', 'verb' => 'GET', 'url' => '/api/v1/workflows/global'], + ['name' => 'global_workflows#show', 'verb' => 'GET', 'url' => '/api/v1/workflows/global/{operationClass}', 'requirements' => ['operationClass' => '[a-zA-Z0-9\\]+']], + ['name' => 'global_workflows#create', 'verb' => 'POST', 'url' => '/api/v1/workflows/global'], + ['name' => 'global_workflows#update', 'verb' => 'PUT', 'url' => '/api/v1/workflows/global/{id}', 'requirements' => ['id' => '\d+']], + ['name' => 'global_workflows#destroy', 'verb' => 'DELETE', 'url' => '/api/v1/workflows/global/{id}', 'requirements' => ['id' => '\d+']], + + ['name' => 'user_workflows#index', 'verb' => 'GET', 'url' => '/api/v1/workflows/user'], + ['name' => 'user_workflows#show', 'verb' => 'GET', 'url' => '/api/v1/workflows/user/{operationClass}', 'requirements' => ['operationClass' => '[a-zA-Z0-9\\]+']], + ['name' => 'user_workflows#create', 'verb' => 'POST', 'url' => '/api/v1/workflows/user'], + ['name' => 'user_workflows#update', 'verb' => 'PUT', 'url' => '/api/v1/workflows/user/{id}', 'requirements' => ['id' => '\d+']], + ['name' => 'user_workflows#destroy', 'verb' => 'DELETE', 'url' => '/api/v1/workflows/user/{id}', 'requirements' => ['id' => '\d+']], ], ]; diff --git a/apps/workflowengine/lib/Controller/AWorkflowController.php b/apps/workflowengine/lib/Controller/AWorkflowController.php index 2c3655743ff..f085ffb3e8c 100644 --- a/apps/workflowengine/lib/Controller/AWorkflowController.php +++ b/apps/workflowengine/lib/Controller/AWorkflowController.php @@ -86,11 +86,11 @@ abstract class AWorkflowController extends OCSController { * * @throws OCSForbiddenException */ - public function show(string $id): DataResponse { + public function show(string $operationClass): DataResponse { $context = $this->getScopeContext(); // The ID corresponds to a class name - $operations = $this->manager->getOperations($id, $context); + $operations = $this->manager->getOperations($operationClass, $context); foreach ($operations as &$operation) { $operation = $this->manager->formatOperation($operation); diff --git a/apps/workflowengine/lib/Controller/UserWorkflowsController.php b/apps/workflowengine/lib/Controller/UserWorkflowsController.php index 02c52deb9c7..ceba686115b 100644 --- a/apps/workflowengine/lib/Controller/UserWorkflowsController.php +++ b/apps/workflowengine/lib/Controller/UserWorkflowsController.php @@ -76,8 +76,8 @@ class UserWorkflowsController extends AWorkflowController { * Example: curl -u joann -H "OCS-APIREQUEST: true" "http://my.nc.srvr/ocs/v2.php/apps/workflowengine/api/v1/workflows/user/OCA\\Workflow_DocToPdf\\Operation?format=json" * @throws OCSForbiddenException */ - public function show(string $id): DataResponse { - return parent::show($id); + public function show(string $operationClass): DataResponse { + return parent::show($operationClass); } /**
but the abstract methods seem to not be taken into consideration.
Ignoring the global one
diff --git a/apps/workflowengine/lib/Controller/GlobalWorkflowsController.php b/apps/workflowengine/lib/Controller/GlobalWorkflowsController.php index 8778f85365f..5c6c0f70690 100644 --- a/apps/workflowengine/lib/Controller/GlobalWorkflowsController.php +++ b/apps/workflowengine/lib/Controller/GlobalWorkflowsController.php @@ -29,6 +29,9 @@ namespace OCA\WorkflowEngine\Controller; use OCA\WorkflowEngine\Helper\ScopeContext; use OCP\WorkflowEngine\IManager; +/** + * @IgnoreOpenAPI + */ class GlobalWorkflowsController extends AWorkflowController { /** @var ScopeContext */
Shows normal errors for the user workflows as that one "wraps" all the methods: https://github.com/nextcloud/server/blob/d8ffbed2c268dde5ef73a1a617bc3627946d835d/apps/workflowengine/lib/Controller/UserWorkflowsController.php#L69
The text was updated successfully, but these errors were encountered:
I'll close this one in favor of #28 because it is literally the same problem.
Sorry, something went wrong.
No branches or pull requests
I tried to add OpenAPI docs for the workflowengine by migrating away from "ocs-resources":
but the abstract methods seem to not be taken into consideration.
Ignoring the global one
Shows normal errors for the user workflows as that one "wraps" all the methods:
https://github.com/nextcloud/server/blob/d8ffbed2c268dde5ef73a1a617bc3627946d835d/apps/workflowengine/lib/Controller/UserWorkflowsController.php#L69
The text was updated successfully, but these errors were encountered: