Closed
Description
I'm working on an API that produces application/hal+json
documents that use the media type profile
parameter to support versioning.
The structure of the controller looks like this:
@RestController
@RequestMapping("/hal-documents")
class MyController {
@GetMapping(produces = ["application/hal+json;charset=UTF-8"])
fun getWithoutProfile() : ResponseEntity<MyResource> {...}
@GetMapping(produces = ["""application/hal+json;profile="my-resource-v1""""])
fun getV1() : ResponseEntity<MyResource> {...}
@GetMapping(produces = ["""application/hal+json;profile="my-resource-v2""""])
fun getV2() : ResponseEntity<MyResource> {...}
}
If I execute a request, which Accept
-Header exactly matches the media type produced by getV1
, the method is not being called. Instead, the request is being routed to getWithoutProfile
.
This seems to be wrong. I would expect that the best matching method is being called. Routing works correctly if the charset
parameter is removed from the getWithoutProfile
method.
Affects: 5.3.15