domaindrivendev / Swashbuckle.AspNetCore

Swagger tools for documenting API's built on ASP.NET Core
MIT License
5.26k stars 1.32k forks source link

[Question]: I have a integer array. I want to specify maximum and minimum for integer stored in the array. #3120

Open c6-dark opened 1 month ago

c6-dark commented 1 month ago

What are you wanting to achieve?

I have an integer public int[] array {get; set;}. I have used Maximum and Minimum length to specify a range for the array. I want to specify the same for the integer stored in the array

What code or approach do you have so far?

[Minimum(0), Maximum(100)] public int[] array {get; set;}

Additional context

No response

jgarciadelanoceda commented 2 weeks ago

Studying

jgarciadelanoceda commented 5 days ago

You can use this library if you use FluentValidation in your project. https://github.com/micro-elements/MicroElements.Swashbuckle.FluentValidation. RuleForEach works as expected