You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b2b4085
Browse filesBrowse the repository at this point in the historyBrowse files
Adrian Cole
committed
Adds base api support via single-inheritance interfaces
Before this change, apis that follow patterns across a service could
only be modeled by copy/paste/find/replace. Especially with a large
count, this is monotonous and error prone.
This change introduces support for base apis via single-inheritance
interfaces. Users ensure their target interface bind any type variables
and as a result have little effort to create boilerplate apis.
Ex.
```java
@headers("Accept: application/json")
interface BaseApi<V> {
@RequestLine("GET /api/{key}")
V get(@PARAM("key") String);
@RequestLine("GET /api")
List<V> list();
@headers("Content-Type: application/json")
@RequestLine("PUT /api/{key}")
void put(@PARAM("key") String, V value);
}
interface FooApi extends BaseApi<Foo> { }
interface BarApi extends BaseApi<Bar> { }
```
closesOpenFeign#133
0 commit comments