Skip to content

Commit

Permalink
fix bug in array param in body (#579)
Browse files Browse the repository at this point in the history
* fix bug in array param in body
  • Loading branch information
sdghchj authored and ubogdan committed Dec 12, 2019
1 parent a478a32 commit b731715
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions operation.go
Expand Up @@ -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{},
Expand Down
2 changes: 1 addition & 1 deletion operation_test.go
Expand Up @@ -394,7 +394,7 @@ func TestParseParamCommentBodyArray(t *testing.T) {
"in": "body",
"required": true,
"schema": {
"type": "string",
"type": "array",
"items": {
"type": "string"
}
Expand Down

0 comments on commit b731715

Please sign in to comment.