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

Error deserializing GET calendars response #73

Closed
janfreymann opened this issue Feb 4, 2022 · 4 comments · Fixed by #75
Closed

Error deserializing GET calendars response #73

janfreymann opened this issue Feb 4, 2022 · 4 comments · Fixed by #75
Assignees
Labels
bug Something isn't working fixed

Comments

@janfreymann
Copy link

Hi,
thanks for developing the Go SDK for Microsoft Graph. This is very helpful for me. Obtaining credentials via the device code login works fine, but once I request the list of calendars with client.Me().Calendars().Get(nil), the following error occurs:

panic: interface conversion: interface {} is graph.OnlineMeetingProviderType, not *graph.OnlineMeetingProviderType

goroutine 1 [running]:
github.com/microsoftgraph/msgraph-sdk-go/models/microsoft/graph.(*Calendar).GetFieldDeserializers.func1({0x101352ea0, 0x140001c6100}, {0x10136d158, 0x14000013290})
	/Users/jfreymann/go/pkg/mod/github.com/microsoftgraph/msgraph-sdk-go@v0.8.0/models/microsoft/graph/calendar.go:209 +0x148
github.com/microsoft/kiota/serialization/go/json.(*JsonParseNode).GetObjectValue(0x140000134a0, 0x10135ae40)
	/Users/jfreymann/go/pkg/mod/github.com/microsoft/kiota/serialization/go/json@v0.0.0-20220125101815-87c13b40a6fb/json_parse_node.go:171 +0x2a4
github.com/microsoft/kiota/serialization/go/json.(*JsonParseNode).GetCollectionOfObjectValues(0x14000013e80, 0x10135ae40)
	/Users/jfreymann/go/pkg/mod/github.com/microsoft/kiota/serialization/go/json@v0.0.0-20220125101815-87c13b40a6fb/json_parse_node.go:196 +0x164
github.com/microsoftgraph/msgraph-sdk-go/me/calendars.(*CalendarsResponse).GetFieldDeserializers.func2({0x1013376c0, 0x1400018e600}, {0x10136d158, 0x14000013e80})
	/Users/jfreymann/go/pkg/mod/github.com/microsoftgraph/msgraph-sdk-go@v0.8.0/me/calendars/calendars_response.go:62 +0x44
github.com/microsoft/kiota/serialization/go/json.(*JsonParseNode).GetObjectValue(0x14000013e90, 0x10135ae38)
	/Users/jfreymann/go/pkg/mod/github.com/microsoft/kiota/serialization/go/json@v0.0.0-20220125101815-87c13b40a6fb/json_parse_node.go:171 +0x2a4
github.com/microsoft/kiota/http/go/nethttp.(*NetHttpRequestAdapter).SendAsync(0x140000a81e0, {0x0, 0x0, 0x140000947b0, 0x140000947e0, {0x0, 0x0, 0x0}, 0x14000094720, {0x101263e73, ...}, ...}, ...)
	/Users/jfreymann/go/pkg/mod/github.com/microsoft/kiota/http/go/nethttp@v0.0.0-20211203130928-8449c9e67101/nethttp_request_adapter.go:158 +0x15c
github.com/microsoftgraph/msgraph-sdk-go/me/calendars.(*CalendarsRequestBuilder).Get(0x14000094780, 0x0)
	/Users/jfreymann/go/pkg/mod/github.com/microsoftgraph/msgraph-sdk-go@v0.8.0/me/calendars/calendars_request_builder.go:118 +0xac
main.main()

It seems like the deserializer for the response is not matching the actual JSON response. Could you please check if the generated code for the /calendars endpoint is correct?

Thanks and kind regards,

Jan Freymann

@ghost ghost added the Needs Triage 🔍 label Feb 4, 2022
@baywet baywet self-assigned this Feb 4, 2022
@baywet baywet added bug Something isn't working fixed and removed Needs Triage 🔍 labels Feb 4, 2022
@baywet
Copy link
Member

baywet commented Feb 4, 2022

Hi @janfreymann
Thanks for trying the SDK and thanks for reaching out.
This is an issue we've noticed yesterday and I already put together a pull request in the generator to address it
Once the pull request gets merged, the next weekly generation (usually happens on Tuesdays) will fix the issue, I'll revert here when this happens.

@janfreymann
Copy link
Author

Great, thanks for the quick response!

@baywet
Copy link
Member

baywet commented Feb 8, 2022

FYI #75 has been put together and it contains the fix I was mentioning, once merge it'll close this issue.
After that, running go get -u (may take a couple of minutes) at the root of your project should fix the behaviour on your side.

@baywet baywet linked a pull request Feb 8, 2022 that will close this issue
@baywet baywet closed this as completed in #75 Feb 8, 2022
@janfreymann
Copy link
Author

Thank you very much! It is working now :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants