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 think there is a problem with sending data via curl -F. Symfony or api-platform auto-cast data to string. Sending using Content-Type: application/ld+json works correctly, because swagger use object -d flag.
My workaround was to modify MultipartDecoder class from example by casting possible integer coming from request:
// src/Encoder/MultipartDecoder.php// ...returnarray_map(staticfunction (string$element) {
// Multipart form values will be encoded in JSON.$decoded = json_decode($element, true);
// this avoid converting int to stringif (is_numeric($element)) {
$element = (int)$element;
}
return\is_array($decoded) ? $decoded : $element;
}, $request->request->all()) + $request->files->all();
// ...
so... am i right and docs should be updated or an error is somewhere else?
The text was updated successfully, but these errors were encountered:
All i've done was from this example
https://api-platform.com/docs/core/file-upload/#uploading-to-an-existing-resource-with-its-fields
I've got problem with posting integer value. Response: "The type of the "size" attribute must be "int", "string" given."
In my MongoDB Document is a simple integer field and new file field:
I think there is a problem with sending data via curl -F. Symfony or api-platform auto-cast data to string. Sending using Content-Type: application/ld+json works correctly, because swagger use object -d flag.
My workaround was to modify MultipartDecoder class from example by casting possible integer coming from request:
so... am i right and docs should be updated or an error is somewhere else?
The text was updated successfully, but these errors were encountered: