You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are using openapi-generator to generate C++ classes from Java. For primitive types, the C++ getter method has 'const' qualifier, but when aggregates are specified, the method does not have have the const qualifier. Can a 'const' be added for getter methods even when the return type is an aggregate? (I am not very familiar with C++, and maybe there is a reason this is not being done. And I am filing this on behalf of someone who mentioned that not having a const on these getters causes them some grief.)
Please Note: I had originally filed this issue against swagger-codegen (v2.2.3), and William Cheng had asked to try out the latest version of OpenAPI Generator, but it does not address the issue I had. He had then recommended that I file an issue in OpenAPI as well. For your reference, the swagger-codegen issue is: swagger-api/swagger-codegen#8770
openapi-generator version
We are using openapi-generator-maven-plugin v3.3.0
and openapi-generator v3.3.0
OpenAPI declaration file content or url
Command line used for generation
Using the openapi-generator-maven-plugin to generate the code. Please let me know if you need any additional info
Steps to reproduce
Please use the included sample Java code to generate a C++ class. If you need any additional info, please let me know.
Sadly I fear breaking too much when applied to others.
stkrwork
changed the title
Use 'const' for cpp getters even when the return type is an aggregate
[C++] Use 'const' for cpp getters even when the return type is an aggregate
Oct 5, 2018
Description
We are using openapi-generator to generate C++ classes from Java. For primitive types, the C++ getter method has 'const' qualifier, but when aggregates are specified, the method does not have have the const qualifier. Can a 'const' be added for getter methods even when the return type is an aggregate? (I am not very familiar with C++, and maybe there is a reason this is not being done. And I am filing this on behalf of someone who mentioned that not having a const on these getters causes them some grief.)
Please Note: I had originally filed this issue against swagger-codegen (v2.2.3), and William Cheng had asked to try out the latest version of OpenAPI Generator, but it does not address the issue I had. He had then recommended that I file an issue in OpenAPI as well. For your reference, the swagger-codegen issue is: swagger-api/swagger-codegen#8770
openapi-generator version
We are using openapi-generator-maven-plugin v3.3.0
and openapi-generator v3.3.0
OpenAPI declaration file content or url
Command line used for generation
Using the openapi-generator-maven-plugin to generate the code. Please let me know if you need any additional info
Steps to reproduce
Please use the included sample Java code to generate a C++ class. If you need any additional info, please let me know.
Related issues/PRs
swagger-api/swagger-codegen#8770
Suggest a fix/enhancement
The text was updated successfully, but these errors were encountered: