Skip to content

Conversation

captainsafia
Copy link
Member

Addresses #57390.

This change hardens the parsing logic for [Range] attributes to handle:

  • Values that cannot be mapped to a decimal as is required by the minimum and maximum keywords in the OpenAPI schema, like DateTime.
  • Handling for InvariantCulture as is set in RangeAttribute.ParseLimitsInInvariantCulture.

For scenarios where the range value is too large to be represented as a decimal, this implementation will no-op and not set the corresponding minimum or maximum in the OpenAPI document.

@captainsafia captainsafia requested a review from a team as a code owner November 19, 2024 01:56
@ghost ghost added the area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates label Nov 19, 2024
Copy link
Contributor

@mikekistler mikekistler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! 👍

@captainsafia captainsafia merged commit c6dab02 into main Nov 20, 2024
27 checks passed
@captainsafia captainsafia deleted the safia/fix-range-handling branch November 20, 2024 16:29
@captainsafia
Copy link
Member Author

/backport to release/9.0

Copy link
Contributor

Started backporting to release/9.0: https://github.com/dotnet/aspnetcore/actions/runs/11937638584

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants