microsoftgraph / msgraph-sdk-go-core

Microsoft Graph SDK for Go - Core Library
https://learn.microsoft.com/graph/sdks/sdks-overview
MIT License
17 stars 9 forks source link

add support for long running operations #148

Open RobinKamps opened 1 year ago

RobinKamps commented 1 year ago
  1. the golang examples under https://learn.microsoft.com/en-us/graph/api/team-post?view=graph-rest-1.0&tabs=go are missing the member odata type, e.g.

    odataType := "#microsoft.graph.aadUserConversationMember"
    member.SetOdataType(&odataType)
  2. if result, err := graphClient.Teams().Post(context.Background(), requestBody, nil) is called, the result is always nil, not Teamable or at least containing the new teamID as documented (but the team is successfully created).

baywet commented 1 year ago

Hi @RobinKamps Thanks for using the Go SDK and for reaching out. Could you create a separate issue for the missing odata type in the snippet please? As for the Id always being null the redirect handler only follows 300 class status codes, and it's a design choice for the time being. @darrelmiller do you think we should expand that to 200 class as well?

RobinKamps commented 1 year ago

thank you for the fast reply. i created a pull request for the missing odata type in the documentation repo.

baywet commented 1 year ago

unfortunately those snippets are automatically generated. And your change will get overwritten with the next generation. We need to fix the generation logic. We do accept pull requests on the generation logic, the easiest is probably to add a new unit test with the http snippet and start from there if you feel like fixing the snippet generation.

RobinKamps commented 1 year ago

Thank you for the reply - i opened separate issues for the documentation errors.

RobinKamps commented 1 year ago

please add a 202 response for the async request, so that users of the go sdk can do the polling: https://learn.microsoft.com/en-us/graph/api/resources/teamsasyncoperation?view=graph-rest-1.0 (of course an integrated polling mechanism where callback funcs for success / errors/ timeouts can be provided, would be nice, too)

baywet commented 1 year ago

Thanks for the comment, this is something that's currently not implemented across all of the SDKs and needs to be implemented manually by SDK users. I've added an issue for our architect to work on a technical specification so our team can implement it across languages. I'll also transfer this issue to the core repository shortly, where we implement those cross-cutting concerns.