From 475f4c6e2f09e90063ecb47d61d80e9b655883fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20F=20Bj=C3=B6rklund?= Date: Tue, 14 May 2024 22:03:00 +0200 Subject: [PATCH] Allow Disk to use either name or struct MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Anders F Björklund --- cmd/limactl/genschema.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/limactl/genschema.go b/cmd/limactl/genschema.go index 7b35e1fe869..737634ca365 100644 --- a/cmd/limactl/genschema.go +++ b/cmd/limactl/genschema.go @@ -22,6 +22,12 @@ func newGenSchemaCommand() *cobra.Command { func genschemaAction(cmd *cobra.Command, _ []string) error { schema := jsonschema.Reflect(&limayaml.LimaYAML{}) + // allow Disk to be either string (name) or object (struct) + schema.Definitions["Disk"].Type = "" // was: "object" + schema.Definitions["Disk"].OneOf = []*jsonschema.Schema{ + {Type: "string"}, + {Type: "object"}, + } j, err := json.MarshalIndent(schema, "", " ") if err != nil { return err