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
{{ message }}
Repository navigation
Default Enum value is always used instead of the one passed in request #2
changed the title [-]Enums with default value are ommited from request[/-][+]Default Enum value is always used instead of the one passed in request[/+]on May 18, 2017
Thank you for the analysis. So, as you discovered, it is because the ? method changes type of NameReceptacle (it is defined as def ?[B](default: B) = new NameDefaultReceptacle(name, default)) - so, ong story short - the Unmarshaller that is materialized is FromStringUnmarshaller[SortOrder.Desc.type] - provided by kebs for case objects. The unmarshaller for case object ignores its argument and returns constant object - which is the direct cause for the bug. Thanks @dbronecki for analysis! I fixed that in 71ad0b2 by removing case objects' unmarshallers - it doesn't look like a feature that is needed. I think that it was worth sacrificing this unneeded feature for less surprising behavior. Let me know wdyt @dbronecki !
Activity
[-]Enums with default value are ommited from request[/-][+]Default Enum value is always used instead of the one passed in request[/+]Default Enum value is always used instead of the one passed in request
marcin-rzeznicki commentedon May 22, 2017
Thank you for the analysis. So, as you discovered, it is because the
?method changes type ofNameReceptacle(it is defined asdef ?[B](default: B) = new NameDefaultReceptacle(name, default)) - so, ong story short - theUnmarshallerthat is materialized isFromStringUnmarshaller[SortOrder.Desc.type]- provided by kebs forcase objects. The unmarshaller for case object ignores its argument and returns constant object - which is the direct cause for the bug. Thanks @dbronecki for analysis! I fixed that in 71ad0b2 by removing case objects' unmarshallers - it doesn't look like a feature that is needed. I think that it was worth sacrificing this unneeded feature for less surprising behavior. Let me know wdyt @dbronecki !dbronecki commentedon May 23, 2017
Yeah, it's better now - no surprising behaviour. I have no idea how to fix it otherwise, so for now we can mark this issue as resolved.
Merge pull request #2 from pk044/core-refactor