[YANGTOOLS-617] Mandatory leaf enforcement does not work when RESTCONF call is made is certain way Created: 25/May/16  Updated: 10/Apr/22  Due: 25/Aug/16  Resolved: 01/Dec/16

Status: Resolved
Project: yangtools
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Ajay L Assignee: Peter Kajsa
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


External issue ID: 5968

 Description   

BGP-PCEP project has bgp-rib model [1]. It defines an application-rib container which uses rib grouping that contains a routes choice which is augmented from other address-family specific models. E.g. bgp-inet model [2] augments it with ipv4-routes-case which uses ipv4-routes grouping. This uses route grouping from [1] which in turn uses path-attributes grouping from bgp-message model [3]. Path-attributes uses origin container which has a value leaf specified as mandatory using "mandatory true" statement

When populating data into application-rib using RESTCONF, the mandatory validation for origin seems to work in some cases but not others:
1. When using POST URL [1] and data [2], the mandatory validation actually works
2. But when using POST URL [3] and data [4], the mandatory validation does not work

Since we cannot control how the user will invoke RESTCONF, the mandatory validation should work in all cases

[1] https://github.com/opendaylight/bgpcep/blob/master/bgp/rib-api/src/main/yang/bgp-rib.yang
[2] https://github.com/opendaylight/bgpcep/blob/master/bgp/inet/src/main/yang/bgp-inet.yang
[3] https://github.com/opendaylight/bgpcep/blob/master/bgp/parser-api/src/main/yang/bgp-message.yang
[4] https://wiki.opendaylight.org/view/BGP_LS_PCEP:Programmer_Guide#RESTCONF

[5] http://localhost:8181/restconf/config/bgp-rib:application-rib/example-app-rib/tables/bgp-types:ipv4-address-family/bgp-types:unicast-subsequent-address-family/bgp-inet:ipv4-routes/
[6] http://pastebin.com/wJCgGa7A
[7] http://localhost:8181/restconf/config/bgp-rib:application-rib/example-app-rib/tables/bgp-types:ipv4-address-family/bgp-types:unicast-subsequent-address-family
[8] http://pastebin.com/7pKKxQX1



 Comments   
Comment by Ajay L [ 25/May/16 ]

Reference numbers in description are bit off. Please use below

When populating data into application-rib using RESTCONF, the mandatory validation for origin seems to work in some cases but not others:
1. When using POST URL [5] and data [6], the mandatory validation actually works
2. But when using POST URL [7] and data [8], the mandatory validation does not work

Comment by Peter Kajsa [ 05/Aug/16 ]

https://git.opendaylight.org/gerrit/#/c/42709/

Comment by Peter Kajsa [ 18/Aug/16 ]

new fix: https://git.opendaylight.org/gerrit/#/c/44233/

Comment by Robert Varga [ 04/Nov/16 ]

boron: https://git.opendaylight.org/gerrit/47980

Comment by Robert Varga [ 21/Nov/16 ]

Reopened due to revert.

Comment by Robert Varga [ 21/Nov/16 ]

master: https://git.opendaylight.org/gerrit/48532

Comment by Robert Varga [ 21/Nov/16 ]

The above patch needs to be evaluated for performance impact.

Comment by Peter Kajsa [ 22/Nov/16 ]

Luis Gomez: Patch seems to be OK (no impact on REST perf).

Comment by Robert Varga [ 01/Dec/16 ]

boron: https://git.opendaylight.org/gerrit/48853

Generated at Wed Feb 07 20:53:47 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.