← 返回首页
conditionalAccessConditionSet resource type desterilizes dropping agentIdRiskLevels · Issue #1033 · microsoftgraph/msgraph-beta-sdk-python · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

conditionalAccessConditionSet resource type desterilizes dropping agentIdRiskLevels #1033

New issue
New issue

Description

Describe the bug

The SDK model in conditional_access_condition_set.py correctly declares this as a collection:

"agentIdRiskLevels": lambda n: setattr( self, 'agent_id_risk_levels', n.get_collection_of_enum_values(ConditionalAccessAgentIdRiskLevels) )

However, kiota-serialization-json's get_collection_of_enum_values only handles list inputs:

def get_collection_of_enum_values(self, enum_class: K) -> Optional[list[K]]: if isinstance(self._json_node, list): # scalar string fails this check return list(map( lambda x: self._create_new_node(x).get_enum_value(enum_class), self._json_node )) return [] # ← value silently dropped

When the API returns "high" (a string, not a list), isinstance(self._json_node, list) is False, so the method returns [] and the actual value is silently lost.

Expected behavior

policy.conditions.agent_id_risk_levels should return [ConditionalAccessAgentIdRiskLevels.High].

The issue could be:

API-side: The API should return ["high"] (array) per the documentation, which describes this as a collection
Kiota-side: get_collection_of_enum_values should handle a scalar gracefully by wrapping it in a list (this may warrant a separate issue on microsoft/kiota-serialization-json-python)

How to reproduce

  1. Have a Conditional Access policy with an agent ID risk level condition set (e.g. high)

  2. Fetch policies via the Beta SDK:
    result = await graph_client.identity.conditional_access.policies.get()

  3. Inspect policy.conditions.agent_id_risk_levels — it will be [] instead of [ConditionalAccessAgentIdRiskLevels.High]

SDK Version

1.57

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output

Click to expand log ```
</details> ### Configuration _No response_ ### Other information _No response_

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:bugA broken experiencetype:investigationInvestigation work, output should be a document detailing findings or a prototype

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    • Open in GitHub Copilot app

    Footer

    © 2026 GitHub, Inc.