Releases: bsayli/spring-boot-openapi-generics-clients
v0.6.2 – Clearer docs & Spring Boot 3.4.10 upgrade
Refinement over v0.6.1 with improved API semantics, error handling, and documentation.
Highlights
- 🔼 Spring Boot upgraded to 3.4.10 (latest patch for stability & fixes).
- 📦 Package root standardized to
io.github.bsayli.customerservice(cleaner, consistent naming). - ✅ REST semantics corrected:
createCustomernow returns 201 Created with aLocationheader. - 🛡 Error handling improved: added
CustomerControllerAdvicewith a unified
ServiceResponse<ErrorPayload>contract (validation violations, type mismatch, unreadable body, and generic errors),
plus null-safe logging for edge cases. - 📑 Docs polished across the repo:
- clearer TL;DR and usage for both service and client
- adapter pattern example
- removed “demo” phrasing; more professional tone
- 🧰 CI enhancements:
- GitHub Actions now uploads OpenAPI spec (YAML) and generated client sources as artifacts
- build logs list generated outputs for quick inspection
Why it matters
This release makes the API more predictable (201 + Location, consistent error payloads) and the client integration
cleaner (strong typing via generics, thinner wrappers). Documentation and CI artifacts make it easier to evaluate and adopt
the pattern in real projects.
Next Steps
The next natural step is to extract the auto schema registration and generics-aware templates into
standalone modules. This will allow any project using ServiceResponse<T> to enable the same behavior
just by adding a dependency:
io.github.bsayli:openapi-generics-autoreg→ server-side: automatically registers wrapper schemas in the OpenAPI spec.io.github.bsayli:openapi-generics-templates→ client-side: plugs into OpenAPI Generator for thin, type-safe wrappers.
This way, teams can adopt generics-aware OpenAPI support with a single Maven/Gradle line, without copying templates or customizers.
v0.6.1 – Auto OpenAPI wrapper schemas (refinement over 0.6.0)
Refinement over v0.6.0 with automatic schema registration for generic wrappers.
Highlights
• Introduced ResponseTypeIntrospector to automatically detect generic ServiceResponse return types in controllers.
• Added AutoWrapperSchemaCustomizer to auto-register OpenAPI schemas for wrapped response DTOs.
• Refactored internals using Java 21 enhanced switch patterns for cleaner unwrap logic.
This release reduces boilerplate and keeps API documentation aligned with controller signatures.
Customer Service v0.6.0 — Auto Wrapper Schemas & Client Template Refactor
✨ What’s New in v0.6.0
• 🤖 Automatic wrapper schema registration
• Added AutoWrapperSchemaCustomizer and ResponseTypeIntrospector
• Dynamically detects all ServiceResponse return types in controllers
• Automatically registers wrapper schemas (e.g., ServiceResponseCustomerDto) in OpenAPI spec
• 🛠 Refactored client generation templates
• Only custom templates (api_wrapper.mustache, model.mustache) remain under src/main/resources/openapi-templates
• All other upstream templates are pulled dynamically via Maven plugins (maven-dependency-plugin + maven-resources-plugin)
• Ensures full compatibility with OpenAPI Generator 7.15.0
• 📂 Fixed generated source path
• Corrected output path to src/gen/java (previously src/gen/java/main)
• Updated docs and screenshots to reflect new structure
📦 Why this matters
• Eliminates manual wrapper registration in customer-service
• Keeps customer-service-client leaner and easier to maintain
• Reduces drift from upstream OpenAPI templates while preserving generics support
• More professional and future-proof client generation setup
Customer Service v0.5.0 — Synced with OpenAPI Generator 7.15.0
✨ What’s New in v0.5.0
- 🔄 Synced with OpenAPI Generator 7.15.0 template set
- Added official
sealed.mustachesupport - Ensured custom generics-aware wrapper logic remains compatible
- Added official
📦 Why this matters
Keeping in sync with upstream templates reduces drift and ensures long-term maintainability, while still preserving type-safe generic wrappers.
🚀 Next Release (planned)
- Automatic OpenAPI wrapper schema registration (via method return type introspection)
- Refactored OpenAPI client generation templates: only custom mustache overrides are kept, upstream templates are managed automatically
Customer Service v0.4.0 — HttpClient5 Integration + OpenAPI Cleanup
🚀 Highlights
This release introduces significant improvements to both the sample service (customer-service) and the generated client (customer-service-client).
✨ Customer Service
- Bumped project version to 0.4.0
- Updated OpenAPI configuration to fetch version directly from Maven property
- Removed hardcoded version field from
OpenApiConstants - Simplified
OpenApiConfigand aligned with centralized constants - Improved configuration properties (
app.openapi.base-url)
📦 Customer Service Client
- Bumped project version to 0.4.0
- Added Apache HttpClient 5 integration with connection pooling & timeouts
- Updated
CustomerApiClientConfigto support HttpClient-basedRestClient - Improved integration tests with MockWebServer
- Refined generic response wrappers (
ServiceClientResponse<T>) with error details - README updated:
- Added build & release badges
- Added "before vs after" wrapper comparison
- Added HttpClient mention in feature list
- Social preview image finalized
🔧 General
- Consistent use of
ServiceClientResponse<T>naming across modules - Cleaned up redundant constants and unused fields
- Prepared for future evolution of response envelopes with strong typing
🔖 Tag: v0.4.0
📦 Modules: customer-service, customer-service-client
🛡 License: MIT
Customer Service v0.3.0 — Full CRUD + Generic Response Enhancements
🚀 What’s New in v0.3.0
This release upgrades the customer-service module into a complete CRUD demo built on Spring Boot 3.4 and OpenAPI 3.1, fully aligned with our generics-aware client generation approach.
✨ Highlights
- Full CRUD Support
createCustomer,getCustomer,getCustomers,updateCustomer,deleteCustomer
- Consistent DTOs
CustomerCreateResponse,CustomerUpdateResponse,CustomerDeleteResponse,CustomerListResponse
- Controller Advice
- Centralized exception handling with
CustomerControllerAdvice - Standardized error codes via
ApiErrorCodes
- Centralized exception handling with
- Tests
- Unit tests for both controller and service layers
- Integration test for client using MockWebServer
- OpenAPI Spec
- Clean
ApiResponse<T>wrappers across all endpoints - Swagger UI at
/swagger-ui/index.html
- Clean
🛠 Tech Stack
- Java 21
- Spring Boot 3.4.9
- Springdoc OpenAPI 2.8.x
- OpenAPI Generator 7.14
- JUnit 5 + Mockito + MockWebServer
📚 Docs
- Updated
README.mdin both customer-service and customer-service-client - Root README now reflects CRUD and client evolution
🔖 Versioning
- Bumped version:
0.3.0 - This marks the first stable CRUD baseline for demos.
- Next iterations may expand with more advanced patterns (pagination, validation groups, etc.).
✅ Try it out:
cd customer-service
mvn spring-boot:run
# Swagger: http://localhost:8084/customer-service/swagger-ui/index.htmlRelease 0.2.1
🎉 Release 0.2.1
This release aligns the repository around a clearer separation of concerns:
- Demo service remains under
com.example.demo. - Reusable client library migrates to
io.github.bsayli.openapi.client.
✨ Highlights
- Namespace migration (client)
com.example.demo.client.*→io.github.bsayli.openapi.client.* - Maven coordinates
Updated clientgroupId→io.github.bsayli - OpenAPI Generator config
UpdatedapiPackage,modelPackage,invokerPackageto new namespace - Mustache partial
api_wrapper.mustachenow extends the base class via FQN:
extends io.github.bsayli.openapi.client.common.ApiClientResponse<T> - Spec alignment
Fixed server URL and response code (201) to match the demo service - Docs
Updated README examples and replaced wrapper screenshot to reflect new namespace
⚠️ Breaking Change
The client library namespace has changed.
If you upgrade from 0.1.x, update your imports and configuration:
io.github.bsayli.openapi.client.generated.*
io.github.bsayli.openapi.client.common.ApiClientResponse📦 Modules
customer-service0.2.1 — demo Spring Boot service (unchanged API, version bumped for consistency)customer-service-client0.2.1 — reusable OpenAPI client with generics-aware wrappers
🚀 Quick Start
# 1) Run the service
cd customer-service
mvn spring-boot:run
# 2) Build the client
cd ../customer-service-client
mvn clean install📎 Assets (optional)
To enrich the release, consider attaching:
customer-service-client-0.2.1.jar(and-sources.jar)- Generated sources archive:
generated-client-sources-0.2.1.zip - Updated screenshot:
generated-client-wrapper.png
Initial Demo Release
🎉 First demo release of spring-boot-openapi-generics-clients
This release showcases how to generate type-safe OpenAPI clients that keep a generic ApiResponse<T> envelope—no more duplicated wrappers per endpoint.
What’s included
- Sample Spring Boot 3.4 microservice:
customer-service - Generated client with generics-aware wrappers:
customer-service-client - Tiny custom Mustache partial for OpenAPI Generator
- Integration test with OkHttp MockWebServer
- Docs with Quick Start and screenshots (Swagger + generated wrapper)
Quick Start
# 1) Run the service
cd customer-service
mvn spring-boot:run
# 2) Build the client
cd ../customer-service-client
mvn clean install