We are using common app and transformer approach to implement translib support for a openconfig module.
For replace operation we are seeing an issue.
Consider following test objects
container A {
container B {
list C {
key id;
leaf id {
type uint;
}
}
}
}
Current DB content
A/B/C/1
A/B/C/2
Two instance of object C exists in DB.
Request Payload for PUT operations
url = /A/B
url_body = { B { C [{ 1, {}}, {3, {}}] }
So, We are trying to replace object /A/B with two instances of C (1 & 3)
Expectation
As requested payload as only instance 1 & 3
And DB has instance 1 & 2
So, framework should delete instance 2, keep instance 1 as it is and Create instance 3.
Current Behaviour
Instance 1 is kept as it is (Expected)
Instance 3 is Created. (Expected)
Instance 2 is not deleted (Not expected)
Observation
From the processReplace code, looks like currently only dbMapCreate is handled for Replace operation, IMO dbMapDelete should also be handled here