Kaynağa Gözat

fix(library-tags): declare response_model=None on the 204 DELETE route

Under `from __future__ import annotations` the `-> None` return annotation
reaches FastAPI as the string "None", which resolves to NoneType -- truthy,
so APIRoute asserts a 204 may carry no response body and the app fails to
import. fastapi >= 0.116 guards against this; the 0.109-0.115 releases
requirements.txt still allows do not.
maziggy 2 ay önce
ebeveyn
işleme
e1e2c12d25
2 değiştirilmiş dosya ile 6 ekleme ve 1 silme
  1. 0 0
      CHANGELOG.md
  2. 6 1
      backend/app/api/routes/library_tags.py

Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
CHANGELOG.md


+ 6 - 1
backend/app/api/routes/library_tags.py

@@ -186,7 +186,12 @@ async def update_tag(
     )
     )
 
 
 
 
-@router.delete("/{tag_id}", status_code=204)
+# response_model=None is load-bearing under `from __future__ import annotations`:
+# the `-> None` return annotation reaches FastAPI as the string "None", which it
+# resolves to NoneType — a truthy class — and then asserts a 204 may carry no
+# response body. fastapi >= 0.116 special-cases NoneType; on the 0.109-0.115
+# releases requirements.txt still allows, the app fails at import without this.
+@router.delete("/{tag_id}", status_code=204, response_model=None)
 async def delete_tag(
 async def delete_tag(
     tag_id: int,
     tag_id: int,
     db: AsyncSession = Depends(get_db),
     db: AsyncSession = Depends(get_db),

Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor