You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using either data = {"char_choices": EnumModel.MyTestStrEnum.values[request.char_choices - 1]} or message = EnumServiceOnlyOneFieldResponse(char_choices=request.char_choices) it fix the issue but it's a manual behavior that the user need to know and need to be documented.
An other way is to check in proto_serializers.BaseProtoSerializer.data_to_message if the data[field_name] is an integer then we do not try to map the data but it may create issue with integer enum.
It also possible to add a kwargs argument to the serializer to stop conversion for specified field.
What do you think @Giiltham@legau ? I can fix it I just need to be agree on the fix we implement
The text was updated successfully, but these errors were encountered:
This is an edge case but it is actually happening.
I created a branch name issue/requestDataCannotBeInjectedDirectlyInSerializerData that have a test that fail because of the issue.
I could fix it but their is different way of doing it and we may not want to fix it but only document it.
The example:
This action fail.
When using either
data = {"char_choices": EnumModel.MyTestStrEnum.values[request.char_choices - 1]}
ormessage = EnumServiceOnlyOneFieldResponse(char_choices=request.char_choices)
it fix the issue but it's a manual behavior that the user need to know and need to be documented.An other way is to check in proto_serializers.BaseProtoSerializer.data_to_message if the data[field_name] is an integer then we do not try to map the data but it may create issue with integer enum.
It also possible to add a kwargs argument to the serializer to stop conversion for specified field.
What do you think @Giiltham @legau ? I can fix it I just need to be agree on the fix we implement
The text was updated successfully, but these errors were encountered: