Description
Currently, source generation only allows a single map handler implementation to be registered. This limitation forces a one-to-one mapping pattern and doesn't support scenarios where different handlers need to be registered based on startup conditions.
Desired Behavior
Update source generation to generate multiple map handler implementations even if those methods are called multiple times. Rather than enforcing a single registration through source generation, the registration check will be implemented in user code, enabling more flexible startup patterns.
A warning should still be emitted saying that multiple handlers are found. This should be suppressible, and docs should be added to say this.
Benefits
- Support testing patterns that require different handler configurations
- Allow conditional registration based on startup conditions
- More flexible dependency registration strategies
- Better support for complex application scenarios
Implementation Notes
- Source generation should detect and generate code for all map handler calls
- Runtime validation/deduplication can be handled by user code instead of source generation
- This enables patterns where the same handler type might be registered with different configurations
Description
Currently, source generation only allows a single map handler implementation to be registered. This limitation forces a one-to-one mapping pattern and doesn't support scenarios where different handlers need to be registered based on startup conditions.
Desired Behavior
Update source generation to generate multiple map handler implementations even if those methods are called multiple times. Rather than enforcing a single registration through source generation, the registration check will be implemented in user code, enabling more flexible startup patterns.
A warning should still be emitted saying that multiple handlers are found. This should be suppressible, and docs should be added to say this.
Benefits
Implementation Notes