Azure / msrest-for-python

The runtime library "msrest" for AutoRest generated Python clients.
MIT License
41 stars 64 forks source link

Bug when serializing data with None in header #231

Closed Juliehzl closed 3 years ago

Juliehzl commented 3 years ago

According to the code below, if the data is None, it would call L636 data = self.validate(data, name, required=True, **kwargs). https://github.com/Azure/msrest-for-python/blob/209fa61faf8930ec14d0f60167785c3573e68dee/msrest/serialization.py#L634-L636 In this function, it passes required=True, but when data is None, the validation would fail. But sometimes client may send data with None because it is not required in header.

lmazuel commented 3 years ago

Hello,

Do you have an actual scenario with a SDK, or is this just hypothetical looking at the code?

Thanks!

Juliehzl commented 3 years ago

Thanks @lmazuel ! The root cause is found in CLI code. Thanks!