这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ func SchemaFromField(registry Registry, f reflect.StructField, hint string) *Sch
}

fs.Nullable = boolTag(f, "nullable", fs.Nullable)
if fs.Nullable && fs.Ref != "" {
if fs.Nullable && fs.Ref != "" && registry.SchemaFromRef(fs.Ref).Type == "object" {
// Nullability is only supported for scalar types for now. Objects are
// much more complicated because the `null` type lives within the object
// definition (requiring multiple copies of the object) or needs to use
Expand Down