Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
shreyas-goenka committed Sep 10, 2024
1 parent 9689a79 commit c365fd4
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 55 deletions.
15 changes: 9 additions & 6 deletions bundle/internal/schema/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,17 @@ func addInterpolationPatterns(typ reflect.Type, s jsonschema.Schema) jsonschema.
}

// The variables block in a target override allows for directly specifying
// the value if it is a primitive type.
// the value of the variable.
if typ == reflect.TypeOf(variable.TargetVariable{}) {
return jsonschema.Schema{
AnyOf: []jsonschema.Schema{s,
{Type: jsonschema.StringType},
{Type: jsonschema.BooleanType},
{Type: jsonschema.IntegerType},
{Type: jsonschema.NumberType},
AnyOf: []jsonschema.Schema{
// We keep the original schema so that autocomplete suggestions
// continue to work.
s,
// All values are valid for a variable value, be it primitive types
// like string/bool or complex ones like objects/arrays. Thus we override
// the schema to allow all valid JSON values.
{},
},
}
}
Expand Down
87 changes: 38 additions & 49 deletions bundle/schema/jsonschema.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c365fd4

Please sign in to comment.