Description
Greetings.
Apparently, there is no mention of the [ValidateObjectMembers] attribute (Microsoft.Extensions.Options.ValidateObjectMembersAttribute). Without it and as you already know, validation doesn't propagate recursively to object members which is (in my humble opinion) rather unintuitive. Since nothing warned me about this, I spent hours trying to figure out why validation didn't occur.
I actually didn't find any documentation about it besides at dotnet/runtime#36093 .
Page URL
https://learn.microsoft.com/en-us/aspnet/core/fundamentals/configuration/options?view=aspnetcore-9.0
Content source URL
https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/fundamentals/configuration/options.md
Document ID
dc7e3449-650b-d117-5eac-69e5ccb250cb
Platform Id
c815d451-e2c8-0cf1-5862-03b12dd0392a
Article author
@tdykstra
Metadata
- ID: ed39cb0e-aa85-8bba-ffb4-859b56a60723
- PlatformId: c815d451-e2c8-0cf1-5862-03b12dd0392a
- Service: aspnet-core
- Sub-service: fundamentals
Related Issues
Description
Greetings.
Apparently, there is no mention of the
[ValidateObjectMembers]attribute (Microsoft.Extensions.Options.ValidateObjectMembersAttribute). Without it and as you already know, validation doesn't propagate recursively to object members which is (in my humble opinion) rather unintuitive. Since nothing warned me about this, I spent hours trying to figure out why validation didn't occur.I actually didn't find any documentation about it besides at dotnet/runtime#36093 .
Page URL
https://learn.microsoft.com/en-us/aspnet/core/fundamentals/configuration/options?view=aspnetcore-9.0
Content source URL
https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/fundamentals/configuration/options.md
Document ID
dc7e3449-650b-d117-5eac-69e5ccb250cb
Platform Id
c815d451-e2c8-0cf1-5862-03b12dd0392a
Article author
@tdykstra
Metadata
Related Issues