Open Clovel opened 1 year ago
Also, it doesn't support arrays.. Maybe adding object-to-formdata as a dependency would be a good idea?
Any news on this ? Has anyone taken a look at how this would be fixed ?
I think it would be okay to make contentFormatters
property at least protected to be able to override it easily.
When using a
multipart/form-data
content type, the generated API code provides a private function to format certain types :contentFormatters
.Currently on version
12.0.2
the function is :If we concentrate on the
ContentType.FormData
section of the formatter, we haveThis section is no recursive on objects.
For example, if my backend expects the following type for the payload
The files aren't correctly set in the fetch request because they aren't serializable.
This should be updated to support File in subfields of the payload type.
EDIT 1 : Indentation EDIT 2 : this looks like it's the continuation of the work done here : #293 EDIT 3 : Typo