Skip to content

Commit 49196cf

Browse files
authored
Merge pull request #597 from hivemq/fix/validate-incoming-update
Fix/validate incoming update
2 parents e30d328 + b81380f commit 49196cf

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

hivemq-edge/src/main/java/com/hivemq/api/resources/impl/ProtocolAdaptersResourceImpl.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,11 @@ public int getDepth() {
266266
if (instance.isEmpty()) {
267267
return ApiErrorUtils.notFound("Cannot update an adapter that does not exist");
268268
}
269+
ApiErrorMessages errorMessages = ApiErrorUtils.createErrorContainer();
270+
validateAdapterSchema(errorMessages, adapter);
271+
if (ApiErrorUtils.hasRequestErrors(errorMessages)) {
272+
return ApiErrorUtils.badRequest(errorMessages);
273+
}
269274
if (logger.isDebugEnabled()) {
270275
logger.debug("Updating adapter \"{}\".", adapterId);
271276
}

0 commit comments

Comments
 (0)