Skip processing of node if it was already processed.
Currently, we generate multiple schemas with different name
for the same node and the last one is used.
JIRA: NETCONF-1270
Change-Id: I817f5d5db9183b0162b663bd2e80f5971ea8366a
Signed-off-by: Samuel Schneider <samuel.schneider@pantheon.tech>
final SchemaInferenceStack stack, final DefinitionNames definitionNames,
final ArrayDeque<SchemaEntity> result, final String parentName, final boolean isParentConfig) {
if (node instanceof ContainerSchemaNode || node instanceof ListSchemaNode) {
+ if (definitionNames.isListedNode(node)) {
+ // This means schema for this node is already processed
+ return;
+ }
final var newTitle = title + "_" + node.getQName().getLocalName();
final var parentNameConfigLocalName = parentName + "_" + node.getQName().getLocalName();
final var names = List.of(parentNameConfigLocalName);
"duplication-test_test-rpc2_input": {
"properties": {
"first": {
- "$ref": "#/components/schemas/duplication-test_first1"
+ "$ref": "#/components/schemas/duplication-test_first"
},
"input-leaf": {
"description": "",
"duplication-test_test-rpc_input": {
"properties": {
"first": {
- "$ref": "#/components/schemas/duplication-test_first1"
+ "$ref": "#/components/schemas/duplication-test_first"
},
"input-leaf": {
"description": "",
"name": "input",
"namespace": "urn:ietf:params:xml:ns:yang:test:duplication:test"
}
- },
- "duplication-test_first1": {
- "title": "duplication-test_first",
- "type": "object",
- "properties": {},
- "xml": {
- "name": "first",
- "namespace": "urn:ietf:params:xml:ns:yang:test:duplication:service"
- }
}
},
"securitySchemes": {
"example": "Some input-leaf"
},
"first": {
- "$ref": "#/components/schemas/duplication-test_first1"
+ "$ref": "#/components/schemas/duplication-test_first"
}
},
"xml": {
"example": "Some input-leaf"
},
"first": {
- "$ref": "#/components/schemas/duplication-test_first1"
+ "$ref": "#/components/schemas/duplication-test_first"
}
},
"xml": {
"name": "input",
"namespace": "urn:ietf:params:xml:ns:yang:test:duplication:test"
}
- },
- "duplication-test_first1": {
- "title": "duplication-test_first",
- "type": "object",
- "properties": {},
- "xml": {
- "name": "first",
- "namespace": "urn:ietf:params:xml:ns:yang:test:duplication:service"
- }
}
},
"securitySchemes": {
"duplication-test_test-rpc2_input": {
"properties": {
"first": {
- "$ref": "#/components/schemas/duplication-test_first1"
+ "$ref": "#/components/schemas/duplication-test_first"
},
"input-leaf": {
"description": "",
"duplication-test_test-rpc_input": {
"properties": {
"first": {
- "$ref": "#/components/schemas/duplication-test_first1"
+ "$ref": "#/components/schemas/duplication-test_first"
},
"input-leaf": {
"description": "",
"name": "input",
"namespace": "urn:ietf:params:xml:ns:yang:test:duplication:test"
}
- },
- "duplication-test_first1": {
- "title": "duplication-test_first",
- "type": "object",
- "properties": {},
- "xml": {
- "name": "first",
- "namespace": "urn:ietf:params:xml:ns:yang:test:duplication:service"
- }
}
},
"securitySchemes": {
"example": "Some input-leaf"
},
"first": {
- "$ref": "#/components/schemas/duplication-test_first1"
+ "$ref": "#/components/schemas/duplication-test_first"
}
},
"xml": {
"example": "Some input-leaf"
},
"first": {
- "$ref": "#/components/schemas/duplication-test_first1"
+ "$ref": "#/components/schemas/duplication-test_first"
}
},
"xml": {
"name": "input",
"namespace": "urn:ietf:params:xml:ns:yang:test:duplication:test"
}
- },
- "duplication-test_first1": {
- "title": "duplication-test_first",
- "type": "object",
- "properties": {},
- "xml": {
- "name": "first",
- "namespace": "urn:ietf:params:xml:ns:yang:test:duplication:service"
- }
}
},
"securitySchemes": {