[NETCONF-1172] OpenApi ignore min-elements conditions for list Created: 02/Oct/23  Updated: 03/Nov/23  Resolved: 03/Nov/23

Status: Resolved
Project: netconf
Component/s: restconf-openapi
Affects Version/s: None
Fix Version/s: 7.0.0

Type: Bug Priority: Medium
Reporter: Peter Suna Assignee: Matej Šramčík
Resolution: Done Votes: 0
Labels: pt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Screenshot 2023-10-02 204930.png    

 Description   

OpenAPI generates an example for a list with only one element, even when the min-elements constraint is set.

Generated example for this model is attached.

module test-container-childs {
    namespace "http://example.com/test/container/child";
    prefix "tcc";
    revision 2023-09-28;

    container root-container {
        container nested-container {
            list mandatory-list {
                min-elements 2;
                max-elements 3;
                key id;
                leaf id {
                    type uint32;
                }
            }
        }
    }
} 

 

Expected example payload:

{
    "nested-container": {
        "mandatory-list": [
            {
                "id": 0
            },
            {
                "id": 1
            }
        ]
    }
} 

Generated at Wed Feb 07 20:16:51 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.