Closed pboguslawski closed 1 year ago
This is intentional on the grounds that null
(nil
) is a valid value to receive in map or slice, it is loosened (no nullable) for omitempty
for reason that encoding won't expose null
.
If you want custom behavior, you can define it with jsonschema.InterceptNullability
hook on (*web.Service).OpenAPICollector.Reflector().DefaultOptions
.
Please see https://github.com/swaggest/jsonschema-go/pull/59#issuecomment-1321785609 for details.
Works fine thank you!
Describe the bug When declaring struct with list i.e.
final
openapi.json
hasnullable: true
on these fields.If it's intentional: how to declare list field that must exist in json and when without items must be like
"strings": []
?