Skip to content

Conversation

@danparizher
Copy link
Contributor

Summary

Fixes #20680

@github-actions
Copy link
Contributor

github-actions bot commented Oct 2, 2025

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@dscorbett
Copy link

is_fastapi_valid_path_parameter doesn’t exactly match the regex FastAPI uses.

@ntBre
Copy link
Contributor

ntBre commented Oct 3, 2025

It makes sense to me just to use the same regex. It looks like they just iterate over the regex matches to extract parameters too, which might help us simplify PathParamIterator as well.

@ntBre ntBre added bug Something isn't working rule Implementing or modifying a lint rule labels Oct 3, 2025
Copy link
Contributor

@ntBre ntBre left a comment

Choose a reason for hiding this comment

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

Thanks! I pushed one commit pushing the refactor a bit further. Now that we're using a regex, we can just use Regex::captures_iter. I also added a link to the upstream regex for easier reference in the future.

@ntBre ntBre merged commit 537ec5f into astral-sh:main Oct 9, 2025
37 checks passed
@danparizher danparizher deleted the fix-20680 branch October 9, 2025 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working rule Implementing or modifying a lint rule

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FAST003 false positives for path parameters that FastAPI doesn’t recognize

3 participants