diff --git a/lib/Controller/API/V3/PayableRateController.php b/lib/Controller/API/V3/PayableRateController.php index 81beb7aa19..59c8abcb5e 100644 --- a/lib/Controller/API/V3/PayableRateController.php +++ b/lib/Controller/API/V3/PayableRateController.php @@ -219,8 +219,14 @@ public function validate(): Response $this->response->code($code); + $formattedErrors = []; + + foreach ($errors as $error) { + $formattedErrors[] = $error->getFormattedError("payable_rate"); + } + return $this->response->json([ - 'errors' => $errors + 'errors' => $formattedErrors ]); } catch (Exception $exception) { $errorCode = $exception->getCode() >= 400 ? $exception->getCode() : 500; diff --git a/lib/Controller/API/V3/QAModelTemplateController.php b/lib/Controller/API/V3/QAModelTemplateController.php index fbccf3ddea..b39f3b8e99 100644 --- a/lib/Controller/API/V3/QAModelTemplateController.php +++ b/lib/Controller/API/V3/QAModelTemplateController.php @@ -243,8 +243,14 @@ public function validate(): Response $this->response->code($code); + $formattedErrors = []; + + foreach ($errors as $error) { + $formattedErrors[] = $error->getFormattedError("qa_model_template"); + } + return $this->response->json([ - 'errors' => $errors + 'errors' => $formattedErrors ]); } catch (Exception $exception) { $this->response->code(500); diff --git a/lib/Utils/Validator/JSONSchema/Errors/JSONValidatorException.php b/lib/Utils/Validator/JSONSchema/Errors/JSONValidatorException.php index f8a6b94916..34df3e69e7 100644 --- a/lib/Utils/Validator/JSONSchema/Errors/JSONValidatorException.php +++ b/lib/Utils/Validator/JSONSchema/Errors/JSONValidatorException.php @@ -33,6 +33,7 @@ public function getFormattedError(string $context): array { return [ 'node' => $this->error->dataPointer, + 'schemaPointers' => $this->error->schemaPointers, 'schema' => '/api/v3/' . $context . '/schema', 'error' => $this->error->error, ];