Replies: 1 comment
-
|
This discussion reflects an early design stage of the project. The architecture described here was superseded by the container-aware infrastructure introduced in OpenAPI Generics 1.1.0. Current capabilities include:
For current architecture and supported capabilities, refer to the latest documentation. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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