I recently updated, and my fields in my custom resource stopped working except for 'string'. Maybe I was doing it wrong before?
My schema had a toplevel UserId field of type integer
"UserId": {
"type": "integer"
}
I get the following error running CFN test:
[ERROR] 2020-04-20T06:42:33.702Z 3a99cb01-89c4-1787-deb0-125e4dff798d Invalid request
Traceback (most recent call last):
File "/var/task/cloudformation_cli_python_lib/resource.py", line 140, in _parse_test_request
).to_modelled(self._model_cls)
File "/var/task/cloudformation_cli_python_lib/utils.py", line 123, in to_modelled
desiredResourceState=model_cls._deserialize(self.desiredResourceState),
File "/var/task/nextdoor_sendgrid_subuser/models.py", line 56, in _deserialize
recast_object(cls, json_data, dataclasses)
File "/var/task/cloudformation_cli_python_lib/recast.py", line 29, in recast_object
raise InvalidRequest(f"Unsupported type: {type(v)} for {k}")
cloudformation_cli_python_lib.exceptions.InvalidRequest: Unsupported type: <class 'int'> for UserId
Switching the schema to string, and casting the (json) UserId with str() when populating the model appears to resolve this. What's going on? We can make do with strings, but it's handy to have types. We ran into the same issue with bools.
I recently updated, and my fields in my custom resource stopped working except for 'string'. Maybe I was doing it wrong before?
My schema had a toplevel UserId field of type integer
I get the following error running CFN test:
Switching the schema to string, and casting the (json) UserId with str() when populating the model appears to resolve this. What's going on? We can make do with strings, but it's handy to have types. We ran into the same issue with bools.