Spring 5 consume multiple MediaType

I’m using Spring boot 1.5.8.RELEASE
I have an endpoint and would like to consume multiple MediaType.
In particular application/x-www-form-urlencoded and application/json type.
At the moment I have the below code. It works for application/x-www-form-urlencoded, but doesn’t work for application/json.

@RequestMapping(path = "/abc", method = RequestMethod.POST,
                    consumes = {MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_FORM_URLENCODED_VALUE},
                    produces = MediaType.APPLICATION_JSON_VALUE)
    @ResponseStatus(value = HttpStatus.OK)
    public ResponseEntity<MyResponse> validate(@Valid @ModelAttribute MyDetails details) {
        return something();
    }

I tried to put a content negotiator in my configuration, but still doesn’t work.

    @Override
public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
            configurer.favorPathExtension(false)
                      .defaultContentType(MediaType.APPLICATION_JSON)
                      .mediaType("x-www-form-urlencoded", MediaType.APPLICATION_FORM_URLENCODED);
        }

How can I allow the endpoint to accept these 2 media types?