microsoftgraph / microsoftgraph/msgraph-sdk-dotnet
Missing Enumeration Members
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 789
- Forks
- 264
- Avg merge
- 15h 17m
- Merged PRs (30d)
- 3
Description
Describe the bug
Deserializing the JSON response from the getManagedDevice API endpoint (no issue here) and then casting it into a ManagedDevice object throws an exception.
The JSON response returned from the API includes:
"managementAgent": "intuneAosp"
"deviceEnrollmentType": "androidAOSPUserOwnedDeviceEnrollment"
Neither of these values have a member in the associated enumerations contained in the ManagedDevice class:
• ManagementAgentType enumeration does not have an intuneAosp member
• DeviceEnrollmentType enumeration does not have an androidAOSPUserOwnedDeviceEnrollment member
Casting the deserialized response from the getManagedDevice API results in the following exception:
Newtonsoft.Json.JsonSerializationException: Error converting value "intuneAosp" to type 'System.Nullable`1[Microsoft.Graph.ManagementAgentType]'. Path '[1].managementAgent'.
---> System.ArgumentException: Requested value 'intuneAosp' was not found.
Expected behavior
Ability to deserialize the JSON response from getManagedDevice API endpoint and cast it into a ManagedDevice object
How to reproduce
-
Enroll a DigiLens (Set up Intune enrollment for Android (AOSP) corporate-owned user-associated devices)
-
Call the getManagedDevice API
-
Review the JSON (API returns success and a valid JSON response)
"managementAgent": "intuneAosp"
"deviceEnrollmentType": "androidAOSPUserOwnedDeviceEnrollment" -
Deserializing the JSON response and casting it into a ManagedDevice object results in the exception
SDK Version
No response
Latest version known to work for scenario above?
Never worked
Known Workarounds
None that I know of
Debug output
Click to expand log
```</details>
### Configuration
Windows 11 x64
Not related to any specific configuration
### Other information
• [ManagementAgentType enumeration](https://github.com/microsoftgraph/msgraph-sdk-dotnet/blob/c75439214c6752d0dff406ab4b0905a4369a7b5d/src/Microsoft.Graph/Generated/Models/ManagementAgentType.cs) requires an `intuneAosp` member
• [DeviceEnrollmentType enumeration](https://github.com/microsoftgraph/msgraph-sdk-dotnet/blob/c75439214c6752d0dff406ab4b0905a4369a7b5d/src/Microsoft.Graph/Generated/Models/DeviceEnrollmentType.cs) requires an `androidAOSPUserOwnedDeviceEnrollment` member
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with src/Microsoft.Graph/Generated/Models/ManagementAgentType.cs and DeviceEnrollmentType.cs, then review how those enums are used by ManagedDevice.cs. Verify the reported JSON values against the enum definitions and check the existing serialization behavior. Done means both values deserialize into ManagedDevice without the reported exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100