Skip to content

Ensure that all ValidationAttributes are native AoT compatible #61221

Open
@captainsafia

Description

@captainsafia

Not all ValidationAttributes exposed by System.ComponentModel are native AoT compatible. Some use unbounded reflection to determine types and availalbe APIs on them.

We should make an effort to ensure that all non-native Aot compatible ValidationAttributes are consumed safely in the validation implementation.

  • RangeAttribute: Can be achieved by introducing a new generic overload of the attribute that also supports being able to set MinValue and MaxValue independently
  • MaxLengthAttribute: Uses reflection to get Count property. Might require source generation.
  • Others?

Metadata

Metadata

Assignees

No one assigned

    Labels

    NativeAOTarea-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcfeature-validationIssues related to model validation in minimal and controller-based APIs

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions