If we change MultiValueMap to wildcard the List type it extends then this code will compile
final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<>();
final List<String> enumFormStringArray = Collections.singletonList("foo");
formParams.put("enum_form_string_array", enumFormStringArray);
This will allow us to clear up some warnings in the openapi-generator (https://github.com/OpenAPITools/openapi-generator/issues/5782)
Comment From: jonfreedman
I had a look at this change, it seems to me that the #addAll method was added to solve this, although the semantics are slightly different. I think what really should happen is that this interface should not extend Map at all, similar to the Multimap interface in Guava.
Comment From: snicoll
Thanks for the suggestion but we'd like to retain the same contract as what java.util.Map
does.