When executing models.load() function against an AWS connection type with 'customer_networks' attribute specified, but missing required "address" field - it does not flag this as an invalid request. If the same is sent to actual Pureport API it gets rejected with below:
"Instantiation of object value failed for JSON property 'address' due to missing (therefore NULL). 'address' is a non-nullable type"
Is it expected that non-required attributes will be validated?
Example:
(Pdb) conn_data.type
'Connection'
(Pdb) conn_data.data
{'type': 'AWS_DIRECT_CONNECT', 'name': '0CEWQZN9E5SSQ14FR0I4OLWINOOS75WKDM4JIKDJTBSUGJC8VC', 'billing_term': 'HOURLY', 'high_availability': False, 'location': {'href': '/locations/us-sea'}, 'speed': 50, 'aws_account_id': '123412341234', 'aws_region': 'us-west-2', 'customer_networks': [{'name': 'net1'}]}
(Pdb) n
/run/pureport-python/test/pureport-test/func/test_connections.py(20)test_connections_create()
-> conn_obj = runtime.models.load(conn_data.type, conn_data.data)
(Pdb)
(Pdb) conn_obj.serialize()
{'high_availability': False, 'speed': 50, 'billing_term': 'HOURLY', 'customer_networks': [{'name': 'net1'}], 'name': '0CEWQZN9E5SSQ14FR0I4OLWINOOS75WKDM4JIKDJTBSUGJC8VC', 'location': {'href': '/locations/us-sea'}, 'type': 'AWS_DIRECT_CONNECT', 'aws_account_id': '123412341234', 'aws_region': 'us-west-2'}
(Pdb)
When sent to Pureport API:
(Pdb) n
pureport.exceptions.PureportHttpError: Instantiation of object value failed for JSON property 'address' due to missing (therefore NULL). 'address' is a non-nullable type.
/run/pureport-python/test/pureport-test/func/test_connections.py(22)test_connections_create()