Details
-
Bug
-
Status: Resolved
-
Medium
-
Resolution: Done
-
6.0.0
Description
We have the following YANG model:
module keys-mapping {
namespace "mapping";
prefix keys-mappin;
revision "2023-06-19" {
description
"Sample app";
}
list multiple-key-list {
key "name name2";
leaf name {
type string;
}
leaf name2 {
type string;
}
list multiple-key-list2 {
key "name name3";
leaf name {
type string;
}
leaf name3 {
type string;
}
list multiple-key-list3 {
key "name3 name";
leaf name3 {
type string;
}
leaf name {
type string;
}
list multiple-key-list4 {
key name;
leaf name {
type string;
}
}
}
}
}
}
In OpenApi docs we are getting URLs as follows:
/rests/data/network-topology:network-topology/topology=topology-netconf/node=17830-sim-device/yang-ext:mount/keys-mapping:multiple-key-list={name},{name2}/multiple-key-list2={name1},{name3}/multiple-key-list3={name31},{name4}/multiple-key-list4={name2}
It means we have two times parameter called name2. This OpenAPi model is invalid. We have to change our logic to preserve discriminator value when going deeper into lists structure.
Attachments
| # | Subject | Branch | Project | Status | CR | V |
|---|---|---|---|---|---|---|
| 106583,12 | OpenApi: Broken parameters logic | master | netconf | Status: MERGED | +2 | +1 |
| 106598,14 | Refactor creating unique parameter name | master | netconf | Status: MERGED | +2 | +1 |
| 106648,12 | Declare discriminator in #getOpenApiSpec | master | netconf | Status: ABANDONED | 0 | +1 |
| 106862,1 | OpenApi: Broken parameters logic | 6.0.x | netconf | Status: MERGED | +2 | +1 |
| 106921,2 | Refactor creating unique parameter name | 6.0.x | netconf | Status: MERGED | +2 | +1 |