new line for s

This commit is contained in:
Shreyas Goenka 2024-09-06 15:18:31 +02:00
parent e55df7b207
commit 1dd399f3fe
No known key found for this signature in database
GPG Key ID: 92A07DF49CCB0622
4 changed files with 12 additions and 9 deletions

View File

@ -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")},

View File

@ -1,6 +1,6 @@
package generated
package schema
import _ "embed"
//go:embed jsonschema.json
var BundleSchema []byte
var Bytes []byte

View File

@ -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"
)
@ -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
}