Skip to content

Commit

Permalink
fix: type schema description not work
Browse files Browse the repository at this point in the history
  • Loading branch information
fourcels committed Jun 3, 2024
1 parent 6019e80 commit cc3a6b6
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 cc3a6b6

Please sign in to comment.