1
0
mirror of https://github.com/rancher/steve.git synced 2025-09-20 11:00:25 +00:00

Add test for deeper nesting of maps and arrays

This commit is contained in:
Chad Roberts
2025-01-28 10:23:31 -05:00
parent f4e11e202d
commit 879a6d30f3

View File

@@ -253,6 +253,30 @@ func TestSchemaFieldVisitor(t *testing.T) {
Description: protoNestedMap.Description, Description: protoNestedMap.Description,
}, },
}, },
{
name: "multi-level nested maps and arrays",
inputSchema: &proto.Map{
BaseSchema: proto.BaseSchema{
Description: "multi-level nested structure",
},
SubType: &proto.Array{
BaseSchema: proto.BaseSchema{
Description: "nested array",
},
SubType: &proto.Map{
BaseSchema: proto.BaseSchema{
Description: "deeply nested map",
},
SubType: &protoPrimitive,
},
},
},
wantDefinitions: map[string]definition{},
wantField: definitionField{
Type: "map[string]array[map[string]string]",
Description: "multi-level nested structure",
},
},
} }
for _, test := range tests { for _, test := range tests {