Skip to content

Commit

Permalink
fix: remain nullable for pointer fields (#44)
Browse files Browse the repository at this point in the history
Co-authored-by: a.zinoviev <[email protected]>
  • Loading branch information
xobotyi and xobotyi authored Sep 20, 2022
1 parent de8a401 commit 6d8b47c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion openapi3/reflect.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ func (r *Reflector) parseParametersIn(
s := SchemaOrRef{}
s.FromJSONSchema(propertySchema.ToSchemaOrBool())

if s.Schema != nil && s.Schema.Nullable != nil {
if s.Schema != nil && s.Schema.Nullable != nil && field.Type.Kind() != reflect.Ptr {
s.Schema.Nullable = nil
}

Expand Down

0 comments on commit 6d8b47c

Please sign in to comment.