-
Notifications
You must be signed in to change notification settings - Fork 38.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Map in FormHttpMessageConverter #32826
Comments
The underlying issue here is that the var login = restClient
.post()
.uri("/login")
.contentType(MediaType.APPLICATION_FORM_URLENCODED)
.body(CollectionUtils.toMultiValueMap(Map.of("username", List.of("foo"), "password", List.of("bar"))))
.retrieve()
.toEntity(String.class); which is definitely less elegant. To fix this, we would have to change Alternatively, we can introduce a new I definitely prefer doing the former, as having duplicate form converters seems unnecessary and complicated, also in terms of configuration. |
Maybe a couple of other alternatives. I'm not sure how possible the first one is.
|
Not really, the interface defines what types are accepted for reading and writing.
We can certainly consider introducing similar convenience methods. I created a separate issue for that. |
After team discussion, we decided that the best way to go forward is to change the |
This commit ensures that the FormHttpMessageConverter no longer supports reading Maps (just MultiValueMaps). Plain maps are often used to represent JSON. See gh-32826
Unfortunately, supporting plain maps in the We did consider other ways to solve this problem (see discussion on #32917), but in the end could not find any, leaving us no other choice but to revert 80faa94, and close this issue as not planned. Fortunately, there are still the enhancements in #32832, which we can keep. |
Affects: 6.1.6
This feels like it should work. I get there are scenarios that it can't, and I don't care if it does on response.
The text was updated successfully, but these errors were encountered: