mirror of
https://github.com/rancher/steve.git
synced 2025-09-20 02:51:11 +00:00
Add test for empty schema
This commit is contained in:
@@ -78,6 +78,12 @@ var (
|
|||||||
},
|
},
|
||||||
SubType: &protoKind,
|
SubType: &protoKind,
|
||||||
}
|
}
|
||||||
|
protoEmpty = proto.Kind{
|
||||||
|
BaseSchema: proto.BaseSchema{
|
||||||
|
Description: "emptySchema",
|
||||||
|
Path: proto.NewPath("io.cattle.empty"),
|
||||||
|
},
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestSchemaFieldVisitor(t *testing.T) {
|
func TestSchemaFieldVisitor(t *testing.T) {
|
||||||
@@ -277,6 +283,21 @@ func TestSchemaFieldVisitor(t *testing.T) {
|
|||||||
Description: "multi-level nested structure",
|
Description: "multi-level nested structure",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "empty schema",
|
||||||
|
inputSchema: &protoEmpty,
|
||||||
|
wantDefinitions: map[string]definition{
|
||||||
|
"io.cattle.empty": {
|
||||||
|
ResourceFields: map[string]definitionField{},
|
||||||
|
Type: "io.cattle.empty",
|
||||||
|
Description: protoEmpty.Description,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
wantField: definitionField{
|
||||||
|
Type: "io.cattle.empty",
|
||||||
|
Description: protoEmpty.Description,
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
|
Reference in New Issue
Block a user