MediaType.isCompatible does not recognize media types with composite subtypes
- Dominant language
- Java
- Stars
- 400
- Forks
- 143
- PR merge metrics
- No merged PRs in 30d
Description
application/xml+bar is compatible with application/xml+* but MediaType.isCompatible will return false on these types.
The method will need to do one extra check, "|| typesAreEqual and bothSubTypesContainPlus, if yes - split both subtypes, the values before '+' must be equal, afterwards either equal or one of them is a wildcard".
application/*+bar and application/xml+bar might also be checked - though the former case is probably more interesting/more real world one...
#### Affected Versions
[2.0]
Contributor guide
Research direction
Start at the MediaType.isCompatible entry point and inspect how subtype equality and wildcards are currently handled. Verify composite subtypes such as application/xml+bar with application/xml+* and application/*+bar, then add or update coverage so matching prefixes and compatible suffixes are accepted while incompatible values remain false.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100