Missing required fields give 500 instead of 400
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 68/100
Direzione di ricerca
Start with the three controllers named in the issue: src/Controller/CycleController.php, UserController.php and ScoreController.php, looking at where each reads request fields without checking them. The pinned behaviour is in tests/Api/CycleTest.php (around line 169), tests/Api/UserManagementTest.php (around line 107) and tests/Api/ScoreTest.php (around line 93), marked NOTE: current behaviour. Done means each missing required field returns 400 naming the missing fields, and those tests are updated to assert it.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
Several custom endpoints read request fields without checking them, so a missing field ends in "Undefined array key" and a 500:
POST /api/cycleswithouttoDatePOST /api/userswithoutlastnamePOST /api/scores/{id}/setPaymentStatuswithoutnewPaymentStatus
Only unknown fields are rejected today.
Expected
400 with the names of the missing fields (validate the payload, e.g. with a DTO + Validator or MapRequestPayload).
Where
src/Controller/CycleController.php, UserController.php, ScoreController.php.
Pinned in tests/Api/CycleTest.php (around line 169), tests/Api/UserManagementTest.php (around line 107) and tests/Api/ScoreTest.php (around line 93).
Found by the API test suite added for #57 (branch feature/57-symfony-7.4); the behaviour is the same before and after the Symfony 7.4 upgrade. The current behaviour is pinned in the test named above (marked NOTE: current behaviour), so update that test together with the fix.
- Lingua principale
- PHP
- Stelle
- 1
- Fork
- 0
- Merge medio
- 7h 58m
- PR unite (30g)
- 3
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di RunningJoke/allipunkte
-
Backend bug severity: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
RunningJoke/allipunkte#74 ·
-
Backend bug severity: low
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
RunningJoke/allipunkte#73 ·
-
Backend bug severity: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
RunningJoke/allipunkte#72 ·
-
Backend bug severity: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
RunningJoke/allipunkte#71 ·
-
Backend bug severity: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
RunningJoke/allipunkte#68 ·
Tutte le issue di RunningJoke/allipunkte
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
2DAW-CarlosIII/eportfolio_g5#15 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
2DAW-CarlosIII/eportfolio_g4#16 ·
I maintainer di solito rispondono entro 1 giorno
-
Vinyl Cache 9.1 is now LTSApertabug
Difficoltà 1/5 1-3 ore Idoneità per principianti 70/100
endoflife-date/endoflife.date#11679 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
2DAW-CarlosIII/eportfolio_g1#18 ·
I maintainer di solito rispondono entro 2 giorni