Riptide: Compatibility adds a Spring Web Client compatibility layer on top of Riptide.
User user = http.getForObject("/user/{id}", User.class, 1);
- Compatibility adapters for
- Java 8
- Riptide: Core
- Riptide: Capture
- Riptide: Problem
Add the following dependency to your project:
<dependency>
<groupId>org.zalando</groupId>
<artifactId>riptide-compatibility</artifactId>
<version>${riptide.version}</version>
</dependency>
RestOperations http = new HttpOperations(Http.builder()
// ...
.build());
AsyncRestOperations http = new AsyncHttpOperations(Http.builder()
// ...
.build());
The default routing tree can be overridden:
new HttpOperations(http)
.withDefaultRoutingTree(tree);
If not specified the routing tree will default to:
new HttpOperations(http)
.withDefaultRoutingTree(
dispatch(series(),
anySeries().call(problemHandling())));
That gives you the following, effective routing tree:
Series?
├── 2xx: capture/pass
└── any: Content-Type?
├── application/problem+json: throw
├── application/x.problem+json: throw
├── application/x-problem+json: throw
└── any: unsupported response
ResponseEntity<User> response = http.getForEntity("/users/{id}", User.class, 1);
Any operation within RestOperations and AsyncRestOperations are supported.
If you have questions, concerns, bug reports, etc., please file an issue in this repository's Issue Tracker.
To contribute, simply make a pull request and add a brief description (1-2 sentences) of your addition or change. For more details, check the contribution guidelines.