YANG Tools

Overview

YANG Tools provides a set of libraries to deal with YANG models and data modeled using them.

Behavior/Feature Changes

YANG parser’s memory efficiency has been improved by about 5x on service-provider-grade device models. This comes at the cost of removal of SchemaNode.getPath() method. The returned SchemaPath did not correctly provide statement identification anyway, so was of quite limited use in general schema navigation. Users relying on it for lookups need to update their algorithm to explicitly track schema tree navigation – using utilities like SchemaInferenceStack, EffectiveStatementInference, DataSchemaContextTree.

The type mapping of type decimal64 has been changed to a dedicated Decimal64 class, similar to uint8 and other built-in YANG types.

YANG parser will now validate the argument to unique statement against its surroundings. This specifically means that if a unique statement contains schema node identifiers that do not resolve to valid statements, the module will be rejected with a SourceException.

YANG parser will now rejects attempts to import-with-revision a YANG-1.1 module into a YANG-1 module, as per RFC7950 guidelines.

New Features

No new features.

Deprecated Features

Code generation plugin APIs for yang-maven-plugin contained in the yang-maven-plugin-spi artifact are deprecated and will be removed in the next major release. Their replacement live in maven-agnostic plugin-generator-api.

The SchemaPath class has been deprecated and will be removed in the next major release. Please use its correct replacements, SchemaNodeIdentifier and EffectiveStatementInference, which provide more powerful capabilities.

The CheckedBuilder and Builder concepts have been deprecated and will be removed in the next major release. Use of these interfaces makes life difficult when reasoning about callers of a particular build() method.

The IllegalArgumentCodec concept has been deprecated and will be removed in the next major release. Its semantics are quite confusing and it turned out to be hiding more problems than solving. Users are advised to define their replacements with semantics appropriate to their use case.

Resolved Issues

The following table lists the issues resolved in this release.

Issues resolved in versions 8.0.0 through 8.0.3 (JIRA)

Type

Key

Summary

Resolution

Fix Version(s)

Bug

YANGTOOLS-1418

Java 14+ breaks XSD regex translation

Done

7.0.16, 8.0.3

Bug

YANGTOOLS-1417

AbstractImmutableDataContainerNode violates equals() contract

Done

7.0.16, 8.0.3

Bug

YANGTOOLS-1412

Add DataSchemaContextTree/SchemaInferenceStack integration

Done

7.0.15, 8.0.2

Bug

YANGTOOLS-1411

JSON codec fails to decode instance-identifier to a choice/case/choice item

Done

7.0.15, 8.0.2

Bug

YANGTOOLS-1410

‘choice’ not allowed in ‘choice’ with yang-version 1.1

Done

7.0.15, 8.0.2

Bug

YANGTOOLS-1408

Deviation of augmented case node fails

Done

7.0.15, 8.0.2

Bug

YANGTOOLS-1407

Attempted access to undeclared case statement

Done

8.0.2

Bug

YANGTOOLS-1406

BaseDecimalType is missing boundaries for fraction-digits=18

Done

8.0.1

Bug

YANGTOOLS-1404

Deviation of augmented node causes NPE

Done

7.0.15, 8.0.0

Bug

YANGTOOLS-1393

InferenceException thrown when uses/augment is conditional on unsupported feature

Done

7.0.14, 8.0.0

Bug

YANGTOOLS-1387

XPath: XPath keyword not accepted as valid XPath expression

Done

6.0.9, 7.0.11, 8.0.0

Bug

YANGTOOLS-1386

Statement replicas do not trigger onStatementAdded()

Done

7.0.10, 8.0.0

Bug

YANGTOOLS-1385

Unique statement reference is not validated

Done

8.0.0

Bug

YANGTOOLS-1381

Parser reactor does not support chained prerequisites

Done

7.0.10, 8.0.0

Bug

YANGTOOLS-1370

NPE in parser reactor with if-feature inference

Done

6.0.9, 7.0.10, 8.0.0

Bug

YANGTOOLS-1346

IAE in StatementContextBase.childCopyOf()

Done

7.0.9, 8.0.0

Bug

YANGTOOLS-1321

Decimal64.valueOf(String) does not handle full length

Done

6.0.8, 7.0.9, 8.0.0

Bug

YANGTOOLS-1313

Error when module is imported with different prefixes

Done

6.0.9, 7.0.9, 8.0.0

Bug

YANGTOOLS-1276

MandatoryLeafEnforcer fails when faced with augmentations

Done

8.0.0

Bug

YANGTOOLS-1167

maven-plugin-it does not contribute to SonarCloud

Done

8.0.0

Epic

YANGTOOLS-1066

SchemaPath identification of SchemaNodes is costly and useless

