Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cpp rest-sdk] Improve method signatures to use const when the value won't change #1295

Merged
merged 4 commits into from
Oct 28, 2018

Conversation

whoan
Copy link
Contributor

@whoan whoan commented Oct 23, 2018

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\.
  • Filed the PR against the correct branch: master, 3.4.x, 4.0.x. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language.

Description of the PR

Improve method signatures to use const when the value won't change.

Ping @ravinikam @stkrwork @fvarose @etherealjoy @MartinDelille

Copy link
Contributor

@etherealjoy etherealjoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about the const reference for setter arguments?

https://github.com/OpenAPITools/openapi-generator/pull/1295/files#diff-dcd1e3f1c138323826806ca0c2cb3465R56

Looks much better with this change, but you could perhaps consider this point too.

@etherealjoy etherealjoy changed the title Constness [cpp rest-sdk] Constness Oct 23, 2018
@etherealjoy
Copy link
Contributor

I think it is a little complicated with Models, being passed a a shared_ptr.
You could fix it later if you wish.
Some work has been done for other clients and servers but I think it is going to be a breaking change.
So you could do it in the next step.

@etherealjoy etherealjoy added this to the 3.3.2 milestone Oct 28, 2018
@etherealjoy etherealjoy merged commit d80f3a6 into OpenAPITools:master Oct 28, 2018
@whoan whoan deleted the constness branch October 29, 2018 19:03
@wing328 wing328 changed the title [cpp rest-sdk] Constness [cpp rest-sdk] Improve method signatures to use const when the value won't change Oct 31, 2018
@wing328
Copy link
Member

wing328 commented Oct 31, 2018

@whoan thanks for the PR, which is included in the v3.3.2 release: https://twitter.com/oas_generator/status/1057649626101112832

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants