databricks-cli/cmd/bundle/schema.go

27 lines
486 B
Go
Raw Normal View History

package bundle
import (
2024-08-27 11:46:52 +00:00
_ "embed"
"github.com/databricks/cli/cmd/root"
"github.com/spf13/cobra"
)
2024-08-27 11:46:52 +00:00
//go:embed _generated/jsonschema.json
2024-08-27 16:34:33 +00:00
var bundleSchemaBytes []byte
2024-08-27 11:46:52 +00:00
func newSchemaCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "schema",
Short: "Generate JSON Schema for bundle configuration",
Args: root.NoArgs,
}
cmd.RunE = func(cmd *cobra.Command, args []string) error {
2024-08-27 16:34:33 +00:00
_, err := cmd.OutOrStdout().Write(bundleSchemaBytes)
2024-08-27 11:46:52 +00:00
return err
}
return cmd
}