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-Spring] support to Spring boot3 & jakarta extension #14369

Merged
merged 6 commits into from
Jan 31, 2023

Conversation

parenko
Copy link
Contributor

@parenko parenko commented Jan 2, 2023

I have used #13620 PR then just merged with master and fixed conflicts.
Also changed spring boot version in POM and Gradle.

Synchronized with Java generator options.

Additionally run generate samples for Kotlin and run export documentation.

Executed successfully mvn clean compile on following samples:

  • samples/server/petstore/kotlin-springboot-3
  • samples/server/petstore/kotlin-springboot
  • samples/server/petstore/kotlin-springboot-reactive
  • samples/server/petstore/kotlin-springboot-springfox
  • samples/server/petstore/kotlin-springboot-delegate
  • samples/server/petstore/kotlin-springboot-source-swagger1
  • samples/server/petstore/kotlin-springboot-modelMutable
  • samples/server/petstore/kotlin-springboot-source-swagger2

To fix #13578

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    ./mvnw clean package 
    ./bin/generate-samples.sh bin/configs/kotlin*
    ./bin/utils/export_docs_generators.sh
    
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    For Windows users, please run the script in Git BASH.
  • File the PR against the correct branch: master (6.3.0) (minor release - breaking changes with fallbacks), 7.0.x (breaking changes without fallbacks)
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

FYI @jimschubert (2017/09) ❤️, @dr4ke616 (2018/08) @karismann (2019/03) @Zomzog (2019/04) @andrewemery (2019/10) @4brunu (2019/11) @yutaka0m (2020/03)

@parenko parenko changed the title [Kotlin-Spring] fix #13620 (merge conflict) support to Spring boot3 & jakarta extension fix #13620 [Kotlin-Spring] fix #13620 (merge conflict) support to Spring boot3 & jakarta extension Jan 2, 2023
@parenko parenko marked this pull request as draft January 8, 2023 14:01
@wing328
Copy link
Member

wing328 commented Jan 20, 2023

@parenko is this ready for merge? if yes, please mark is as "ready for review"

@parenko
Copy link
Contributor Author

parenko commented Jan 20, 2023

@wing328 it was, just wanted to make sure that all checks passed, and then switch for review

@jlengrand
Copy link
Contributor

I've tried to regenerate the sample using the added SpringBoot3: "true" option for the default spring boot sample and got it to compile and run without issues.
Nice PR, with some indentation fixes as well.

By default currently, no Spring Boot 3 sample is generated given that it's behind a flag. I feel It'd be useful to have at last one generated so it becomes part of the main sample suite. What do you think? After all, it's a major version

@jlengrand
Copy link
Contributor

Also tested the unhappy sprinfox path, working as expected. Well done!

@jlengrand
Copy link
Contributor

Which open issue would this close BTW @parenko ?

@parenko
Copy link
Contributor Author

parenko commented Jan 22, 2023

Which open issue would this close BTW @parenko ?

#14369 13578

@jlengrand
Copy link
Contributor

@parenko can you give me your opinion on this comment :

By default currently, no Spring Boot 3 sample is generated given that it's behind a flag. I feel It'd be useful to have at last one generated so it becomes part of the main sample suite. What do you think? After all, it's a major version.

I'm happy to do the commit.

@parenko
Copy link
Contributor Author

parenko commented Jan 23, 2023

@jlengrand thank you for pointing this out to me. I think it is a good idea and useful.

I tried your suggestion. Let me know if you would have done it similarly?

@parenko
Copy link
Contributor Author

parenko commented Jan 24, 2023

I used wrong option in bin/configs/kotlin-spring-boot-3.yaml, will change it soon...

@jlengrand
Copy link
Contributor

jlengrand commented Jan 24, 2023

Hey @parenko. I went ahead and changed the option for you. I decided to stay consistent with the "use" keyword. If you merge https://github.com/parenko/openapi-generator/pull/1/files It should run fine.

I also considered doing something like "springBootVersion = 3", with 2 being the default but I guess it's better to merge that now and consider it later (when is 4.x coming out anyways :)).

As soon as https://github.com/parenko/openapi-generator/pull/1/files is merged (or the build runs fine), AFAIC it's good to go @wing328

@jlengrand
Copy link
Contributor

Great job overall, it's clean, does what it's supposed to and you went the extra mile to test. Much appreciated

@parenko
Copy link
Contributor Author

parenko commented Jan 25, 2023

@jlengrand, I have changed the SpringBoot3 option to useSpringBoot3 as in Java generator.
Also changed importing with {{javaxPackage}}. Similar to #14505 or as done in Java generator with #14310.
Now all tests pass.

@jlengrand
Copy link
Contributor

Looks great! Let's merge this @wing328 ! Thanks for all the work @parenko

@parenko parenko changed the title [Kotlin-Spring] fix #13620 (merge conflict) support to Spring boot3 & jakarta extension [Kotlin-Spring] fix #13578 support to Spring boot3 & jakarta extension Jan 27, 2023
@wing328 wing328 changed the title [Kotlin-Spring] fix #13578 support to Spring boot3 & jakarta extension [Kotlin-Spring] support to Spring boot3 & jakarta extension Jan 31, 2023
@wing328 wing328 merged commit cffe2d0 into OpenAPITools:master Jan 31, 2023
@parenko parenko deleted the feat13578_1 branch January 31, 2023 19:51
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.

[REQ][KOTLIN-SPRING] Support jakarta namespace for kotlin-spring generator
4 participants