Skip to content

The Python client runtime serializer includes readOnly properties in requests #934

@johanste

Description

@johanste

When using the generated SDK to update an existing Virtual Machine (doing a virtual_machine_operations.get(), modifying the returned object, and then calling virtual_machine_operations.create_or_update(), the server will fail with a 400 response:

ERROR: The request content was invalid and could not be deserialized: 'Could not find member 'resources' on object of type 'ResourceDefinition'. Path 'resources', line 1, position 58.'.

If I look at the swagger specification, the resources property of a VirtualMachine is marked as readOnly, but according to a quick network trace, it is still included in the request.

Explicitly setting the request attribute on the returned virtual machine object to None before calling create_or_update makes the request succeed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions