Description
Go client generator will create model files that end in _test.go when a definition / schema name ends in Test, _Test, or _test. These files are unreachable and not compiled in Go per the following:
When compiling packages, build ignores files that end in '_test.go'.
Ref: https://godoc.org/github.com/golang/go/src/cmd/go#hdr-Test_packages
The client generator should modify the filename when this is encountered.
openapi-generator version
3.0.3
OpenAPI declaration file content or url
https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
Command line used for generation
Steps to reproduce
Create a program that attempts to use the following generated structs which are created by the spec and command above.
| Definition |
Struct Name |
Filename |
ArrayTest |
ArrayTest |
model_array_test.go |
Enum_Test |
EnumTest |
model_enum_test.go |
format_test |
FormatTest |
model_format_test.go |
MapTest |
MapTest |
model_map_test.go |
Related issues/PRs
#449
Suggest a fix/enhancement
Rename the files with an alternate suffix like _test_.go for model_array_test_.go similar to toParamName.
Description
Go client generator will create model files that end in
_test.gowhen a definition / schema name ends inTest,_Test, or_test. These files are unreachable and not compiled in Go per the following:Ref: https://godoc.org/github.com/golang/go/src/cmd/go#hdr-Test_packages
The client generator should modify the filename when this is encountered.
openapi-generator version
3.0.3
OpenAPI declaration file content or url
https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
Command line used for generation
Steps to reproduce
Create a program that attempts to use the following generated structs which are created by the spec and command above.
ArrayTestArrayTestmodel_array_test.goEnum_TestEnumTestmodel_enum_test.goformat_testFormatTestmodel_format_test.goMapTestMapTestmodel_map_test.goRelated issues/PRs
#449
Suggest a fix/enhancement
Rename the files with an alternate suffix like
_test_.goformodel_array_test_.gosimilar totoParamName.