Fix issues with the sch_add_defaults routine. #144
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A new routine "sch_process_qnode" has been added to better find a point in the query tree to add defaults. This fixes two issues:- 1) where the input qnode may not have been the actual node to try to add defaults to. This happens in netconf where a list key is often present but not the correct node to add defaults to. 2) where the qnode is the index node of a list. In this case both the qnode and schema need to be appropriately adjusted.
By adding the defaults more accurately, the routine cleanup_query_after_adding_defaults was no longer required.