Skip to content

Commit bccafa1

Browse files
committed
Fix generic inference from parameter type
1 parent ac39bc7 commit bccafa1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

templates/swift/Sources/Services/Service.swift.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ open class {{ service.name | caseUcfirst }}: Service {
2525
{%~ endif %}
2626
open func {{ method.name | caseCamel }}{% if method.responseModel | hasGenericType(spec) %}<T>{% endif %}(
2727
{%~ for parameter in method.parameters.all %}
28-
{{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter | typeName | raw }}{% if not parameter.required %}? = nil{% endif %}{% if not loop.last or 'multipart/form-data' in method.consumes %},{% endif %}
28+
{{ parameter.name | caseCamel | escapeKeyword }}: {% if parameter.type == "object" %}T{% else %}{{ parameter | typeName | raw }}{% endif %}{% if not parameter.required %}? = nil{% endif %}{% if not loop.last or 'multipart/form-data' in method.consumes %},{% endif %}
2929

3030
{%~ endfor %}
3131
{%~ if 'multipart/form-data' in method.consumes %}

0 commit comments

Comments
 (0)