Skip to content

Simplify MediaTypeRequestMatcher construction #6612

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jzheaux opened this issue Mar 13, 2019 · 4 comments
Closed

Simplify MediaTypeRequestMatcher construction #6612

jzheaux opened this issue Mar 13, 2019 · 4 comments
Assignees
Labels
in: web An issue in web modules (web, webmvc) type: enhancement A general enhancement

Comments

@jzheaux
Copy link
Contributor

jzheaux commented Mar 13, 2019

MediaTypeServerWebExchangeMatcher is very easy to use because it simply takes a list of MediaTypes in its constructor:

public MediaTypeServerWebExchangeMatcher(MediaType... mediaTypes) {
    // ...
}

However, MediaTypeRequestMatcher, the servlet equivalent, requires the user to supply a ContentNegotiationStrategy as well:

public MediaTypeRequestMatcher(ContentNegotiationStrategy contentNegotiationStrategy,
    MediaType... mediaTypes) {
    // ...
}

It would be nice if MediaTypeRequestMatcher were as easy to use as MediaTypeServerWebExchangeMatcher.

@clevertension
Copy link
Contributor

@jzheaux are you working on this issue?if not, i think i can provide a PR 😁😁

@jzheaux
Copy link
Contributor Author

jzheaux commented Mar 23, 2019

It's yours, @clevertension. Note that I'll assign it to myself, just so I can keep track of it now that it's being worked on.

@jzheaux jzheaux self-assigned this Mar 23, 2019
@jzheaux jzheaux added in: web An issue in web modules (web, webmvc) type: enhancement A general enhancement labels Mar 23, 2019
@clevertension
Copy link
Contributor

@jzheaux so the ContentNegotiationStrategy contentNegotiationStrategy can be null now?

@jzheaux
Copy link
Contributor Author

jzheaux commented Mar 25, 2019

@clevertension I was thinking that the class could default to a HeaderContentNegotiationStrategy. See the JavaDoc for some common usages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web An issue in web modules (web, webmvc) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants