Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question]: Specify max and min range for double and decimal datatype #3130

Open
c6-dark opened this issue Nov 7, 2024 · 1 comment
Open
Labels

Comments

@c6-dark
Copy link

c6-dark commented Nov 7, 2024

What are you wanting to achieve?

Because of some requirements, I want to specify max and min values of decimal and double datatype for both of them but in the above case, the swagger is not showing maximum and minimum for both.

What code or approach do you have so far?

[Range[decimal.minvalue, decimal.maxvalue)]
public decimal amt { get; set; }

[Range[double.minvalue, double.maxvalue)]
public double pamt { get; set; }

How do I achieve the above so the max and min value of decimal and double is shown in swagger

Additional context

No response

@amabilee
Copy link

amabilee commented Nov 7, 2024

Hey there!
Have you tried the Swashbuckle.AspNetCore.Annotations package?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants