[YANGTOOLS-1463] YangTextSchemaContextResolver needs to we aware of supported features Created: 04/Nov/22  Updated: 11/Apr/23  Resolved: 11/Apr/23

Status: Resolved
Project: yangtools
Component/s: parser
Affects Version/s: None
Fix Version/s: 11.0.0, 10.0.5

Type: Improvement Priority: High
Reporter: Robert Varga Assignee: Matúš Matok
Resolution: Done Votes: 0
Labels: pt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Blocks
blocks MDSAL-789 ModuleInfoSnapshot{Builder,Resolver} ... Resolved
Issue split
split to YANGTOOLS-1504 Refactor FeatureSet to yang-model-api Resolved

 Description   

YangTextSchemaContextResolver does not currently provide a way to affect which features are supported – the effective model always supports all features.

Add the ability to select features used in building the effective model, which will work in an additive way with backwards compatibility. Specifically expose a new method,

public final class YangTextSchemaContextResolver {
  public @NonNull Registration registerSupportedFeatures(QNameModule module, Set<QName> features) {
    // ...
  }
}

The mechanics should work like this:

  • when there are no features registered, 'null' should be passed to the parser
  • if there is any module registered, a specialized implementation of Set<QName> is passed to the parser, which evaluates contains(Object) on the set of registered modules – if the module is not mentioned if a registerSupportedFeatures() call, it should report as true, if it is mention, it should report true only if the feature is also enumerated in the passed Set.

Generated at Wed Feb 07 20:56:13 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.