Commit 78fa0154 authored by Roman Ondráček's avatar Roman Ondráček

IQRF Net: fix JSON API request validation

Signed-off-by: Roman Ondráček's avatarRoman Ondráček <ondracek.roman@centrum.cz>
parent a0be1678
Pipeline #2129 passed with stages
in 13 minutes and 13 seconds
......@@ -120,6 +120,8 @@ class SendJsonFormFactory {
if (isset($json->mType)) {
$this->jsonSchemaManager->setSchemaForRequest($json->mType);
$this->jsonSchemaManager->validate($json);
} else {
throw new JsonException();
}
} catch (JsonException $e) {
$request->addError(self::PREFIX . 'messages.invalidJson');
......
......@@ -203,7 +203,7 @@ send-json:
documentation: Show API documentation.
json: JSON request
messages:
invalidJson: Invalid JSON request.
invalidJson: Invalid JSON API request.
json: Please enter JSON request.
missingSchema: Corresponding JSON schema for this request not found.
failure: An error occurred while proccesing JSON request.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment