Skip to content

Commit 7e2faf8

Browse files
fix: pass param name to object typify (#209)
For a union type of a param where one part of the union is an Object type, we must retain the name of the object param so that typify has context on what to define the interface as.
1 parent f401c30 commit 7e2faf8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/utils.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,10 @@ export const genMethodString = (
379379
} else if (paramType.type === 'Object' && objectParam.properties) {
380380
return {
381381
...objectParam,
382-
type: createMethodObjectParamType(objectParam),
382+
type: createMethodObjectParamType({
383+
...objectParam,
384+
name: param.name,
385+
}),
383386
};
384387
}
385388
return paramType;

0 commit comments

Comments
 (0)