Skip to content

Restore Action Should Only Be Bound On directory/deletedItems #169

Open

Description

@peombwa

Restore action bound on directoryObject should only be applied to directory/deletedItems/{id} and not the derived types of directoryObject. See https://docs.microsoft.com/en-us/graph/api/directory-deleteditems-restore?view=graph-rest-1.0&tabs=http.

We currently don't have an OData capability annotation that we can use to restrict how OData actions and functions are bound.

The lack of this restriction results in a broken experience for customers using our SDKs since the generated actions bound on the derived types fail with a status code of 400.

Current representation in the CSDL

<Action Name="restore" IsBound="true">
  <Parameter Name="bindingParameter" Type="graph.directoryObject" Nullable="false" />
  <ReturnType Type="graph.directoryObject" />
</Action>

Activity

  1. peombwa commented on Dec 13, 2022

    @peombwa
    MemberAuthor

    A similar issue also affects grant action that's bound to permission. Grant action is only valid for POST /shares/{encoded-sharing-url}/permission/grant.

    <Action Name="grant" IsBound="true">
      <Parameter Name="bindingParameter" Type="graph.permission" />
      <Parameter Name="roles" Type="Collection(Edm.String)" Unicode="false" />
      <Parameter Name="recipients" Type="Collection(graph.driveRecipient)" />
      <ReturnType Type="Collection(graph. Permission)" />
    </Action>

    As per an internal discussion, we will add a new annotation to signal that an action or function must be explicitly bound (listed target types). See microsoft/OpenAPI.NET.OData#232 (comment)

  2. peombwa commented on Dec 21, 2022

    @peombwa
    MemberAuthor

    add action on conversationMember seems to be only valid for POST /teams/{team-id}/members/add.

    <Action Name="add" IsBound="true">
      <Parameter Name="bindingParameter" Type="Collection(graph.conversationMember)" />
      <Parameter Name="values" Type="Collection(graph.conversationMember)" />
      <ReturnType Type="Collection(graph.actionResultPart)" />
    </Action>

    See related issue - microsoftgraph/msgraph-sdk-powershell#1494.

  3. added
    priority:p1
    on Jan 30, 2023
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

    priority:p1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions