Skip to content

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Nov 20, 2024

Backport of #59043 to release/9.0

/cc @captainsafia

Description

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.

Fixes #57390

Customer Impact

Prevents unhandled exceptions when customers use the Range(object, object) overloads of the Range attribute instead of those that take a double/integer. There's no immediate workarounds for this bug outside of removing the attribute.

Regression?

  • Yes
  • No

Risk

  • High
  • Medium
  • Low

Change localized to Range attribute handling in OpenAPI package.

Verification

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

@github-actions github-actions bot requested review from captainsafia and a team as code owners November 20, 2024 16:30
@ghost ghost added the area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates label Nov 20, 2024
@dotnet-policy-service dotnet-policy-service bot added this to the 9.0.x milestone Nov 20, 2024
Copy link
Member

@captainsafia captainsafia left a comment

Choose a reason for hiding this comment

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

Good bot! 🤖

@captainsafia captainsafia added Servicing-consider Shiproom approval is required for the issue Servicing-approved Shiproom has approved the issue and removed Servicing-consider Shiproom approval is required for the issue labels Nov 27, 2024
@captainsafia
Copy link
Member

Approved via email.

@wtgodbe wtgodbe merged commit 198cf83 into release/9.0 Nov 27, 2024
25 checks passed
@wtgodbe wtgodbe deleted the backport/pr-59043-to-release/9.0 branch November 27, 2024 20:30
@dotnet-policy-service dotnet-policy-service bot modified the milestones: 9.0.x, 9.0.1 Nov 27, 2024
This was referenced Aug 15, 2025
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 Servicing-approved Shiproom has approved the issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants