Skip to content

Commit

Permalink
FIX broker NGSIv1 test case
Browse files Browse the repository at this point in the history
fgalan committed Nov 22, 2023
1 parent 4c2d7b5 commit 59cf077
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/mongoBackend/MongoCommonUpdate.cpp
Original file line number Diff line number Diff line change
@@ -4442,14 +4442,14 @@ unsigned int processContextElement
}
}

if ((attributeAlreadyExistsNumber > 0) && (action == ActionTypeAppendStrict))
if ((apiVersion == V2) && (attributeAlreadyExistsNumber > 0) && (action == ActionTypeAppendStrict))
{
std::string details = "one or more of the attributes in the request already exist: " + eP->id + " - " + attributeAlreadyExistsList;
buildGeneralErrorResponse(eP, NULL, responseP, SccBadRequest, details);
responseP->oe.fillOrAppend(SccInvalidModification, details, ", " + eP->id + " - " + attributeAlreadyExistsList, ERROR_UNPROCESSABLE);
}

if ((attributeNotExistingNumber > 0) && ((action == ActionTypeUpdate) || (action == ActionTypeDelete)))
if ((apiVersion == V2) && (attributeNotExistingNumber > 0) && ((action == ActionTypeUpdate) || (action == ActionTypeDelete)))
{

std::string details = "one or more of the attributes in the request do not exist: " + eP->id + " - " + attributeNotExistingList;

0 comments on commit 59cf077

Please sign in to comment.