Skip to content

Commit

Permalink
Merge pull request #462 from fourcels/fix-schema-description
Browse files Browse the repository at this point in the history
fix: type schema description not work
  • Loading branch information
danielgtaylor authored Jun 3, 2024
2 parents 3f7f301 + cc3a6b6 commit 158b076
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,9 @@ func SchemaFromField(registry Registry, f reflect.StructField, hint string) *Sch
if fs == nil {
return fs
}
fs.Description = f.Tag.Get("doc")
if doc := f.Tag.Get("doc"); doc != "" {
fs.Description = doc
}
if fs.Format == "date-time" && f.Tag.Get("header") != "" {
// Special case: this is a header and uses a different date/time format.
// Note that it can still be overridden by the `format` or `timeFormat`
Expand Down

0 comments on commit 158b076

Please sign in to comment.