Skip to content

Commit a4ecb3f

Browse files
committed
update template
1 parent 8b5149b commit a4ecb3f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

SwagGen_Template/Sources/Request.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ extension {{ options.name }} {
2828
**{{ method|uppercase }}** {{ path }}
2929
*/
3030
{% set funcName %}{% if options.groupingType == "path" %}{{ method|lowercase|escapeReservedKeywords }}{% elif options.groupingType == "tag" and tag %}{{ type|replace:tagType,""|lowerFirstLetter }}{% else %}{{ type|lowerFirstLetter }}{% endif %}{% endset %}
31-
public func {{ funcName }}({% if options.groupingType != "path" %}{% for param in pathParams %}{{ param.name }} {{ param.value }}: {{ param.type }}, {% endfor %}{% endif %}{% for param in queryParams %}{{ param.name }}: {{ param.optionalType }}{% ifnot param.required %} = nil{% endif %}, {% endfor %}{% for param in headerParams %}{% if options.excludeHeaders[param.value] != true %}{{ param.name }}: {{ param.optionalType }}{% ifnot param.required %} = nil{% endif %}, {% endif %}{% endfor %}{% if body %}{{ body.name }}: {{ body.optionalType }}{% ifnot body.required %} = nil{% endif %}, {% endif %}fileID: String = #fileID, line: UInt = #line) async throws -> {{ successType|default:"Void" }} {
31+
public func {{ funcName }}({% if options.groupingType != "path" %}{% for param in pathParams %}{{ param.name }} {{ param.value }}: {{ param.type }}, {% endfor %}{% endif %}{% for param in queryParams %}{{ param.name }}: {{ param.optionalType }}{% ifnot param.required %} = nil{% endif %}, {% endfor %}{% for param in headerParams %}{% if options.excludeHeaders[param.value] != true %}{{ param.name }}: {{ param.optionalType }}{% ifnot param.required %} = nil{% endif %}, {% endif %}{% endfor %}{% if body %}{{ body.name }}: {{ body.optionalType }}{% ifnot body.required %} = nil{% endif %}, {% endif %}fileID: String = #fileID, line: UInt = #line, function: String = #function) async throws -> {{ successType|default:"Void" }} {
3232
try await client
3333
{% if options.groupingType != "path" %}
3434
.path("{{ path|replace:"{","\("|replace:"}",")" }}")
@@ -56,7 +56,8 @@ extension {{ options.name }} {
5656
.http,
5757
as: .{% if successType == "String" %}string{% elif successType == "Data" or successType == "File" %}identity{% elif successType %}decodable{% else %}void{% endif %},
5858
fileID: fileID,
59-
line: line
59+
line: line,
60+
function: function
6061
)
6162
}
6263

0 commit comments

Comments
 (0)