This is the same as #21955. I am scheduling for 5.2 tentatively to explore a potential solution to this, where the consumes condition checks the "content-length" and/or "transfer-encoding" headers for cases when there is no body.
We'll probably need to decide what to do if two methods both match the request (e.g. one json, one xml) and there is no content. Perhaps rejecting that as ambiguous mapping might not be so bad, or maybe that's how it already behaves today.
@rstoyanchev, why is the consumes condition declared too broadly? If I have multiple methods that all have the same consumes condition, then I would like to be able to declare it at the class level instead of duplicating it for every method. The framework should be smart enough to figure out that if there is no @RequestBody then the consumes condition should be ignored. I don't see why this case is any different than the case of the OP where the request body is optional.