Skip to content

Introduce composed annotations for @RequestMapping #981

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

Merged
merged 1 commit into from
Feb 29, 2016

Conversation

sbrannen
Copy link
Member

This commit introduces the following common composed annotations for
@RequestMapping in Spring MVC and Spring MVC REST.

Issue: SPR-13992

@sdeleuze
Copy link
Contributor

👍

@rstoyanchev
Copy link
Contributor

Looks good overall. I'm wondering if we shouldn't also drop produces on POST, PUT, and PATCH? Also drop both consumes and produces on DELETE? It's less common to produce on those methods to begin with plus those conditions are for disambiguation purposes. They are not always needed, and you still have consumes.

@sbrannen
Copy link
Member Author

@rstoyanchev, thanks for the review!

Those are exactly the topics I wanted to discuss with you: produces vs. consumes.

It's a bit of a challenge getting it right and not being too restrictive.

Regarding produces for POST, PUT, and PATCH, some people actually return the new/updated resource in the body in order to avoid having to submit a followup GET based on the 'location' header. So I thought we would want to allow such use cases. The same holds true for DELETE, though perhaps that's not so common.

Regarding consumes for DELETE, I also pondered whether we should include that. I doubt many people would submit a body with a DELETE request, but then again... I just didn't want to be too restrictive.

Let's come to a consensus during the team call -- OK?

This commit introduces the following common composed annotations for
@RequestMapping in Spring MVC and Spring MVC REST.

- @GetMapping
- @PostMapping
- @PutMapping
- @DeleteMapping
- @PatchMapping

Issue: SPR-13992
sbrannen added a commit to sbrannen/spring-framework that referenced this pull request Feb 29, 2016
* SPR-13992:
  Introduce composed annotations for @RequestMapping
@sbrannen sbrannen merged commit 467b5f3 into spring-projects:master Feb 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants