summaryrefslogtreecommitdiff
path: root/lib/northbound.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/northbound.c')
-rw-r--r--lib/northbound.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/northbound.c b/lib/northbound.c
index 4478abf5a7..48b450e969 100644
--- a/lib/northbound.c
+++ b/lib/northbound.c
@@ -504,7 +504,9 @@ int nb_candidate_edit(struct nb_config *candidate,
*/
if (dnode) {
lyd_schema_sort(dnode, 0);
- lyd_validate(&dnode, LYD_OPT_CONFIG, ly_native_ctx);
+ lyd_validate(&dnode,
+ LYD_OPT_CONFIG | LYD_OPT_WHENAUTODEL,
+ ly_native_ctx);
}
break;
case NB_OP_DESTROY:
@@ -570,7 +572,8 @@ int nb_candidate_update(struct nb_config *candidate)
*/
static int nb_candidate_validate_yang(struct nb_config *candidate)
{
- if (lyd_validate(&candidate->dnode, LYD_OPT_STRICT | LYD_OPT_CONFIG,
+ if (lyd_validate(&candidate->dnode,
+ LYD_OPT_STRICT | LYD_OPT_CONFIG | LYD_OPT_WHENAUTODEL,
ly_native_ctx)
!= 0)
return NB_ERR_VALIDATION;