It seems that the issue is related to a missing enum value in the MS Graph metadata, which is affecting SDKs. According to the GitHub thread you shared, the issue has been acknowledged and there is WIP on fixing it. In the meantime, one possible workaround is to modify the SDK code to handle the missing enum value. Here's an example of how you can modify the ModelDeserializer class in the msgraph.serializer module to handle the issue:
from msgraph.serializer import ModelDeserializer
from msgraph.model import EnumBase
class CustomModelDeserializer(ModelDeserializer):
def deserialize(self, response, cls, **kwargs):
if issubclass(cls, EnumBase):
# Handle missing enum value
if response.text == 'MissingValue':
return None
return super().deserialize(response, cls, **kwargs)
This code creates a custom ModelDeserializer class that checks if the class being deserialized is an EnumBase subclass (which should be the case for enums in the MS Graph SDK). If it is, the code checks if the response value is 'MissingValue' (which is the missing enum value mentioned in the GitHub thread). If it is, the code returns None instead of trying to deserialize the value. Otherwise, the code calls the deserialize method of the base class to deserialize the value as usual. You can then use this custom ModelDeserializer class instead of the default one in your code:
from msgraph.serializer import Serializer
# Create a custom serializer with the custom deserializer
serializer = Serializer(deserializer=CustomModelDeserializer())
# Use the custom serializer to deserialize the response
response_data = serializer.deserialize(response, MyModelClass)