[NETCONF-870] Use Decimal64 instead of BigDecimal for DecimalType value Created: 05/Apr/22  Updated: 05/Apr/22  Resolved: 05/Apr/22

Status: Resolved
Project: netconf
Component/s: restconf-openapi
Affects Version/s: 3.0.0
Fix Version/s: 3.0.1

Type: Bug Priority: Medium
Reporter: Peter Suna Assignee: Robert Varga
Resolution: Done Votes: 0
Labels: regression
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Yangtools change DecimalType value type from BigDecimal to Decimal64.
https://git.opendaylight.org/gerrit/c/yangtools/+/97458/4/model/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/type/DecimalTypeDefinition.java#17

This change was not implemented in Netconf and prevent to open Swagger API.
https://github.com/opendaylight/netconf/blob/v3.0.0/restconf/sal-rest-docgen/src/main/java/org/opendaylight/netconf/sal/rest/doc/impl/DefinitionGenerator.java#L881

Caused by: java.lang.ClassCastException: class org.opendaylight.yangtools.yang.common.Decimal64 cannot be cast to class java.math.BigDecimal (org.opendaylight.yangtools.yang.common.Decimal64 is in unnamed module of loader 'app'; java.math.BigDecimal is in module java.base of loader 'bootstrap')
 at org.opendaylight.netconf.sal.rest.doc.impl.DefinitionGenerator.lambda$processNumberType$2(DefinitionGenerator.java:881)
 at java.base/java.util.Optional.ifPresent(Optional.java:183)
 at org.opendaylight.netconf.sal.rest.doc.impl.DefinitionGenerator.processNumberType(DefinitionGenerator.java:881)
 at org.opendaylight.netconf.sal.rest.doc.impl.DefinitionGenerator.processTypeDef(DefinitionGenerator.java:715)
 at org.opendaylight.netconf.sal.rest.doc.impl.DefinitionGenerator.processLeafNode(DefinitionGenerator.java:640)
 at org.opendaylight.netconf.sal.rest.doc.impl.DefinitionGenerator.processChildren(DefinitionGenerator.java:491)

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