Unknown IDs/IRIs in custom endpoints give 500 instead of 404/400
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- Mezza giornata
- Idoneità per principianti
- 66/100
Direzione di ricerca
Start in src/Controller/ScoreController.php (the setPaymentStatus route, where findOneById() can return null) and src/Controller/UserController.php (the updatePasswordAdmin route, where targetUser is resolved). The /transfer endpoint's uncaught ItemNotFoundException is also in scope. Run tests/Api/ScoreTest.php and tests/Api/UserManagementTest.php, where the current 500 behaviour is pinned under NOTE: current behaviour. Done means unknown ids return 404, unresolvable IRIs in the body return 400 with a message, and those pinned assertions are updated to match.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
Custom endpoints don't handle references that don't exist:
POST /transferwith an unknown target IRI: an uncaughtItemNotFoundExceptiongives a 500.POST /updatePasswordAdminwith an unknowntargetUserIRI: 500.POST /api/scores/{id}/setPaymentStatuswith an unknown id:findOneById()returns null and a method is called on it, so an Error gives a 500.
Expected
Unknown ids → 404, unresolvable IRIs in the body → 400 with a message.
Where
src/Controller/ScoreController.php, src/Controller/UserController.php.
Pinned in tests/Api/ScoreTest.php (around lines 105 and 305) and tests/Api/UserManagementTest.php (around line 278).
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