Skip to content

Commit

Permalink
fix: only override struct description if the description tag is expli…
Browse files Browse the repository at this point in the history
…citly set
  • Loading branch information
olistrik committed Feb 9, 2024
1 parent 9b6bb6e commit fc64605
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion reflect.go
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,11 @@ func (r *Reflector) lookupID(t reflect.Type) ID {
}

func (t *Schema) structKeywordsFromTags(f reflect.StructField, parent *Schema, propertyName string) {
t.Description = f.Tag.Get("jsonschema_description")
description, ok := f.Tag.Lookup("jsonschema_description")
if ok {
t.Description = description
}


Check failure on line 617 in reflect.go

View workflow job for this annotation

GitHub Actions / golangci-lint

File is not `gofmt`-ed with `-s` `-r 'interface{} -> any'` `-r 'a[b:len(a)] -> a[b:]'` (gofmt)
tags := splitOnUnescapedCommas(f.Tag.Get("jsonschema"))
tags = t.genericKeywords(tags, parent, propertyName)
Expand Down

0 comments on commit fc64605

Please sign in to comment.