swagger-codegen icon indicating copy to clipboard operation
swagger-codegen copied to clipboard

Invalid Parameter Naming Case (TypeScript-Angular2) (Swagger-Codegen 2.2.2)

Open darius-iko opened this issue 9 years ago • 11 comments

Description

Parameter for API functions generated by Swagger-codegen is invalid.

image

Swagger-codegen version

2.2.2

Swagger declaration file content or url
Command line used for generation

-c config.json -l typescript-angular2

Config.json: { "modelPropertyNaming" : "original" }

Steps to reproduce
Related issues
Suggest a Fix

It should follow the parameter naming case (lowercase).

darius-iko avatar Apr 25 '17 07:04 darius-iko

By the way, that string literal should be generated only if I set supportsES6 to true. By default, it is false, so it should not use the template literals like '/${Id}/'

darius-iko avatar Apr 25 '17 07:04 darius-iko

@darius-iko yup, that's a bug. We've fixed similar issues in other generators. I'll try to file a PR shortly to address it.

wing328 avatar Apr 25 '17 07:04 wing328

@wing328 Thank you

darius-iko avatar Apr 25 '17 07:04 darius-iko

By the way, that string literal should be generated if I set supportsES6 to true. By default, it is false.

@darius-iko can you elaborate on that by providing an example (actual output vs expected output)?

wing328 avatar Apr 25 '17 07:04 wing328

@wing328 Expected output: If the supportsES6 config is false (by default), it should use the old way by replacing the text like below: image

Actual output: As seen at the issue posted on the top-most.

darius-iko avatar Apr 25 '17 07:04 darius-iko

@darius-iko can you pull the latest master to give it a try?

https://github.com/swagger-api/swagger-codegen/blob/master/modules/swagger-codegen/src/main/resources/typescript-angular2/api.mustache#L63-L65

Looks like we've fixed it already via https://github.com/swagger-api/swagger-codegen/commit/dbe99c3af92ebc4862e7984a246b9af5e707013d

wing328 avatar Apr 25 '17 08:04 wing328

@wing328 Yes, the latest master has fixed it.

darius-iko avatar Apr 25 '17 08:04 darius-iko

Thanks for the confirmation. Closing the issue.

wing328 avatar Apr 25 '17 08:04 wing328

@wing328 So the version 2.2.2 cannot be used to generate TypeScript-Angular2 code and we have to wait the next version for it? When is the estimated release date for the next version?

darius-iko avatar Jul 15 '17 06:07 darius-iko

Thanks. Version 2.2.3 is out.

darius-iko avatar Jul 17 '17 03:07 darius-iko

@darius-iko yup, please give it a try and let us know if you've further feedback.

wing328 avatar Jul 17 '17 04:07 wing328