fix(galaxyrepo): drop no-op ValidateOnStart (consumer owns validation)
This commit is contained in:
+4
-2
@@ -36,10 +36,12 @@ public static class GalaxyRepositoryServiceCollectionExtensions
|
|||||||
ArgumentNullException.ThrowIfNull(configuration);
|
ArgumentNullException.ThrowIfNull(configuration);
|
||||||
ArgumentException.ThrowIfNullOrWhiteSpace(sectionPath);
|
ArgumentException.ThrowIfNullOrWhiteSpace(sectionPath);
|
||||||
|
|
||||||
|
// Bind only — this shared lib ships no validator, so a .ValidateOnStart() here
|
||||||
|
// would be a silent no-op. The consuming application owns option validation
|
||||||
|
// (e.g. the sidecar's ConfigPreflight / validated-options layer).
|
||||||
services
|
services
|
||||||
.AddOptions<GalaxyRepositoryOptions>()
|
.AddOptions<GalaxyRepositoryOptions>()
|
||||||
.Bind(configuration.GetSection(sectionPath))
|
.Bind(configuration.GetSection(sectionPath));
|
||||||
.ValidateOnStart();
|
|
||||||
|
|
||||||
services.AddSingleton(sp =>
|
services.AddSingleton(sp =>
|
||||||
new GalaxyRepository(sp.GetRequiredService<IOptions<GalaxyRepositoryOptions>>().Value));
|
new GalaxyRepository(sp.GetRequiredService<IOptions<GalaxyRepositoryOptions>>().Value));
|
||||||
|
|||||||
Reference in New Issue
Block a user