Skip to content
New issue

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

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

Open
peombwa opened this issue Jun 17, 2022 · 2 comments
Open

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

peombwa opened this issue Jun 17, 2022 · 2 comments
Labels
priority:p1 High priority but not blocking.

Comments

@peombwa
Copy link
Member

peombwa commented Jun 17, 2022

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>
@peombwa
Copy link
Member Author

peombwa commented Dec 13, 2022

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)

@peombwa
Copy link
Member Author

peombwa commented Dec 21, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority:p1 High priority but not blocking.
Projects
None yet
Development

No branches or pull requests

1 participant