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
I let my param as a string with @JMS\Type("string")
@JMS\Accessor(getter="getWeight",setter="setWeight") let me have a custom setter which let me set the float value OR let the original param.
I can get my exception after validation of my entity
Do did i missed here? Does anyone have a better solution instead of this cheat?
Does the serialization is supposed to parse a string into a float even is it's not a valid float?
Thank you all
The text was updated successfully, but these errors were encountered:
Steps required to reproduce the problem
I have an entity which contains this value
At some point i'll try to deserialize a JSON request into this entity with
Expected Result
Actual Result
Further discussion
I do think this is due to https://github.com/schmittjoh/serializer/blob/master/src/Type/Parser.php#L47 which parse "A" to '0.0';
My goal is to be able to get this error after validation of my entity by $validator->validate($user);
I have achived what i want by some hum hum cheating.
Explanations:
@JMS\Type("string")
@JMS\Accessor(getter="getWeight",setter="setWeight")
let me have a custom setter which let me set the float value OR let the original param.Do did i missed here? Does anyone have a better solution instead of this cheat?
Does the serialization is supposed to parse a string into a float even is it's not a valid float?
Thank you all
The text was updated successfully, but these errors were encountered: