fastly-py
fastly-py copied to clipboard
ApiValueError when running list_backends
Version
5.2.0
What happened
when calling
api_response = api_instance.list_backends(service_id, version_id)
Changes in the backend_api.py file introduced in version 5.2.0 cause the following exception
File "/Users/ianderso/e-conolight.com/config/fastlytesting/update_fastly_backend.py", line 139, in <module>
main()
File "/Users/ianderso/e-conolight.com/config/fastlytesting/update_fastly_backend.py", line 129, in main
bkends = getBackendNames(api_client, service_id, current_version)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ianderso/e-conolight.com/config/fastlytesting/update_fastly_backend.py", line 69, in getBackendNames
api_response = api_instance.list_backends(service_id, version_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ianderso/e-conolight.com/config/fastlytesting/lib/python3.12/site-packages/fastly/api/backend_api.py", line 1068, in list_backends
return self.list_backends_endpoint.call_with_http_info(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ianderso/e-conolight.com/config/fastlytesting/lib/python3.12/site-packages/fastly/api_client.py", line 872, in call_with_http_info
return self.api_client.call_api(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ianderso/e-conolight.com/config/fastlytesting/lib/python3.12/site-packages/fastly/api_client.py", line 427, in call_api
return self.__call_api(resource_path, method,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ianderso/e-conolight.com/config/fastlytesting/lib/python3.12/site-packages/fastly/api_client.py", line 236, in __call_api
return_data = self.deserialize(
^^^^^^^^^^^^^^^^^
File "/Users/ianderso/e-conolight.com/config/fastlytesting/lib/python3.12/site-packages/fastly/api_client.py", line 341, in deserialize
deserialized_data = validate_and_convert_types(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ianderso/e-conolight.com/config/fastlytesting/lib/python3.12/site-packages/fastly/model_utils.py", line 1619, in validate_and_convert_types
input_value[index] = validate_and_convert_types(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ianderso/e-conolight.com/config/fastlytesting/lib/python3.12/site-packages/fastly/model_utils.py", line 1569, in validate_and_convert_types
converted_instance = attempt_convert_item(
^^^^^^^^^^^^^^^^^^^^^
File "/Users/ianderso/e-conolight.com/config/fastlytesting/lib/python3.12/site-packages/fastly/model_utils.py", line 1462, in attempt_convert_item
raise conversion_exc
File "/Users/ianderso/e-conolight.com/config/fastlytesting/lib/python3.12/site-packages/fastly/model_utils.py", line 1453, in attempt_convert_item
return deserialize_model(input_value, valid_class,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ianderso/e-conolight.com/config/fastlytesting/lib/python3.12/site-packages/fastly/model_utils.py", line 1373, in deserialize_model
return model_class._new_from_openapi_data(**kw_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ianderso/e-conolight.com/config/fastlytesting/lib/python3.12/site-packages/fastly/model_utils.py", line 45, in wrapped_init
return fn(_self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ianderso/e-conolight.com/config/fastlytesting/lib/python3.12/site-packages/fastly/model_utils.py", line 369, in _new_from_openapi_data
return cls._from_openapi_data(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ianderso/e-conolight.com/config/fastlytesting/lib/python3.12/site-packages/fastly/model_utils.py", line 45, in wrapped_init
return fn(_self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ianderso/e-conolight.com/config/fastlytesting/lib/python3.12/site-packages/fastly/model/backend_response.py", line 311, in _from_openapi_data
composed_info = validate_get_composed_info(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ianderso/e-conolight.com/config/fastlytesting/lib/python3.12/site-packages/fastly/model_utils.py", line 1992, in validate_get_composed_info
allof_instances = get_allof_instances(self, model_args, constant_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ianderso/e-conolight.com/config/fastlytesting/lib/python3.12/site-packages/fastly/model_utils.py", line 1789, in get_allof_instances
raise ApiValueError(
fastly.exceptions.ApiValueError: Invalid inputs given to generate an instance of 'Backend'. The input data was invalid for the allOf schema 'Backend' in the composed schema 'BackendResponse'. Error=Invalid type for variable 'tcp_keepalive_enable'. Required value type is bool and passed type was NoneType at ['received_data'][0]['tcp_keepalive_enable']```
Had the same issue calling "get_service_detail".
5.3.0 provides a fix for this, closing