...
Code Block |
---|
| module assembly {
yang-version 1.1;
namespace "org:onap:cps:test:assembly";
prefix "assembly";
revision "2020-03-01";
include "component";
container module-container {
leaf name {
type string;
}
leaf description {
type string;
}
}
} |
|
Code Block |
---|
| submodule component {
yang-version 1.1;
revision "2020-03-02";
belongs-to "assembly" {
prefix "assembly";
}
container submodule-container {
leaf name {
type string;
}
leaf description {
type string;
}
}
} |
|
Code Block |
---|
title | assembly-1.json (valid) |
---|
| {
"module-container": {
"name": "module name",
"description": "module description"
}
} |
Code Block |
---|
title | assembly-2.json (also valid) |
---|
| {
"submodule-container": {
"name": "submodule name",
"description": "submodule description"
}
} |
Code Block |
---|
title | assembly.json (invalid) |
---|
| {
"module-container": {
"name": "module name",
"description": "module description"
},
"submodule-container": {
"name": "submodule name",
"description": "submodule description"
}
} |
|
...
This issue is similar to the one of augmentation case: once the files are processed into an effective schema context the submodule has no use.
...
Multiple containers issue
As it was figured out it could be an issue if data has multiple
Data tree root mismatches model root issue
Issue description
This issue was determined on assembly case analysis - see the assembly.json example above.
The actual set of yang files was successfully parsed into effective schema context. However on data processing into NormalizedNode<?, ?>
fails if there are multiple top level containers provided with data JSON.
draw.io Diagram |
---|
border | false |
---|
| |
---|
diagramName | CPS Module as tree model issue |
---|
simpleViewer | false |
---|
width | |
---|
links | auto |
---|
tbstyle | inline |
---|
diagramDisplayName | |
---|
lbox | false |
---|
diagramWidth | 891 |
---|
revision | 3 |
---|
|
...
Workaround proposal
The possible workaround could be splitting incoming data into several peaces having singe rool level object at a time.
Also the xpath building for data fragment should be updated to use a module identifier as root, not data container.
Model content persistence