diff --git a/operation.go b/operation.go index f207413d2..11bc6e156 100644 --- a/operation.go +++ b/operation.go @@ -181,6 +181,7 @@ func (operation *Operation) ParseParamComment(commentLine string, astFile *ast.F case "primitive": param.Schema.Type = spec.StringOrArray{refType} case "array": + param.Schema.Type = spec.StringOrArray{objectType} param.Schema.Items = &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{}, diff --git a/operation_test.go b/operation_test.go index f3d5273af..dcf9044b9 100644 --- a/operation_test.go +++ b/operation_test.go @@ -394,7 +394,7 @@ func TestParseParamCommentBodyArray(t *testing.T) { "in": "body", "required": true, "schema": { - "type": "string", + "type": "array", "items": { "type": "string" }