r/FastAPI • u/zupiterss • Feb 13 '26
Other Finally got Cursor AI to stop writing deprecated Pydantic v1 code (My strict .cursorrules config)
Hi All,
I spent the weekend tweaking a strict
.cursorrules file for FastAPI + Pydantic v2 projects because I got tired of fixing:
class Config:instead ofmodel_config = ConfigDict(...)- Sync DB calls inside async routes
- Missing type hints
It forces the AI to use:
- Python 3.11+ syntax (
|types) - Async SQLAlchemy 2.0 patterns
- Google-style docstrings
If anyone wants the config file, let me know in the comments and I'll DM it / post the link (it's free)."
==========================================
Here it is. Please leave feedback. Replace "[dot]" with "."
tinyurl [dot] com/cursorrules-free
30
Upvotes
View all comments
3
u/Ok_Bedroom_5088 Feb 13 '26
honest question, whats the upside of using cursor instead of smth else?