Skip to content

Commit bdb063f

Browse files
authored
fix: Support PathParams not of primitive types for Go in generated tests (#21107)
* fix: Support PathParams not of primitive types for Go in generated tests Signed-off-by: Paul Horton <[email protected]> * use tabs consistently --------- Signed-off-by: Paul Horton <[email protected]>
1 parent 5a9f973 commit bdb063f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

modules/openapi-generator/src/main/resources/go/api_test.mustache

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,12 @@ func Test_{{packageName}}_{{classname}}Service(t *testing.T) {
3636
t.Skip("skip test") // remove to run test
3737

3838
{{/-first}}
39+
{{#isPrimitiveType}}
3940
var {{paramName}} {{{dataType}}}
41+
{{/isPrimitiveType}}
42+
{{^isPrimitiveType}}
43+
var {{paramName}} {{goImportAlias}}.{{{dataType}}}
44+
{{/isPrimitiveType}}
4045
{{/pathParams}}
4146

4247
{{#returnType}}resp, {{/returnType}}httpRes, err := apiClient.{{classname}}.{{operationId}}(context.Background(){{#pathParams}}, {{paramName}}{{/pathParams}}).Execute()

0 commit comments

Comments
 (0)