Done

8.0.0

Improvement

YANGTOOLS-1419

Update known unicode blocks for Java 11

Done

7.0.16, 8.0.3

Improvement

YANGTOOLS-1414

Improve trust between DefaultSchemaTreeInference and SchemaInferenceStack

Done

7.0.16, 8.0.3

Improvement

YANGTOOLS-1405

Add Decimal64.valueOf() methods which specify expected precision

Done

8.0.0

Improvement

YANGTOOLS-1400

AugmentEffectiveStatement should be SchemaTreeAwareEffectiveStatement

Done

8.0.0

Improvement

YANGTOOLS-1399

Add OrderedByAwareEffectiveStatement

Done

8.0.0

Improvement

YANGTOOLS-1391

Add a custom SoftSchemaSourceCache

Done

7.0.13, 8.0.0

Improvement

YANGTOOLS-1379

Remove AugmentationSchemaNode.getOriginalDefinition()

Done

8.0.0

Improvement

YANGTOOLS-1378

Codify AbstractModelStatement’s hashCode/equals/toString

Done

7.0.10, 8.0.0

Improvement

YANGTOOLS-1376

Do not retain singleton RangeSets

Done

8.0.0

Improvement

YANGTOOLS-1375

Implement TypedefNamespace as a linear search

Done

8.0.0

Improvement

YANGTOOLS-1374

Intern yang.model.api.PatternExpression

Done

7.0.10, 8.0.0

Improvement

YANGTOOLS-1371

Expose available StatementSupports from StmtContext

Done

8.0.0

Improvement

YANGTOOLS-1368

Do not build FeatureEffectiveStatement for unsupported features

Done

7.0.10, 8.0.0

Improvement

YANGTOOLS-1359

Allow bridging from UnqualifiedQName to QualifiedQName

Done

8.0.0

Improvement

YANGTOOLS-1342

Carry java.nio.file.Path in {Yang,Yin}TextFileSchemaSource

Done

8.0.0

Improvement

YANGTOOLS-1339

Enforce YANG 1/1.1 interoperability constraints

Done

8.0.0

Improvement

YANGTOOLS-1338

Generate ietf-restconf operations leaf statements

Done

8.0.0

Improvement

YANGTOOLS-1336

Improve SchemaInferenceStack diagnostics

Done

7.0.9, 8.0.0

Improvement

YANGTOOLS-1329

Add yang.common.UnresolvedQName

Done

8.0.0

Improvement

YANGTOOLS-1320

Promote UnknownEffectiveStatementBase

Done

8.0.0

Improvement

YANGTOOLS-1317

Remove UnknownStatement.getExtensionDefinition()

Done

8.0.0

Improvement

YANGTOOLS-1316

Re-examine argument storage in effective statements

Done

8.0.0

Improvement

YANGTOOLS-1298

Fix QName.compareTo() logic

Done

8.0.0

Improvement

YANGTOOLS-1067

Use flyweight EffectiveStatement implementations

Done

8.0.0

Improvement

YANGTOOLS-556

yang-data-api: use yang.common.Decimal64 for decimal64 leaves

Done

8.0.0

Improvement

YANGTOOLS-1397

Expose a knob to control warnings about unkeyed lists with config=true

Done

8.0.3

New Feature

YANGTOOLS-898

Rework ImmutableNodes.fromInstanceId()

Duplicate

8.0.0

New Feature

YANGTOOLS-1372

Add support for purely-effective substatements

Done

8.0.0

New Feature

YANGTOOLS-1262

Index TypedefNamespace

Done

8.0.0

Known Issues

The following table lists the known issues that exist in this release.

Issues affecting versions 8.0.0 through 8.0.3 (JIRA)

Type

Key

Summary

Status

Affected Version(s)

Fix Version(s)

Bug

YANGTOOLS-1429

yang-model-validator has an illegal option ‘no-wul’

Resolved

8.0.3

8.0.4

Bug

YANGTOOLS-1428

Missing failedSource in SchemaResolutionException

Resolved

7.0.15, 8.0.3

7.0.16, 8.0.4, 9.0.0

Bug

YANGTOOLS-1431

Unsupported leaf under causes parsing failure

Resolved

8.0.3

8.0.4, 9.0.0

Bug

YANGTOOLS-1433

YangInstanceIdentifierWriter does not handle nested augmentations

Resolved

8.0.0, 8.0.3, 8.0.4

8.0.5, 9.0.0

Bug

YANGTOOLS-1361

YangXPathExpression.interpretAsInstanceIdentifier() does not handle unqualified names

Confirmed

6.0.8, 7.0.9, 8.0.2

8.0.6, 9.0.0