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

User update throws with "AdditionalData can not be null" after migration from 5.47.0 to 5.51.0 #2471

Closed
faschwardalog opened this issue May 3, 2024 · 3 comments · Fixed by microsoft/kiota#4607
Labels
Bug type:bug A broken experience

Comments

@faschwardalog
Copy link

Describe the bug

I am trying to update the settings of a user. It was working fine up to now, but after the migration to 5.51.0 it crashes out with "AdditionalData can not be null".

Expected behavior

Users can be updated without the sdk crashing. Might relate to the user update endpoint not returning any body but just a 204.

How to reproduce

Just try to update any user with version 5.51.0

const string userId = "user-id";
var user = await _client.Users[userId].GetAsync(cancellationToken: cancellationToken);
user.City += "a";
await _client.Users[userId].PatchAsync(user, cancellationToken: cancellationToken);

SDK Version

5.51.0

Latest version known to work for scenario above?

5.47.0

Known Workarounds

No response

Debug output

Click to expand log ```
</details>


### Configuration

_No response_

### Other information

_No response_
@faschwardalog faschwardalog added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience labels May 3, 2024
@DavidLievrouw
Copy link

Same here. Still works with v5.49.0. Here's my stacktrace:

System.AggregateException
One or more errors occurred. (AdditionalData can not be null) (Specified HTTP method is not allowed for the request target.)
  Exception doesn't have a stacktrace

System.InvalidOperationException
AdditionalData can not be null
   at Microsoft.Graph.Models.Entity.get_AdditionalData()
   at Microsoft.Graph.Models.Entity.Serialize(ISerializationWriter writer)
   at Microsoft.Graph.Models.DirectoryObject.Serialize(ISerializationWriter writer)
   at Microsoft.Graph.Models.Group.Serialize(ISerializationWriter writer)
   at Microsoft.Kiota.Serialization.Json.JsonSerializationWriter.WriteObjectValue[T](String key, T value, IParsable[] additionalValuesToMerge)
   at Microsoft.Kiota.Abstractions.RequestInformation.SetContentFromParsable[T](IRequestAdapter requestAdapter, String contentType, T item)
   at Microsoft.Graph.Groups.Item.GroupItemRequestBuilder.ToPatchRequestInformation(Group body, Action`1 requestConfiguration)
   at Microsoft.Graph.Groups.Item.GroupItemRequestBuilder.PatchAsync(Group body, Action`1 requestConfiguration, CancellationToken cancellationToken)

@TDroogers
Copy link

It can be fixed/hidden by adding a value to AdditionalData.

fromGet.AdditionalData = new Dictionary<string, object>();

@faschwardalog
Copy link
Author

It can be fixed/hidden by adding a value to AdditionalData.

fromGet.AdditionalData = new Dictionary<string, object>();

Unfortunately did not help me :-(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug type:bug A broken experience
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants