Uploaded image for project: 'mdsal'
  1. mdsal
  2. MDSAL-833

Support setting schema source URL by YangLibraryContentBuilder

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Medium Medium
    • None
    • None
    • yanglib

      Currently there are multiple services generating yang-library content (using both new and legacy models) within NETCONF project. In order to avoid code duplication it seems reasonable to use dedicated implementation – mdsal-yanglib-rfc8525. The blocking issue is there is no way to set schema source URL for modules (submodules) when yang-library content being built. 

      The expected is support for optional component (implementing predefined interface, ie SourceUrlProvider) which provides schema source URL by module/submodule QName so associated field (`schema` for legacy model, `location` for new one) values can be populated. Required is interface only, implementation is responsibility of consumer (some simple one can be used for testing). 

      Expected api change like below

      final var yangLibNode = yangLib.newContentBuilder()
          .defaultContext(defaultContext)
          .sourceUrlProvider(this::getUrlByQName)
          .formatYangLibraryContent(); 

      Source URL is optional. If no sourceUrlProvider is defined or no URL provided then associated field should remain empty (null).

            rovarga Robert Varga
            rkashapov Ruslan Kashapov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: