# Router YAML/JSON Configuration with Hot-Reload ## Module Router ## Status IMPLEMENTED ## Description Centralized router configuration supporting YAML and JSON formats with `IOptionsMonitor` integration and `FileSystemWatcher`-based hot-reload. Includes validation, change event notification, and per-service routing options. ## Implementation Details - **Modules**: `src/Router/__Libraries/StellaOps.Router.Config/` - **Key Classes**: - `RouterConfig` (`src/Router/__Libraries/StellaOps.Router.Config/RouterConfig.cs`) - root configuration model for router settings - `RouterConfigProvider` (`src/Router/__Libraries/StellaOps.Router.Config/RouterConfigProvider.cs`) - watches config files and provides hot-reload via `IOptionsMonitor` - `RouterConfigOptions` (`src/Router/__Libraries/StellaOps.Router.Config/RouterConfigOptions.cs`) - options for config file paths and reload behavior - `GatewayOptions` (`src/Router/StellaOps.Gateway.WebService/Configuration/GatewayOptions.cs`) - gateway-specific configuration options - `GatewayOptionsValidator` (`src/Router/StellaOps.Gateway.WebService/Configuration/GatewayOptionsValidator.cs`) - validates gateway configuration - **Interfaces**: `IRouterConfigProvider` - **Source**: batch_52/file_07.md ## E2E Test Plan - [ ] Load router configuration from a YAML file and verify `RouterConfig` is populated correctly - [ ] Load configuration from a JSON file and verify equivalent behavior - [ ] Modify the config file at runtime and verify `RouterConfigProvider` triggers hot-reload - [ ] Verify change event notification: subscribe to config changes and confirm notification on reload - [ ] Verify validation: provide invalid config values and confirm `GatewayOptionsValidator` rejects them