microsoftgraph / microsoftgraph/msgraph-sdk-dotnet

Missing Enumeration Members

Open
#2,735 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Needs: Attention :wave: type:bug
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
  1. Enroll a DigiLens (Set up Intune enrollment for Android (AOSP) corporate-owned user-associated devices)

  2. Call the getManagedDevice API

  3. Review the JSON (API returns success and a valid JSON response)
    "managementAgent": "intuneAosp"
    "deviceEnrollmentType": "androidAOSPUserOwnedDeviceEnrollment"

  4. 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

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.