Support setting schema source URL by YangLibraryContentBuilder
Description
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).
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).