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
Is your feature request related to a problem? Please describe.
While trying to migrate to the new FormData autogeneration (by using postForm or setting Content-Type to multipart) I realized arrays won't work anymore. An 'arr' proprety with two entries will be converted to name="arr.0" and name="arr.1" in the payload.
I saw in the source-code that once the name has a suffix like '[]' it will post it as such. But our springboot backend wants the key to be 'arr' (not 'arr[]') and our client-side typescript interface has a key named 'arr' and not 'arr[]' either.
Describe the solution you'd like
Plain arrays should also be send automatically, without the need to put '[]' to its name. If that's a breaking change, make it optional via options.
Describe alternatives you've considered
Springboot can't parse the default 'arr.0', 'arr.1' format. And adding '[]' to the type, the client-side object and the desired property in the backend is not an ideal solution.
In typescript properties of types/interfaces usually don't have a '[]' suffix. But the whole point of migrating to this new feature is to have type-safe services with a typed payload instead of just any 'FormData' object.
Additional context
The text was updated successfully, but these errors were encountered:
@DigitalBrainJS #4704
The contents of this URL still do not solve the problem of receiving array parameters in the springboot environment. In springboot, the foreground URL cannot have [] and., but the URL does not completely disable [] and. option
Is your feature request related to a problem? Please describe.
While trying to migrate to the new FormData autogeneration (by using postForm or setting Content-Type to multipart) I realized arrays won't work anymore. An 'arr' proprety with two entries will be converted to name="arr.0" and name="arr.1" in the payload.
I saw in the source-code that once the name has a suffix like '[]' it will post it as such. But our springboot backend wants the key to be 'arr' (not 'arr[]') and our client-side typescript interface has a key named 'arr' and not 'arr[]' either.
Describe the solution you'd like
Plain arrays should also be send automatically, without the need to put '[]' to its name. If that's a breaking change, make it optional via options.
Describe alternatives you've considered
Springboot can't parse the default 'arr.0', 'arr.1' format. And adding '[]' to the type, the client-side object and the desired property in the backend is not an ideal solution.
In typescript properties of types/interfaces usually don't have a '[]' suffix. But the whole point of migrating to this new feature is to have type-safe services with a typed payload instead of just any 'FormData' object.
Additional context
The text was updated successfully, but these errors were encountered: