clicon / clixon

YANG-based toolchain including NETCONF and RESTCONF interfaces and an interactive CLI
http://www.clicon.org/
Other
215 stars 72 forks source link

restconf: uint64 node returned as string #392

Closed kelin-Monster closed 1 year ago

kelin-Monster commented 1 year ago

container { leaf num1 { type uint32; } leaf num2 { type uint64; } }

set num1=1, num2=2 Then I get the value from restconf, the result is { "num1": 1, "num2": "2" }

olofhagsand commented 1 year ago

Actually, int64/uint64 should be encoded as a string. See RFC 7951 "JSON Encoding of YANG Data" Section 6.1:

A value of the "int64", "uint64", or "decimal64" type is represented as a JSON string whose content is the lexical representation of the corresponding YANG type as specified in Sections 9.2.1 and 9.3.1 of [RFC7950].