fix(ktor-client): do not add jsonBlock if using kotlinx-serialization#15793
Conversation
|
FYI |
|
Error seems totally unrelated and I'm unable to reproduce locally. Is this a flaky testing failing just in CI? |
Hi, thanks for the PR. It seems that a sample is changed but not pushed. Did you merge master and generate all samples? If not, please try that. Edit: I'm on my phone, so I can't review property right now. But did you add the new sample to the list in https://github.com/OpenAPITools/openapi-generator/blob/master/.github/workflows/samples-kotlin-client.yaml? |
…t.yaml pipeline actually, kotlin-jvm-ktor-gson was duplicated, so I'm replacing the second one by kotlin-jvm-ktor-kotlinx_serialization
4301831 to
51dfcb2
Compare
|
@stefankoppier tahnks for pointing that out, I was indeed missing the pipeline file. I'm not sure how that was causing the test error, but it seems to be gone now. |
|
the CI tests failed: https://github.com/OpenAPITools/openapi-generator/actions/runs/5216700141/jobs/9422350503?pr=15793 can you please take a look when you've time? |
…ktor + kotlinx_serialization
|
@stefankoppier @wing328 sorry for the back and forth, both errors should be fixed now, I'm getting the gist of the way the project is organized. |
| generatorName: kotlin | ||
| outputDir: samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization | ||
| library: jvm-ktor | ||
| inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml |
There was a problem hiding this comment.
please use 3.0 spec instead
modules/openapi-generator/src/test/resources/3_0/petstore.yaml
There was a problem hiding this comment.
please use 3.0 spec instead
I was using 2.0 because all the other kotlin/ktor were using it, but sure, I can update this one.
Just as a heads-up, I found another issue with ktor + kotlinx-serialization, in regards to not setting the content type, I'll submit another issue/PR as soon as this one gets sorted.
Also, since we are doing changes that are not related strictly to jsonBlock anymore, should I add the other fixes I have to this same PR, or do you still prefer that I raise another issue/ticket?
There was a problem hiding this comment.
I was using 2.0 because all the other kotlin/ktor were using it, but sure, I can update this one.
yes, i know what you're talking about. we know yet have time to update those to use 3.0 spec.
for new one (test), we definitely want to start with 3.0 spec
There was a problem hiding this comment.
Also, since we are doing changes that are not related strictly to jsonBlock anymore, should I add the other fixes I have to this same PR, or do you still prefer that I raise another issue/ticket?
We prefer small PRs for easier review.
There was a problem hiding this comment.
Ok, I'll raise another PR right after.
There was a problem hiding this comment.
Also worth sharing with you that we are gradually moving away from petstore and will switch to echo server instead for client testings. https://github.com/OpenAPITools/openapi-generator/wiki/Integration-Tests#echo-server has more info.
(no need to do anything in this PR. more of an FYI)
|
@wing328 changes pushed. Also made a comment above, let me know how you want me to proceed. |
|
@wing328 FYI all tests passed. |
|
Merged. Thanks for the contribution. |
…OpenAPITools#15793) * fix(ktor-client): do not add jsonBlock if using kotlinx-serialization * update existing templates * add new kotlin-jvm-ktor-kotlinx_serialization * add new kotlin-jvm-ktor-kotlinx_serialization to samples-kotlin-client.yaml pipeline actually, kotlin-jvm-ktor-gson was duplicated, so I'm replacing the second one by kotlin-jvm-ktor-kotlinx_serialization * extra FILES entry in the template * enumUnknownDefaultCase=false for now since it's currently broken for ktor + kotlinx_serialization * use openapi 3 petstore
…OpenAPITools#15793) * fix(ktor-client): do not add jsonBlock if using kotlinx-serialization * update existing templates * add new kotlin-jvm-ktor-kotlinx_serialization * add new kotlin-jvm-ktor-kotlinx_serialization to samples-kotlin-client.yaml pipeline actually, kotlin-jvm-ktor-gson was duplicated, so I'm replacing the second one by kotlin-jvm-ktor-kotlinx_serialization * extra FILES entry in the template * enumUnknownDefaultCase=false for now since it's currently broken for ktor + kotlinx_serialization * use openapi 3 petstore
Fix for #15794
PR checklist
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.
master(6.3.0) (minor release - breaking changes with fallbacks),7.0.x(breaking changes without fallbacks)