Skip to content

Commit 44f1989

Browse files
committed
docs: extend README with adapter interface usage example
- Added adapter interface example showing consolidated generic client methods - Clarifies how thin wrappers can be hidden behind a type-safe abstraction - Keeps focus on clean client usage while preserving compile-time type safety
1 parent c9b278d commit 44f1989

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,27 @@ spring-boot-openapi-generics-clients/
118118

119119
---
120120

121+
### ✨ Usage Example: Adapter Interface
122+
123+
Sometimes you don’t want to expose all the thin wrappers directly.
124+
A simple adapter interface can consolidate them into clean, type-safe methods:
125+
126+
```java
127+
public interface CustomerClientAdapter {
128+
ServiceClientResponse<CustomerCreateResponse> createCustomer(CustomerCreateRequest request);
129+
130+
ServiceClientResponse<CustomerDto> getCustomer(Integer customerId);
131+
132+
ServiceClientResponse<CustomerListResponse> getCustomers();
133+
134+
ServiceClientResponse<CustomerUpdateResponse> updateCustomer(
135+
Integer customerId, CustomerUpdateRequest request);
136+
137+
ServiceClientResponse<CustomerDeleteResponse> deleteCustomer(Integer customerId);
138+
}
139+
```
140+
---
141+
121142
## 🔍 Why This Matters
122143

123144
Without generics support, OpenAPI client generation creates bloated and repetitive code.

0 commit comments

Comments
 (0)