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
TL;DR
Generics-aware OpenAPI does not require configuration, annotations, or schema duplication.
With a canonical contract as authority and reflection as the discovery mechanism, the system becomes deterministic end-to-end.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Reflection‑First Strategy for Generics Detection (KISS Principle)
📑 Table of Contents
Context
Current Direction — Contract + Reflection
Why No Configuration?
Generic Depth Policy
Projection Boundary (Critical)
Generator Boundary (Critical)
Architectural Guarantees
Summary
Context
This platform follows a strict rule:
The canonical contract is defined in:
It owns:
ServiceResponse<T>— success envelopePage<T>,Meta,Sort— paginationAll other layers:
are derived from this contract, not independent authorities.
Current Direction — Contract + Reflection
The system uses reflection only, but within a strict architectural boundary:
1️⃣ Controller Inspection
At runtime, controller methods are inspected.
Return types are unwrapped until the contract boundary is reached.
Supported wrappers (non-exhaustive):
ResponseEntity<T>CompletionStage<T>DeferredResult<T>Unwrapping stops at:
2️⃣ Generic Resolution
Using
ResolvableType, the system resolves:ServiceResponseTPage<T>Supported depths:
ServiceResponse<CustomerDto>ServiceResponse<Page<CustomerDto>>This is a design constraint, not a limitation.
3️⃣ Container Semantics
Containers are not inferred arbitrarily.
They are recognized only if defined in the contract.
Example:
Page<T>→ recognizedProjection enriches schema with metadata:
No metadata is added if resolution is uncertain.
4️⃣ Safety & Determinism
System guarantees:
Key rule:
Why No Configuration?
Because configuration introduces duplication.
With a canonical contract:
Generic Depth Policy
Only one level of nesting is allowed:
This ensures:
Projection Boundary (Critical)
OpenAPI is a projection layer.
It:
It does not:
Generator Boundary (Critical)
Generator responsibility is minimal:
It does not:
Example:
All semantics come from the contract module.
Architectural Guarantees
This architecture guarantees:
Summary
This approach proves:
No annotations. No YAML. No configuration.
Only:
Beta Was this translation helpful? Give feedback.
All reactions