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

OpenApi ignore min-elements conditions for list

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Medium Medium
    • 7.0.0
    • None
    • restconf-openapi

      OpenAPI generates an example for a list with only one element, even when the min-elements constraint is set.

      Generated example for this model is attached.

      module test-container-childs {
          namespace "http://example.com/test/container/child";
          prefix "tcc";
          revision 2023-09-28;
      
          container root-container {
              container nested-container {
                  list mandatory-list {
                      min-elements 2;
                      max-elements 3;
                      key id;
                      leaf id {
                          type uint32;
                      }
                  }
              }
          }
      } 

       

      Expected example payload:

      {
          "nested-container": {
              "mandatory-list": [
                  {
                      "id": 0
                  },
                  {
                      "id": 1
                  }
              ]
          }
      } 

            matej.sramcik Matej Šramčík
            PeterSuna Peter Suna
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: