vmware / pyvmomi

VMware vSphere API Python Bindings
Apache License 2.0
2.22k stars 766 forks source link

Incorrect typing in PortConnection #1056

Closed IvarVirusiim closed 11 months ago

IvarVirusiim commented 1 year ago

Describe the bug

According to the documentation, the fields in dvs\__init__.pyi PortConnection should be optional (except switchUuid).

https://vdc-repo.vmware.com/vmwb-repository/dcr-public/184bb3ba-6fa8-4574-a767-d0c96e2a38f4/ba9422ef-405c-47dd-8553-e11b619185b2/SDK/vsphere-ws/docs/ReferenceGuide/vim.dvs.PortConnection.html

Reproduction steps

from pyVmomi import vim
port_connection = vim.dvs.PortConnection()
port_connection.portKey = None

Run mypy and get Incompatible types in assignment

Expected behavior

None should be an accepted value.

Additional context

No response

karaatanassov commented 11 months ago

Duplicate of https://github.com/vmware/pyvmomi/issues/1048