Skip to content

JSON empty leaf-list encoding issue #1822

@VandanaAkhramka

Description

@VandanaAkhramka

This is a bug that affects libyang1 (hit on 1.0.225-1.1). I have not tested whether the same bug affects v2 as well.

I have a YANG module with a leaf-list of type string:

module null_leaflist_json {
  prefix "null_leaflist_json";
  namespace "urn:test:null_leaflist_json";

  leaf-list test_array {type string;}
}

The correct way to represent an empty leaf-list is in JSON is

"test_array": []

I have made a fix for this in my fork of this repo and added a regression test. Please see the PR #1821 for the fix. Could you please review my fix and help me get it merged in?

Metadata

Metadata

Assignees

No one assigned

    Labels

    is:enhancementRequest for adding new feature or enahncing functionality.status:completedFrom the developer perspective, the issue was solved (bug fixed, question answered,...)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions