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
Currently, the action method arguments are initialized early inside the controller, before initializing the property mapping and calling initialize*Action(). That way the argument only has type information from static reflection. The validation chain is then built based on that argument type information ($argument->getDataType()) and in case of an action receiving an interface with dynamic type overrides (__type or inside initialize*Action()), the validation chain is not correctly built, missing validation information from the actual class property annotations.
The issue in solving this however, is that we need to check runtime type information only after initialize*Action() / propertyMappingConfiguration (the latter needs to explicitly allow overriding the type). That in turn expects the action arguments to be already available.
So there are three possible ways to solve this (assuming allowing dynamic typing of action arguments is valid):
action argument type information and validators are not (fully) available inside initialize*Action(), moving initializeActionMethodValidators()after that
move __type override from the ObjectConverter lower down into the Framework stack, so that the argument type is overriden earlier (before property mapping)
completely rebuilding the valdation chain building to be lazy and only work from actual data types given into the validator
The latter is at least an order of magnitude more complex, but generally desirable - the first is potentially a bit breaky.
The text was updated successfully, but these errors were encountered:
Currently, the action method arguments are initialized early inside the controller, before initializing the property mapping and calling
initialize*Action()
. That way the argument only has type information from static reflection. The validation chain is then built based on that argument type information ($argument->getDataType()
) and in case of an action receiving an interface with dynamic type overrides (__type
or insideinitialize*Action()
), the validation chain is not correctly built, missing validation information from the actual class property annotations.The issue in solving this however, is that we need to check runtime type information only after
initialize*Action()
/ propertyMappingConfiguration (the latter needs to explicitly allow overriding the type). That in turn expects the action arguments to be already available.So there are three possible ways to solve this (assuming allowing dynamic typing of action arguments is valid):
initialize*Action()
, movinginitializeActionMethodValidators()
after that__type
override from theObjectConverter
lower down into the Framework stack, so that the argument type is overriden earlier (before property mapping)The latter is at least an order of magnitude more complex, but generally desirable - the first is potentially a bit breaky.
The text was updated successfully, but these errors were encountered: