Open kronsteinerPT opened 5 months ago
Thanks for raising this @kronsteinerPT
Are you by any chance able to make the same the request using the Graph Explorer and view the json response value? It would be helpful to identify from the json response if the value returned by the API is correct to narrow this down to a deserialization error.
Yes the Json from the API is correct. I get VolumeType : "1" as a response from every device
The generated SDK has the member names as the string representations while the API is returning number values. https://github.com/microsoftgraph/msgraph-beta-sdk-dotnet/blob/7b3e51132513d59a44bffd726459f9c609fd6427/src/Microsoft.Graph/Generated/Models/VolumeType.cs#L10
We'll need to follow this up with the metadata to get a picture of what the expecatation is here.
Describe the bug
Im trying to get all BitlockerRecoveryKey objects via Graph API using the GraphServiceClient library in the newest beta version 5.77.0-preview. This is my request:
var allBitlockerRecoveryKeys = await GraphClient.InformationProtection.Bitlocker.RecoveryKeys.GetAsync(requestConfiguration => { requestConfiguration.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36"); });
This is one of the results:
The Volume Type is "FixedDataVolume" in every Result which is strange in itself but ok. But if I now look at the same deviceId in Azure via my browser, the Volume Type is "Operating system drive".
Also if i go through the http data that my own GraphClient gets i get the Volume Type "1" (which stands for Operating System Drive according to the docu)
But somehow if it goes through the type from Microsoft.Graph.Beta.Models it gets converted to the wrong type.
Expected behavior
The VolumeType should convert the json data from the http request result to the correct value. volumeType=1 => operatingSystemVolume volumeType=2 => fixedDataVolume ...
How to reproduce
NuGet Package Microsoft.Graph.Beta 5.77.0-preview Functioning and Authenticated GraphClient Execute var allBitlockerRecoveryKeys = await GraphClient.InformationProtection.Bitlocker.RecoveryKeys.GetAsync(requestConfiguration => { requestConfiguration.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36"); });
SDK Version
5.77.0-preview
Latest version known to work for scenario above?
No response
Known Workarounds
Workaround is to just use a normal http request without GraphServiceClient Library
Debug output
Click to expand log
```Configuration
Windows 11, x64 Nothing Special. Using Visual Studio 22 net6.0
Other information
No response