DataAnnotations metadata import
Consume validation metadata exported from .NET DataAnnotations through a documented JSON contract, generated by an optional open-source server helper. Rules such as Required, Range, StringLength, RegularExpression and EmailAddress map to grid rules, so ASP.NET teams keep their rules in one place.
Planned. This page shows the specification from issue #195. The live example, source for every framework and the API reference replace it when the feature ships.
Live example
Grid loading metadata JSON from a static mock that represents a C# Customer model.
Expected behavior
Required, Range, StringLength and RegularExpression map to rules. The server-provided ErrorMessage strings are used when enabled. Unknown attributes are listed as unsupported.
Planned API surface
validationMetadataannotationsAdaptermetadataUrlannotationMapAcceptance criteria
- The JSON contract is documented and versioned. (pending)
- The mapping table is tested for each supported attribute. (pending)
- Custom attributes can be mapped via annotationMap. (pending)
- There is no runtime dependency on .NET in the client. (pending)