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
docs: full documentation overhaul for generics-aware architecture and RFC 7807 alignment
- Rewrote root README.md with modern architectural overview, response flow diagram, and end-to-end example
- Updated all adoption guides under /docs/adoption:
- server-side-adoption.md → now includes {data, meta} envelope and optional Problem extensions
- client-side-adoption.md → fully refactored for RFC 7807 ProblemDetail decoding and RestClient integration
- client-side-adoption-pom.md → clarified Maven plugin chain, properties, and new additionalProperties syntax
- Added consistent formatting, section numbering, and Google-style code blocks
- Unified terminology: “ServiceResponse<T> / ServiceClientResponse<T>” and “Meta” across all examples
- Refined OpenAPI 3.1 alignment (springdoc 2.8.13, generator 7.16.0, HttpClient5 5.5)
- Introduced clean architecture diagram for end-to-end client generation flow
- Improved readability and SEO structure for GitHub Pages rendering
Result: project docs now reflect the final {data, meta} response model, nested generics support, and full ProblemDetail compliance.
<em>End-to-end generics-aware OpenAPI clients — unified `{ data, meta }` responses without boilerplate.</em>
16
+
<em>End-to-end generics-aware OpenAPI clients — unified <code>{ data, meta }</code> responses without boilerplate.</em>
17
17
</p>
18
18
19
-
**Type-safe client generation with Spring Boot & OpenAPI using generics.**
20
-
This repository demonstrates how to extend OpenAPI Generator to support **nested generics** and the new unified
21
-
`{ data, meta }` response model — eliminating duplicated wrappers and repetitive boilerplate.
19
+
**Modern, type-safe OpenAPI client generation** — powered by **Spring Boot 3.4**, **Java 21**, and **OpenAPI Generator 7.16.0**.
20
+
This repository demonstrates a production-grade architecture where backend and client are fully aligned through generics, enabling nested generic envelopes (ServiceResponse<Page<T>>) and RFC 7807 ProblemDetail (Problem Details for HTTP APIs)–based error handling.
| **Nested Generics** | Full support for `ServiceResponse<Page<T>>` |
99
107
100
108
---
101
109
@@ -109,62 +117,102 @@ cd customer-service && mvn spring-boot:run
109
117
cd ../customer-service-client && mvn clean install
110
118
```
111
119
112
-
Generated wrappers are located under:
120
+
Generated wrappers appear under:
113
121
114
122
```
115
123
target/generated-sources/openapi/src/gen/java
116
124
```
117
125
118
-
Each wrapper extends `ServiceClientResponse<T>` and is aligned with the new `{ data, meta }` envelope.
126
+
Each wrapper extends `ServiceClientResponse<T>` and aligns perfectly with the `{ data, meta }` envelope model.
119
127
120
128
---
121
129
122
-
## 🧱 Example Response
130
+
## 🖼 Generated Client Wrapper — Before & After
131
+
132
+
Comparison of how OpenAPI Generator outputs looked **before** vs **after** enabling the generics-aware wrapper support.
133
+
134
+
**Before (duplicated full model):**
135
+
136
+
<p align="center">
137
+
<img src="docs/images/generated-client-wrapper-before.png" alt="Generated client before generics support" width="800"/>
138
+
<br/>
139
+
<em>Each endpoint generated its own full response model — duplicated <code>data</code> and <code>meta</code> fields across classes.</em>
140
+
</p>
141
+
142
+
**After (thin generic wrapper):**
143
+
144
+
<p align="center">
145
+
<img src="docs/images/generated-client-wrapper-after.png" alt="Generated client after generics support" width="800"/>
146
+
<br/>
147
+
<em>Now every endpoint extends the reusable <code>ServiceClientResponse<Page<T>></code> base, eliminating boilerplate and preserving type safety.</em>
148
+
</p>
149
+
150
+
---
151
+
152
+
## 🧱 Example Responses
153
+
154
+
The unified envelope applies to both single and paged responses. Below is a paged example:
155
+
156
+
### Paged Example (`ServiceClientResponse<Page<CustomerDto>>`)
0 commit comments