Skip to content

(docs): Replace @RequestMapping with newer @GetMapping (etc.) #957

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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions docs/modules/ROOT/pages/spring-cloud-openfeign.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ public interface StoreClient {
@RequestMapping(method = RequestMethod.GET, value = "/stores")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please leave this one as @RequestMapping - like this we showcase various possible options.

Copy link
Contributor Author

@AlexElin AlexElin Jan 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

List<Store> getStores();

@RequestMapping(method = RequestMethod.GET, value = "/stores")
@GetMapping("/stores")
Page<Store> getStores(Pageable pageable);

@RequestMapping(method = RequestMethod.POST, value = "/stores/{storeId}", consumes = "application/json")
@PostMapping(value = "/stores/{storeId}", consumes = "application/json")
Store update(@PathVariable("storeId") Long storeId, Store store);

@RequestMapping(method = RequestMethod.DELETE, value = "/stores/{storeId:\\d+}")
@DeleteMapping("/stores/{storeId:\\d+}")
void delete(@PathVariable Long storeId);
}
----
Expand Down Expand Up @@ -443,10 +443,10 @@ Spring Cloud CircuitBreaker supports the notion of a fallback: a default code pa
@FeignClient(name = "test", url = "http://localhost:${server.port}/", fallback = Fallback.class)
protected interface TestClient {

@RequestMapping(method = RequestMethod.GET, value = "/hello")
@GetMapping("/hello")
Hello getHello();

@RequestMapping(method = RequestMethod.GET, value = "/hellonotfound")
@GetMapping("/hellonotfound")
String getException();

}
Expand Down Expand Up @@ -475,10 +475,10 @@ If one needs access to the cause that made the fallback trigger, one can use the
fallbackFactory = TestFallbackFactory.class)
protected interface TestClientWithFactory {

@RequestMapping(method = RequestMethod.GET, value = "/hello")
@GetMapping("/hello")
Hello getHello();

@RequestMapping(method = RequestMethod.GET, value = "/hellonotfound")
@GetMapping("/hellonotfound")
String getException();

}
Expand Down Expand Up @@ -532,7 +532,7 @@ This allows grouping common operations into convenient base interfaces.
----
public interface UserService {

@RequestMapping(method = RequestMethod.GET, value ="/users/{id}")
@GetMapping("/users/{id}")
User getUser(@PathVariable("id") long id);
}
----
Expand Down