Skip to content

Latest commit

 

History

History
 
 

riptide-compatibility

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Riptide: Compatibility

Toy Car

Javadoc Maven Central

Riptide: Compatibility adds a Spring Web Client compatibility layer on top of Riptide.

Example

User user = http.getForObject("/user/{id}", User.class, 1);

Features

Dependencies

  • Java 8
  • Riptide: Core
  • Riptide: Capture
  • Riptide: Problem

Installation

Add the following dependency to your project:

<dependency>
    <groupId>org.zalando</groupId>
    <artifactId>riptide-compatibility</artifactId>
    <version>${riptide.version}</version>
</dependency>

Configuration

RestOperations http = new HttpOperations(Http.builder()
        // ...
        .build());
AsyncRestOperations http = new AsyncHttpOperations(Http.builder()
        // ...
        .build());

Default Routing Tree

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

Usage

ResponseEntity<User> response = http.getForEntity("/users/{id}", User.class, 1);

Any operation within RestOperations and AsyncRestOperations are supported.

Getting Help

If you have questions, concerns, bug reports, etc., please file an issue in this repository's Issue Tracker.

Getting Involved/Contributing

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.