Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Tried using the package with python3.13 and hit this issue:
KeyError: "response_field'. Did you mean 'response_model"
I believe it's because python3.13 is trying to be more helpful in the error message when it hits a TypeError:
Example:
"APIRouter.add_api_route() got an unexpected keyword argument 'response_field'. Did you mean 'response_model'?"
The current parsing fails because it extracts
"response_field'. Did you mean 'response_model"
from this error.Using
split
approach is compatible with all versions.The tests pass here: https://github.com/OlegZv/fastapi-versionizer/actions/runs/12386557668
Changes
_add_rout_to_router
to extract the argument using string.split
method.3.12
and3.13
to the strategy matrix.actions/setup-python
action version to v5.3.0.(@alexschimpf tagging you because I cannot assign you for review :) )