Skip to content

Capability object structure #19

Description

@Rello

Hi @tobiasKaminsky

not sure if this is meant to be like this, but the object is not nested to be parsed easily when it comes to the endpoints

            'declarativeui' => [
                'hooks' => [
                    [
                        'type' => 'context-menu',
                        'endpoints' => [
                            [
                                'name' => 'Show data in Analytics',
                                'url' => '/ocs/v2.php/apps/analytics/createFromDataFile',
                                'filter' => 'text/csv',
                            ],
                        ],
                    ],
                ],
            ],

this will return the following tree which is not good to parse, I would say:

Image

I would suggest to assign the endpoints to type

			'declarativeui' => [
				'hooks' => [
					'context-menu' => [
						'endpoints' => [
							[
								'name' => 'Show data in Analytics',
								'url' => '/ocs/v2.php/apps/analytics/createFromDataFile',
								'filter' => 'text/csv',
								'fileIdVariable' => 'fileId'
							],
						],
					],
				],
			],

this will result is a clear structure

Image

Activity

  1. Rello commented on Sep 4, 2025

    @Rello
    Author

    Addition: the current structure does not work as the keys are overwritten by other apps that define the same tree.

    Suggestion:

    • add appId on L2
    • remove 'hooks' as no added value
    • nest endpoints underneath the types for simpler parsing
    'declarativeui' => [
    		Application::APP_ID => [
    			'context-menu' => [
    				'endpoints' => [
    					[...
    

    imho this would give us a clear structure that is not overwriting each other

    Image
  2. Rello commented on Sep 4, 2025

    @Rello
    Author

    @julien-nc
    I heard that you are also working on this already. We urgently need to align because we are including this in the desktop already and the parser should not be changed regularly

  3. julien-nc commented on Sep 4, 2025

    @julien-nc

    You can check the WIP there nextcloud/assistant#344 .
    I can adjust to something different if there are issues with this structure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions