Nested DTO not deserialized #5160
Replies: 4 comments
-
Would you be able to debug this a bit more? The denormalization of this is done here: It'd be interesting to know what it does when it encounters |
Beta Was this translation helpful? Give feedback.
-
We have no way to know how to denormalize those objects. You'd have to do this in your |
Beta Was this translation helpful? Give feedback.
-
@teohhanhui I have the same issue (array of strings instead of array of DTO's) and wrote comment in this issue api-platform/api-platform#1202 (comment) with some debug experience. Offtop: can you explain: all issues from |
Beta Was this translation helpful? Give feedback.
-
@MichaelKubovic @teohhanhui I found the solution, you have to configure DocumentationNormalizer like this:
|
Beta Was this translation helpful? Give feedback.
-
API Platform version(s) affected: 2.5.3
Description
Having a resource that uses DTO for input and that class contains property that contains array of DTOs of other class.
Generated documentation says that the property has type of array of strings.
Sending a request actually makes the data of the nested dto available as an associative array, although I'd expect it to be deserialized into an object.
How to reproduce
Possible Solution
Additional Context
Beta Was this translation helpful? Give feedback.
All reactions