Skip to content
This repository was archived by the owner on Oct 17, 2024. It is now read-only.

Commit ee86e65

Browse files
committed
fixed bug: maps not recognized as a response type.
1 parent 644ef3d commit ee86e65

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

intermediate_operation.go

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,26 @@ func parseResponses(section Section) []*ResponseIntermediate {
295295

296296
var responseType SchemerDefiner
297297

298-
if isSlice, v := IsSlice(goType); isSlice {
298+
if isMap, k, v := IsMap(goType); isMap {
299+
300+
keyType := &MemberIntermediate{
301+
Type: k,
302+
Validations: make(ValidationMap),
303+
}
304+
305+
valueType := &MemberIntermediate{
306+
Type: v,
307+
Validations: make(ValidationMap),
308+
}
309+
310+
responseType = &MapIntermediate{
311+
Type: goType,
312+
ValueType: valueType,
313+
KeyType: keyType,
314+
Validations: make(ValidationMap),
315+
}
316+
317+
} else if isSlice, v := IsSlice(goType); isSlice {
299318
valueType := &MemberIntermediate{
300319
Type: v,
301320
Validations: make(ValidationMap),

0 commit comments

Comments
 (0)