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 <phorton@sonatype.com>

* use tabs consistently

---------

Signed-off-by: Paul Horton <phorton@sonatype.com>
This commit is contained in:
Paul Horton 2025-04-25 10:09:11 +01:00 committed by GitHub
parent 5a9f973e91
commit bdb063f170
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -36,7 +36,12 @@ func Test_{{packageName}}_{{classname}}Service(t *testing.T) {
t.Skip("skip test") // remove to run test
{{/-first}}
{{#isPrimitiveType}}
var {{paramName}} {{{dataType}}}
{{/isPrimitiveType}}
{{^isPrimitiveType}}
var {{paramName}} {{goImportAlias}}.{{{dataType}}}
{{/isPrimitiveType}}
{{/pathParams}}
{{#returnType}}resp, {{/returnType}}httpRes, err := apiClient.{{classname}}.{{operationId}}(context.Background(){{#pathParams}}, {{paramName}}{{/pathParams}}).Execute()