Skip to content

feat(server): support application-defined generic containers#30

Merged
bsayli merged 1 commit into
mainfrom
feature/custom-container-support
Jun 27, 2026
Merged

feat(server): support application-defined generic containers#30
bsayli merged 1 commit into
mainfrom
feature/custom-container-support

Conversation

@bsayli

@bsayli bsayli commented Jun 27, 2026

Copy link
Copy Markdown
Member

🧩 Pull Request

🎯 Summary

This PR introduces support for application-defined generic containers in the server-side projection pipeline.

Applications can now register their own generic container contracts (for example Paging<T> or Window<T>) through configuration. Once validated at startup, these containers participate in the same introspection, projection, metadata generation, and reconstruction lifecycle as the built-in List, Set, and Page containers.


📦 Changes

  • Added configuration support for custom generic containers.
  • Introduced a unified container descriptor model for built-in and configured containers.
  • Added startup validation for configured container contracts.
  • Unified container resolution across response introspection and schema enrichment.
  • Extended projection metadata to preserve container identity (x-data-container-type).
  • Expanded unit and type-coverage tests for configurable containers.
  • Added sample applications demonstrating Paging<T> and Window<T> containers.

🧠 Outcome / Impact

  • Enables application-owned generic containers without platform modifications.
  • Removes the need for container-specific platform implementations.
  • Preserves deterministic projection and reconstruction behavior.
  • Unifies built-in and configured containers under a single metadata pipeline.
  • Improves extensibility while remaining fully backward compatible.

🔐 Contract Awareness

Contract impact: yes

Affected areas:

  • OpenAPI projection metadata
  • Vendor extension vocabulary (x-data-container-type)
  • Container metadata generation
  • Response introspection pipeline

Existing response contracts (ServiceResponse<T>, List, Set, Page) remain fully compatible.


🌍 Multi-Language Considerations

The additional vendor extension is ignored by generators that do not recognize it and therefore remains a no-op outside OpenAPI Generics.

Java reconstruction benefits from preserving the fully qualified container type while maintaining compatibility with existing generated specifications.


🧱 Affected Layer

  • Contract (openapi-generics-contract)
  • Projection (openapi-generics-server-starter)
  • Generator (openapi-generics-java-codegen)
  • Generator Parent (openapi-generics-java-codegen-parent)
  • Build / CI
  • Documentation

🔄 Dependency Path Impact

Server path:

server-starter → contract

No client-side dependency changes.


✅ Checklist

  • Scope is minimal and focused
  • Build passes: mvn -q -ntp clean verify
  • Tests added/updated
  • Docs updated where behavior changed
  • Contract impact evaluated
  • No direct edits to generated code
  • Changes applied at the projection layer
  • Linked issue: Support application-defined generic containers #29

🧾 Metadata

@bsayli bsayli linked an issue Jun 27, 2026 that may be closed by this pull request
@bsayli bsayli merged commit 64b8d87 into main Jun 27, 2026
3 checks passed
@bsayli bsayli deleted the feature/custom-container-support branch June 27, 2026 16:18
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.

Support application-defined generic containers

1 participant