[YANGTOOLS-1086] Add SchemaInferenceStack Created: 27/Feb/20  Updated: 26/Mar/20  Resolved: 26/Mar/20

Status: Resolved
Project: yangtools
Component/s: model-util
Affects Version/s: None
Fix Version/s: 5.0.0

Type: Improvement Priority: Medium
Reporter: Robert Varga Assignee: Robert Varga
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Epic Link: Get rid of SchemaNode.getPath()

 Description   

SchemaPath most  notably used as a way to find nodes in SchemaContext. SchemaContextUtil, which is a major API contract between yang-model and mdsal-binding, uses SchemaPaths on either side of the API to infer in the location in SchemaContext we are talking about. That notion is strictly guesswork if groupings are involved, as SchemaPath is not expressive enough to differentiate between a grouping and a container of the same name.

SchemaContextUtil side of things typically entails walking that initial entry point in various ways based on properties – such as leaf-ref resolution.

For this use case a SchemaInferenceStack, which keeps track of SchemaNodes is better suited – caller (AbstractTypeGenerator) already performs recursion, so should be able to maintain it was it navigates the SchemaContext.

As a further note – we want to design this on top of EffectiveModelContext, with perhaps a compat layer, to encourage adoption of EffectiveStatements.


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