Open cboulanger opened 6 years ago
The most reasonable here is log warning in application.log. Null result is logical, because value does not meet the DTO. Thats development issue and exists only in dev process. DTO's are only to help you organize your interfaces. If you have mess in code and do not know result, you can skip validation. Just remove @return DtoClass
.
Maybe throwing exception in DEV environment makes sense. But in PRODUCTION it should be just warning.
Ok. I'd be happy if you could add it for DEV mode!
Maybe I am doing something wrong, but if I declare a
@return \myapp\dto\MySpecialDto
in the action comments, and the result doesn't match that DTO, the response isnull
. Shouldn't it raise an exception instead which explains what's wrong?