Uploaded image for project: 'netconf'
  1. netconf
  2. NETCONF-1060

OpenApi: Broken parameters logic

    XMLWordPrintable

Details

    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

        Activity

          People

            yaroslav.lastivka Yaroslav Lastivka
            ivanhrasko Ivan Hrasko
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: