I found that the serialization of schemas was not working as designed. The calls to schema.dumps() would generate data having keys in snake_case while commercetools backend was expecting json keys in camelCase.
Marshmallow allows the user to set data_key and attributes parameters when defining fields to define the keys to be used for de/serialization. Previously only data_key was used which told the schema what keys to look for when de-serializing, but we also need to pass attributes which defines the key that is used when dumping the json from the schema.
In this PR I simply use the same value passed to data_key and pass it additionally to attributes as well. This was done for all schema definitions in the schemas directory.
I found that the serialization of schemas was not working as designed. The calls to
schema.dumps()
would generate data having keys in snake_case while commercetools backend was expecting json keys in camelCase.Marshmallow allows the user to set
data_key
andattributes
parameters when defining fields to define the keys to be used for de/serialization. Previously onlydata_key
was used which told the schema what keys to look for when de-serializing, but we also need to passattributes
which defines the key that is used when dumping the json from the schema.In this PR I simply use the same value passed to
data_key
and pass it additionally toattributes
as well. This was done for all schema definitions in theschemas
directory.