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

OpenAPI: Limit usage of JsonUtil#copy method

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Medium Medium
    • 6.0.0
    • None
    • restconf-openapi

      The addPaths method is the only place where we need to make a copy of parameters because we are going deeper into recursion. Thus we need
      some defence against future modifications.

      The other methods buildPost, buildGet, buildPut and buildDelete are doing unnecessary copying.

      The second problem is that we do not have any unit test to check the number of parameters in recursive models, for example:

        container container-root {
          list root-list {
            key name;
            leaf name {
              type string;
            }      list nested-list {
              key name;
              leaf name {
                type string;
              }        list super-nested-list {
                key name;
                leaf name {
                  type string;
                }
              }
            }
          }
        }

            ojo Oleksandr Zharov
            ivanhrasko Ivan Hrasko
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: