Fix bundle schema for complex variable references

This commit is contained in:
Shreyas Goenka 2024-06-28 00:19:36 +02:00
parent 4d8eba04cd
commit 59b731998c
No known key found for this signature in database
GPG Key ID: 92A07DF49CCB0622
2 changed files with 555 additions and 81 deletions

View File

@ -168,9 +168,8 @@ func toSchema(golangType reflect.Type, docs *Docs, tracker *tracker) (*jsonschem
}
jsonSchema := &jsonschema.Schema{Type: rootJavascriptType}
// If the type is a non-string primitive, then we allow it to be a string
// provided it's a pure variable reference (ie only a single variable reference).
if rootJavascriptType == jsonschema.BooleanType || rootJavascriptType == jsonschema.NumberType {
// Variables can be set as the value at any node in the configuration tree.
if rootJavascriptType != jsonschema.StringType {
jsonSchema = &jsonschema.Schema{
AnyOf: []*jsonschema.Schema{
{

File diff suppressed because it is too large Load Diff