Skip to content

Conversation

bsayli
Copy link
Owner

@bsayli bsayli commented Sep 19, 2025

This PR introduces:
• Automatic wrapper schema registration

  • Adds AutoWrapperSchemaCustomizer and ResponseTypeIntrospector to dynamically detect and register ServiceResponse wrappers for all controller methods.
  • Ensures all response data types (CustomerDto, CustomerCreateResponse, etc.) are automatically exposed in the OpenAPI spec without manual registration.
    • Client generation template refactoring
  • Reorganizes OpenAPI generator templates so that only customized templates (api_wrapper.mustache, model.mustache) are kept under src/main/resources/openapi-templates.
  • Integrates upstream templates dynamically via Maven plugins (maven-dependency-plugin + maven-resources-plugin) to ensure compatibility with OpenAPI Generator version 7.15.0.
  • Fixes output path for generated sources (src/gen/java instead of src/gen/java/main).

Outcome:
• Cleaner OpenAPI spec with automatically maintained wrapper schemas.
• Simplified client generation process while keeping template customizations minimal and version-aligned.
• More professional, maintainable, and future-proof setup for both service and client modules.

…te overlay

- customer-service:
  * Added `ResponseTypeIntrospector` as a Spring component to introspect controller return types.
  * Introduced `AutoWrapperSchemaCustomizer` to automatically register ServiceResponse<T> wrappers in OpenAPI schemas (including async return types).
  * Removed need for manual `SwaggerCustomerResponseCustomizer`.

- customer-service-client:
  * Refactored OpenAPI Generator configuration to support upstream template unpacking.
  * Effective template directory now built by combining upstream Java templates with local overrides.
  * Only customized templates (`model.mustache`, `api_wrapper.mustache`) remain under `src/main/resources/openapi-templates`.

This enables automatic OpenAPI schema generation for all response types and simplifies template maintenance by leveraging upstream defaults.
…per screenshots

- Bumped project version to 0.6.0 in all pom.xml files (service & client)
- Replaced outdated screenshots (`before` and `after`) with updated versions
- Screenshots now show correct folder structure (`src/gen/java`)
- Keeps documentation and artifacts aligned with latest client generation changes
@bsayli bsayli merged commit 148124e into main Sep 19, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants