Detection rule response action identifiers always return an empty list
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 38/100
Research direction
Start with the graph_client.security.rules.detection_rules.get() entry point and the ResponseAction get_field_deserializers implementation shown in the issue. Trace how identifier is generated and deserialized, including the source schema or generator if applicable. Done means detection-rule response actions return the appropriate enum identifier instead of an empty list.
Written by the indexing model from the issue text.
Description
Describe the bug
When calling a List or Get for detection rules, e.g. await self.graph_client.security.rules.detection_rules.get(), you get a DetectionRuleCollectionResponse.
This response contains a field detection_action.response_actions which is a list of type ResponseAction.
For a specific response action, e.g. IsolateDeviceResponseAction, the identifier field is always [] instead of the Enum it should be, e.g. identifier=<DeviceIdEntityIdentifier.DeviceId: 'deviceId'>.
I believe this is due to this code in the get_field_deserializers:
fields: Dict[str, Callable[[Any], None]] = {
"identifier": lambda n : setattr(self, 'identifier', n.get_collection_of_enum_values(DeviceIdEntityIdentifier)),
"isolationType": lambda n : setattr(self, 'isolation_type', n.get_enum_value(IsolationType)),
}
I suspect the get_collection_of_enum_values should be replaced with get_enum_value. Since I presume that this code is all generated, the root cause of this problem is probably somewhere else.
Expected behavior
Return the correct enum for all ResponseAction identifiers.
How to reproduce
Call await self.graph_client.security.rules.detection_rules.get() on a detection rule with a response action.
SDK Version
1.16.0
Latest version known to work for scenario above?
No response
Known Workarounds
No response
Debug output
No response
Configuration
- OS: MacOS 14.5
- Architecture: Apple ARM
Other information
No response
- Dominant language
- Python
- Stars
- 44
- Forks
- 16
- Avg merge
- 20h 39m
- Merged PRs (30d)
- 3
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.
More from microsoftgraph/msgraph-beta-sdk-python
-
enhancement
Difficulty 1/5 Under an hour Newbie friendliness 72/100
-
status:waiting-for-triage type:bug
Difficulty 3/5 1-2 days Newbie friendliness 55/100
-
type:bug type:investigation
Difficulty 3/5 1-2 days Newbie friendliness 48/100
microsoftgraph/msgraph-beta-sdk-python#1033 · 1 reaction ·
-
status:waiting-for-triage type:bug
Difficulty 3/5 1-2 days Newbie friendliness 42/100
microsoftgraph/msgraph-beta-sdk-python#1006 · 1 comment ·
-
status:waiting-for-triage type:bug
Difficulty 2/5 1-3 hours Newbie friendliness 48/100
microsoftgraph/msgraph-beta-sdk-python#987 · 2 comments ·
All issues in microsoftgraph/msgraph-beta-sdk-python
Similar issues
-
documentation help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
simonw/sqlite-utils#872 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100