Skip to content

Commit

Permalink
Allow Disk to use either name or struct
Browse files Browse the repository at this point in the history
Signed-off-by: Anders F Björklund <[email protected]>
  • Loading branch information
afbjorklund committed Aug 31, 2024
1 parent 1ed8206 commit 11216da
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/limactl/genschema.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 11216da

Please sign in to comment.