microsoftgraph / microsoftgraph/msgraph-sdk-dotnet

AdditionalData can break my code when I update the graph package

Open
#882 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
789
Forks
264
Avg merge
15h 17m
Merged PRs (30d)
3

Description

Describe the bug
If I use AdditionalData as the data is not bound to any property and then update to a version that is bound to a propery, the value is not anyomore in AdditionalData and my code brekas

To Reproduce
I use AdditionalData. for example

if(entity.AdditionalData.Any(x => x.Key == "SomeProperty" && x.Value?.ToString() == "SomeValue"){}

Then I update to a version that entity has SomeProperty so it is removed from AdditionalData and my code breaks.

I'm forced to check every usage of AdditionalData everytime I update the graph package

Expected behavior
I suppose that you can expose a dictionary entity.AllData where all the values are present. That way I'm not forced to check every usage of AdditionalData everytime I update the graph package.

We should be able to use the typed entity without this risk

AB#7811

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how AdditionalData is populated and how properties become typed on Microsoft Graph entities. Compare the reported upgrade scenario with the proposed entity.AllData behavior, then define and verify how both typed properties and previously unknown values should remain available.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.