Uploaded image for project: 'netconf'
  1. netconf
  2. NETCONF-870

Use Decimal64 instead of BigDecimal for DecimalType value

XMLWordPrintable

      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)

            rovarga Robert Varga
            PeterSuna Peter Suna
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: