diff --git a/src/lib/error/api-error.ts b/src/lib/error/api-error.ts index 0a04a1a848e..1a80d005f15 100644 --- a/src/lib/error/api-error.ts +++ b/src/lib/error/api-error.ts @@ -301,7 +301,7 @@ export const fromOpenApiValidationErrors = ( return new UnleashError({ name: 'ValidationError', message: - "The request payload you provided doesn't conform to the schema. Check the `details` property for a list of errors that we found.", + "Request validation failed: the payload you provided doesn't conform to the schema. Check the `details` property for a list of errors that we found.", // @ts-expect-error We know that the list is non-empty details, }); diff --git a/src/test/e2e/api/admin/feature.e2e.test.ts b/src/test/e2e/api/admin/feature.e2e.test.ts index ab2b29ab892..60446409ef5 100644 --- a/src/test/e2e/api/admin/feature.e2e.test.ts +++ b/src/test/e2e/api/admin/feature.e2e.test.ts @@ -916,6 +916,7 @@ test('Should throw error when updating a flexibleRollout strategy with "" for st .expect((res) => { const result = res.body; expect(res.status).toBe(400); - expect(result.error).toBe('Request validation failed'); + expect(result.message.includes('validation')); + expect(result.message.includes('failed')); }); });