Fix missing exception catch (#12069)

add a check about uuid in rest api findOne handler
This commit is contained in:
martmull
2025-05-15 17:01:57 +02:00
committed by GitHub
parent a8423e8503
commit 08ce2f831e
3 changed files with 43 additions and 9 deletions

View File

@ -66,6 +66,20 @@ describe('Core REST API Find One endpoint', () => {
});
});
it('should return 400 error when trying to retrieve with malformed uuid', async () => {
await makeRestAPIRequest({
method: 'get',
path: `/people/malformed-uuid`,
})
.expect(400)
.expect((res) => {
expect(res.body.messages[0]).toContain(
"'malformed-uuid' is not a valid UUID",
);
expect(res.body.error).toBe('BadRequestException');
});
});
it('should support depth 0 parameter', async () => {
await makeRestAPIRequest({
method: 'get',