Skip to content

Commit 4ef131e

Browse files
committed
openapi: all array elements should be non-nullable
There is never a case where we allow nulls to be mixed into an array. Signed-off-by: Andrew Richardson <[email protected]>
1 parent 0b7ec79 commit 4ef131e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/ffapi/openapi3.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,10 @@ func (sg *SwaggerGen) addCustomType(t reflect.Type, schema *openapi3.Schema) {
206206
True := true
207207
schema.AdditionalProperties = openapi3.AdditionalProperties{Has: &True}
208208
}
209+
210+
if schema.Items != nil && schema.Items.Value != nil {
211+
schema.Items.Value.Nullable = false
212+
}
209213
}
210214

211215
func (sg *SwaggerGen) addInput(ctx context.Context, doc *openapi3.T, route *Route, op *openapi3.Operation) {

0 commit comments

Comments
 (0)