Skip to content

ListPermissionRoleDefinitions returns *UnifiedRoleDefinition but the endpoint responds with a JSON array #10

Description

@dj4oC

Summary

RoleManagementApi.ListPermissionRoleDefinitions(ctx).Execute() is typed to return a single *UnifiedRoleDefinition and decodes the entire response body into it — but GET /v1beta1/roleManagement/permissions/roleDefinitions returns a JSON array of role definitions. Decoding therefore fails and the method is unusable against a live oCIS.

Details

SDK (main, pseudo-version v1.0.5-0.20260528080633-1156304e59ee), api_role_management.go:

func (r ApiListPermissionRoleDefinitionsRequest) Execute() (*UnifiedRoleDefinition, *http.Response, error)
// ...
localVarReturnValue *UnifiedRoleDefinition           // single object
localVarPath := localBasePath + "/v1beta1/roleManagement/permissions/roleDefinitions"

Live oCIS 8.0.1 response for that path (a bare array):

[{"@libre.graph.weight":0,"description":"View and download.", "...": "..."}, {"...": "..."}]

json.Unmarshal of a JSON array into a *UnifiedRoleDefinition struct returns an error, so Execute() always fails for this endpoint.

Note: the singular GET (/roleDefinitions/{role-id}GetPermissionRoleDefinition) correctly returns one object; it's specifically the list operation that's mistyped.

Impact

Consumers can't use the SDK to list sharing-role definitions and must hand-roll this one endpoint — e.g. owncloud/ocis-mcp-server#24 / owncloud/ocis-mcp-server#13 keep get_sharing_roles on a raw HTTP call for exactly this reason.

Suggested fix

The list operation's response schema should be an array ([]UnifiedRoleDefinition) or a collection wrapper — most likely a fix in the OpenAPI spec the SDK is generated from, then regenerate.

Environment

  • libre-graph-api-go: main (v1.0.5-0.20260528080633-1156304e59ee)
  • oCIS: 8.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions