Skip to content

Replace (PUT) Operation on parent container doesn't clear child object's instance which are not provided in request (common app) #149

@Verma-Anukul

Description

@Verma-Anukul

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions