Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
shreyas-goenka committed Sep 6, 2024
1 parent 75a571a commit 8cd2631
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions libs/jsonschema/from_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func (c *constructor) Definitions() map[string]any {
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
// for every Go type and referring them using $ref in the corresponding node in
// the JSON schema.
Expand Down Expand Up @@ -253,11 +253,16 @@ func (c *constructor) fromTypeStruct(typ reflect.Type) (Schema, error) {
bundleTags := strings.Split(structField.Tag.Get("bundle"), ",")
// Fields marked as "readonly", "internal" or "deprecated" are skipped
// while generating the schema
skip := false
for _, tag := range skipTags {
if slices.Contains(bundleTags, tag) {
continue
skip = true
break
}
}
if skip {
continue
}

jsonTags := strings.Split(structField.Tag.Get("json"), ",")
fieldName := jsonTags[0]
Expand Down

0 comments on commit 8cd2631

Please sign in to comment.