mirror of https://github.com/databricks/cli.git
fix test
This commit is contained in:
parent
75a571a56d
commit
8cd26318e8
|
@ -81,7 +81,7 @@ func (c *constructor) Definitions() map[string]any {
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
|
||||||
// FromType converts a reflect.Type to a jsonschema.Schema. Nodes in the final JSON
|
// FromType converts a [reflect.Type] to a [Schema]. Nodes in the final JSON
|
||||||
// schema are guaranteed to be one level deep, which is done using defining $defs
|
// schema are guaranteed to be one level deep, which is done using defining $defs
|
||||||
// for every Go type and referring them using $ref in the corresponding node in
|
// for every Go type and referring them using $ref in the corresponding node in
|
||||||
// the JSON schema.
|
// the JSON schema.
|
||||||
|
@ -253,11 +253,16 @@ func (c *constructor) fromTypeStruct(typ reflect.Type) (Schema, error) {
|
||||||
bundleTags := strings.Split(structField.Tag.Get("bundle"), ",")
|
bundleTags := strings.Split(structField.Tag.Get("bundle"), ",")
|
||||||
// Fields marked as "readonly", "internal" or "deprecated" are skipped
|
// Fields marked as "readonly", "internal" or "deprecated" are skipped
|
||||||
// while generating the schema
|
// while generating the schema
|
||||||
|
skip := false
|
||||||
for _, tag := range skipTags {
|
for _, tag := range skipTags {
|
||||||
if slices.Contains(bundleTags, tag) {
|
if slices.Contains(bundleTags, tag) {
|
||||||
continue
|
skip = true
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if skip {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
jsonTags := strings.Split(structField.Tag.Get("json"), ",")
|
jsonTags := strings.Split(structField.Tag.Get("json"), ",")
|
||||||
fieldName := jsonTags[0]
|
fieldName := jsonTags[0]
|
||||||
|
|
Loading…
Reference in New Issue