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

[Kotlin] enumPropertyNaming UPPERCASE should separate words with _ #4062

Merged
merged 3 commits into from
Dec 27, 2019

Conversation

lemoinem
Copy link
Contributor

@lemoinem lemoinem commented Oct 4, 2019

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, ./bin/openapi3/{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\. If contributing template-only or documentation-only changes which will change sample output, be sure to build the project first.
  • Filed the PR against the correct branch: master, 4.1.x, 5.0.x. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language.
    /cc Kotlin: @jimschubert @dr4ke616 @karismann @Zomzog

Description of the PR

When using enumPropertyNaming=UPPERCASE with the Kotlin generators, words aren't separated by _, as they should be.

@Fjolnir-Dvorak
Copy link
Contributor

Could you please add a unit test for this that the next change in the code won't change it back again or does something else so it is documented how enums should be named?

@lemoinem lemoinem force-pushed the patch-1 branch 2 times, most recently from 88a24c9 to f7e4420 Compare November 1, 2019 16:39
@lemoinem
Copy link
Contributor Author

lemoinem commented Nov 1, 2019

@Fjolnir-Dvorak Sorry for the delay.
I've added some tests. Could you double check I did that correctly? I'm not sure if I need to do anything else.

CirleCI fails is related to "Docker Layer Caching is not available on your plan.". Not related to PR and looks like a configuration issue.

@Fjolnir-Dvorak
Copy link
Contributor

yes, I will check that, thank you for that

@4brunu
Copy link
Contributor

4brunu commented Nov 8, 2019

Any news on this PR? Looking forward to it 🙂

@Fjolnir-Dvorak
Copy link
Contributor

Well, I didn't meant those tests but simple unit tests but I guess that works, too. Thank you for adding some tests

@lemoinem
Copy link
Contributor Author

lemoinem commented Nov 14, 2019

@Fjolnir-Dvorak Sorry, I looked at the existing tests I could see and didn't find how or where to add such unit tests. Any advice, is welcome... Where would the unit tests be in the code? Do you have any example of existing unit tests in the repo or any doc for it?

I did have a look at the content of openapi-generator/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/, but it seemed even more complex to setup and code than the one I added and seemed hardly readable or "simple" ;)...

@Fjolnir-Dvorak
Copy link
Contributor

Fjolnir-Dvorak commented Nov 14, 2019

@lemoinem If you want I will look into it when this is merged. That test is not required. It is just nice to have those, especially because those "configurations" are easy to break by other people and are actually broken in many generators.
And since you made a golden test it is tested now which is all I asked for. Thank you for that.
But If you want to look into what exactly I had in mind you could look into org.openapitools.codegen.java.AbstractJavaCodegenTest. That one has exactly those cases tested.

@wing328 wing328 added this to the 4.2.2 milestone Nov 19, 2019
@wing328 wing328 modified the milestones: 4.2.2, 4.2.3 Dec 2, 2019
@wing328
Copy link
Member

wing328 commented Dec 27, 2019

Drone.io test failure already fixed in the master.

@wing328 wing328 merged commit 69b8831 into OpenAPITools:master Dec 27, 2019
@lemoinem lemoinem deleted the patch-1 branch January 6, 2020 18:16
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.

4 participants