I have this field that will be mapped from body:
[Required]
public IReadOnlyCollection<long?> Ids { get; set; }
I'd like to add a required attribute (or rather any arbitrary validation attribute) to the element itself (i.e. I want every element of the array validated).
I could create a class that would have an Id, but then I'll need to pass an array of objects from JSON while I'd like ideally to get an array like that [1,2,3,4]
.
Is it possible to do with some trick, I did not manage to figure it out?