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

OpenAPI: limit document size with depth/width parameters

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Medium Medium
    • None
    • None
    • restconf-openapi

      We are generating big documents which show big payloads in examples.

      This can lead to user confusion and browser crashes (because of too big document to show).

      Limit amount of data by using width and depth parameters.

      Imagine we have following YANG snippet:

      cont cont1 {
          cont cont2 {
              leaf c2ch1;
              leaf c2ch2;
          }
          leaf ch1;
          leaf ch2;
          leaf ch3;
      }

      ?depth=2 means:

      cont cont1 {
          cont cont2 {
              cont c2ch1;
              cont c2ch2;
          }
          leaf ch1;
          leaf ch2;
          leaf ch3;
      }

      Here we generate paths and schemas for all/both containers in document.

      ?depth=1 means:

      cont cont1 {
          leaf ch1;
          leaf ch2;
          leaf ch3;
      }

      Here we generate paths and schemas for cont1 only. We can omit cont2 because its children are at depth=2.

      ?depth=2&width=1 means:

      cont cont1 {
          cont cont2 {
              leaf c2ch1;
          }
      }

      Here we generate paths and schemas for both containers - but cont1 has only one child cont2. Similarly cont2 has only one child c2ch1.

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

              Created:
              Updated: