Uploaded image for project: 'controller'
  1. controller
  2. CONTROLLER-679

Restconf cannot deserialize leaf whose type is defined in another module

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Resolution: Cannot Reproduce
    • None
    • None
    • mdsal
    • None
    • Operating System: Linux
      Platform: PC

    • 1528

    Description

      Define two yang models as follows

      types.yang
      ==============

      module types {
      namespace
      "urn:ping:params:xml:ns:yang:types";
      prefix
      "types";

      description
      "Types and Groupings";

      revision 2014-07-05

      { description "Initial version."; }

      typedef Name {
      type string { length "1..64"; }
      description
      "This data type is used to model a name ";
      }
      }

      test.yang
      ========

      module test {
      namespace
      "urn:ping:params:xml:ns:yang:test";
      prefix
      "test";
      import types { prefix "types"; }
      description
      "Test ";

      revision 2014-07-05 { description "Initial version."; }

      container test-container {
      leaf test-name

      { type test:Name; }

      }
      }

      Now try to set via restconf -
      <test-container>
      <test-name>Blah
      </test-name>
      <test-container>

      org.opendaylight.yangtools.yang.binding.util.ClassLoaderUtils.loadClass fails with java.lang.ClassNotFoundException. This is because SAl is searching the package of "test" for "types" class.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            ashwin.pankaj@hotmail.com Ashwin Pankaj
            ashwin.pankaj@hotmail.com Ashwin Pankaj
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: