eclipse-ee4j / eclipse-ee4j/jersey

Provide option to opt out from MEDIA_TYPE_MAPPINGS

Open
#3,052 3 comments 0 reactions 0 assignees View on GitHub
Component: core Priority: Major Type: Improvement
Dominant language
Java
Stars
730
Forks
382
PR merge metrics
No merged PRs in 30d

Description

I have configured MEDIA_TYPE_MAPPINGS for my Jersey apps. Unfortunately, this causes some trouble with a generic upload service in my app.

```
@PUT
@Path("files/{filename}")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public Response uploadFile(
@PathParam("filename") @NotNull @Size(max = 240) String filename, DataSource dataSource)
```

If someone uploads .../files/file.xml the extension is chopped of.

There should be some opt-out to this. Otherwise one has to disable this feature. This is what I did.

Here is the [SO question](http://stackoverflow.com/q/28369396/696632) for this.
#### Affected Versions
[2.11]

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.