Azure / autorest.python

Extension for AutoRest (https://github.com/Azure/autorest) that generates Python code
MIT License
77 stars 55 forks source link

[Mgmt] serialization error when setting model property with `azure.core.serialization.NULL` #2606

Closed msyyc closed 1 month ago

msyyc commented 1 month ago

When running the following code, deserialization error happens before sending request

from azure.identity import DefaultAzureCredential
from azure.mgmt.cdn import CdnManagementClient
from azure.core.serialization import NULL as AzureCoreNull

def main():
    client = CdnManagementClient(
        credential=DefaultAzureCredential(),
        subscription_id="000",
        logging_enable=True
    )

    response = client.routes.begin_update(
        resource_group_name="chenximgmt",
        profile_name="chenxicdn",
        endpoint_name="chenxiendpoint",
        route_name="default-route",
        route_update_properties=RouteUpdateParameters(cache_configuration=AzureCoreNull)
    ).result()

image

msyyc commented 1 month ago

related issue https://github.com/Azure/azure-sdk-for-python/issues/35801