pyang icon indicating copy to clipboard operation
pyang copied to clipboard

json2xml + type decimal64

Open rawat-he opened this issue 2 years ago • 2 comments

Hi,

I have yang model with below definition

leaf interval {
    description
        "the maximum time in seconds";
    type decimal64 {
        fraction-digits 1;
        range "1.0..60.0" {
            error-message "Invalid value for attribute 'interval'. Valid values are in range:[1.0,60.0]";
        }
    }
    default "13.0";
}

json2xml with

Input JSON

"interval": "13.0"

Generated XML

 <interval>13.</interval>

Expected XML

 <interval>13.0</interval>

This line is stripping the zeros json2xml.

Is this a bug or expected implementation?

rawat-he avatar Jun 28 '22 10:06 rawat-he

Fixed in PR #819. Thanks!

llhotka avatar Jun 28 '22 12:06 llhotka

Much thanks for the quick fix.

rawat-he avatar Jun 28 '22 21:06 rawat-he