Skip to content

Commit 475f4c6

Browse files
committed
Allow Disk to use either name or struct
Signed-off-by: Anders F Björklund <[email protected]>
1 parent b204276 commit 475f4c6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cmd/limactl/genschema.go

+6
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ func newGenSchemaCommand() *cobra.Command {
2222

2323
func genschemaAction(cmd *cobra.Command, _ []string) error {
2424
schema := jsonschema.Reflect(&limayaml.LimaYAML{})
25+
// allow Disk to be either string (name) or object (struct)
26+
schema.Definitions["Disk"].Type = "" // was: "object"
27+
schema.Definitions["Disk"].OneOf = []*jsonschema.Schema{
28+
{Type: "string"},
29+
{Type: "object"},
30+
}
2531
j, err := json.MarshalIndent(schema, "", " ")
2632
if err != nil {
2733
return err

0 commit comments

Comments
 (0)