Skip to content

Deserialization exception when adding group to lifecycle policy in Azure Active Directory #549

Closed
microsoftgraph/msgraph-sdk-dotnet-core
#135

Description

@paul-ciobanu
  • Expected behavior. Please provide links to the specific Microsoft Graph documentation you used to determine the expected behavior.
  • Actual behavior. Provide error codes, stack information, and a Fiddler capture of the request and response (please remove personally identifiable information before posting).
  • Steps to reproduce the behavior. Include your code, IDE versions, client library versions, and any other information that might be helpful to understand your scenario.

I'm trying to add a group to a lifecycle policy and the call to
await Client.GroupLifecyclePolicies[lifecyclePolicyId].AddGroup(groupId).Request().PostAsync(ct); is throwing exception:
Newtonsoft.Json.JsonReaderException: 'Unexpected character encountered while parsing value: {. Path '', line 1, position 1.'

Expected behavior

The call should not throw

Actual behavior

The call is throwing

Steps to reproduce the behavior

Create an Office365 group in Azure Active Directory and add it to a lifecycle policy
and then call
await Client.GroupLifecyclePolicies[lifecyclePolicyId].AddGroup(groupId).Request().PostAsync(ct);

I'm using Microsoft.Graph 1.17.0 from a .NET Framework 4.6.1 project

addGroupToLifecyclePolicyRequest.txt
callstack.txt

Activity

  1. BigEaseGueldi commented on Oct 22, 2019

    @BigEaseGueldi

    Can confirm this. Using Graph SDK 1.16.0 and .NET 4.7.1.

  2. MalteJohansson commented on Feb 11, 2020

    @MalteJohansson

    Is there any update on this exception?
    Still get this exception as of Feb 11, 2020 with Graph SDK 1.21 and .NET Core 2.2.8
    For me the call is thrown but group is added to policy.

  3. MIchaelMainer commented on Feb 11, 2020

    @MIchaelMainer
    Contributor

    I think I know what is going on here. The AddGroup action returns boolean. The deserializer expects an object. It can't handle:

    {"@odata.context":"https://graph.microsoft.com/v1.0/$metadata#Edm.Boolean","value":true}

    This issue may impact any action that returns a primitive.

  4. MIchaelMainer commented on Sep 17, 2020

    @MIchaelMainer
    Contributor
  5. MIchaelMainer commented on Oct 6, 2020

    @MIchaelMainer
    Contributor

    Release will occur with the following fixes:

    #800
    microsoftgraph/msgraph-beta-sdk-dotnet#160

  6. ghost locked as resolved and limited conversation to collaborators on Feb 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions