-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
Refactor StringUtils functions #859
Conversation
9f02acc
to
f401569
Compare
f401569
to
3957a7d
Compare
Can you please merge |
Done 👍 |
Conflicts: modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractEiffelCodegen.java modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpClientCodegen.java modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNancyFXServerCodegen.java modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppPistacheServerCodegen.java modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/LuaClientCodegen.java modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ObjcClientCodegen.java modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonFlaskConnexionServerCodegen.java modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java
97480bf
to
5ebf1ac
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for enhancement 👍
I tried to use the web-based interface to resolve the merge conflicts but failed. I'm working on a fix by pulling the branch locally. UPDATE: pushed the fix via 20bd4d1 |
@rienafairefr can you please take another look to ensure my change didn't mess up your PR? Sorry for the inconvenience. |
OK I'll look at that when I get some time 👍
…On Mon, Aug 27, 2018, 06:05 William Cheng ***@***.***> wrote:
@rienafairefr <https://github.com/rienafairefr> can you please take
another look to ensure my change didn't mess up your PR? Sorry for the
inconvenience.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#859 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAuS9a8BKnrY1wNFqznjuKcC361I5GHVks5uU3AVgaJpZM4WFiG_>
.
|
Your merge looks fine 👍 |
👍 I think that's more preferable by using @deprecate to mark those methods to be deprecated later. |
Done, they're deprecated now. A bit ugly to have to call with the fully qualified org.openapitools.codegen.utils.StringUtils.* name (as long as the methods are not removed, the names clash), but it seems to work. Might be cleaner to rename the methods. |
…g.openapitools.codegen.utils.StringUtils static methods
1103940
to
0e0f77e
Compare
If no one has further feedback, I'll merge it tomorrow. |
@rienafairefr thanks again for the refactoring. I've filed a follow-up PR to remove those deprecated methods in 3.3.0 (minor release): #1031 |
* extract StringUtils * extract escape function * fixup! extract escape function * forbiddenapis fix * fix merge issue * put string utils methods as deprecated, call with FQDN to call the org.openapitools.codegen.utils.StringUtils static methods * javadoc fix
PR checklist
./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\
.master
,3.3.x
,4.0.x
. Default:master
.Description of the PR
As part of "Separation of Concerns" project and #842 I felt that the place for camelize, underscore, or dashize are not in the DefaultCodegen, they should be moved to a class in org.openapitools.codegen.utils, and then each language would have its own use for these static functions
I also extracted the escapeSpecialCharacters method of DefaultCodegen to a static method escape in StringUtils, looks better to me but that's not a mandatory part IMO