Skip to content

Commit

Permalink
new line for s
Browse files Browse the repository at this point in the history
  • Loading branch information
shreyas-goenka committed Sep 6, 2024
1 parent e55df7b commit 1dd399f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
13 changes: 8 additions & 5 deletions bundle/internal/schema/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,19 @@ func addInterpolationPatterns(typ reflect.Type, s jsonschema.Schema) jsonschema.
case jsonschema.ArrayType, jsonschema.ObjectType:
// arrays and objects can have complex variable values specified.
return jsonschema.Schema{
AnyOf: []jsonschema.Schema{s, {
Type: jsonschema.StringType,
Pattern: interpolationPattern("var"),
}},
AnyOf: []jsonschema.Schema{
s,
{
Type: jsonschema.StringType,
Pattern: interpolationPattern("var"),
}},
}
case jsonschema.IntegerType, jsonschema.NumberType, jsonschema.BooleanType:
// primitives can have variable values, or references like ${bundle.xyz}
// or ${workspace.xyz}
return jsonschema.Schema{
AnyOf: []jsonschema.Schema{s,
AnyOf: []jsonschema.Schema{
s,
{Type: jsonschema.StringType, Pattern: interpolationPattern("resources")},
{Type: jsonschema.StringType, Pattern: interpolationPattern("bundle")},
{Type: jsonschema.StringType, Pattern: interpolationPattern("workspace")},
Expand Down
4 changes: 2 additions & 2 deletions bundle/generated/embed.go → bundle/schema/embed.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package generated
package schema

import _ "embed"

//go:embed jsonschema.json
var BundleSchema []byte
var Bytes []byte
File renamed without changes.
4 changes: 2 additions & 2 deletions cmd/bundle/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package bundle
import (
_ "embed"

"github.com/databricks/cli/bundle/generated"
"github.com/databricks/cli/bundle/schema"
"github.com/databricks/cli/cmd/root"
"github.com/spf13/cobra"
)
Expand All @@ -16,7 +16,7 @@ func newSchemaCommand() *cobra.Command {
}

cmd.RunE = func(cmd *cobra.Command, args []string) error {
_, err := cmd.OutOrStdout().Write(generated.BundleSchema)
_, err := cmd.OutOrStdout().Write(schema.Bytes)
return err
}

Expand Down

0 comments on commit 1dd399f

Please sign in to comment.