method_added removes the same name attribute from attributes and add a new one to method_fields. It ignores alias_name of the original attribute.
Then the alias setting does not work with method fields.
With this patch, the original alias_name is kept.
In addition, serialize_method_fields does not use attr_name_for_serialization unlike other serialize functions. This patch also fixes it to use the function.
method_added
removes the same name attribute fromattributes
and add a new one tomethod_fields
. It ignoresalias_name
of the original attribute. Then the alias setting does not work with method fields.With this patch, the original
alias_name
is kept.In addition,
serialize_method_fields
does not useattr_name_for_serialization
unlike other serialize functions. This patch also fixes it to use the function.