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

Use Decimal64 instead of BigDecimal for DecimalType value

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Medium
    • Resolution: Done
    • 3.0.0
    • 3.0.1
    • OpenAPI

    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)

      Attachments

        # Subject Branch Project Status CR V

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: