dotnet / dotnet/aspnetcore

Move validation of HealthCheckServiceOptions to IValidationOptions<HealthCheckServiceOptions>

Open
#26,573 2 comments 0 reactions 0 assignees View on GitHub
affected-very-few area-healthchecks enhancement severity-nice-to-have
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 6h
Merged PRs (30d)
290

Description

### Is your feature request related to a problem? Please describe.
This isn't related to an issue. It is more of an improvement.

Currently the validation of `HealthCheckServiceOptions` happens in [this private method](https://github.com/dotnet/aspnetcore/blob/master/src/HealthChecks/HealthChecks/src/DefaultHealthCheckService.cs#L158). It'd be better if the code could be moved into an instance of `IValidationOptions`.

### Describe the solution you'd like
Something like https://github.com/weichch/aspnetcore/pull/3

### Additional context
It is also possible to use a dictionary to manage health check registrations if we could make registration name immutable https://github.com/dotnet/aspnetcore/issues/26572. Then validation becomes redundant.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.