-
-
Notifications
You must be signed in to change notification settings - Fork 7.1k
[kotlin][KTOR] remove unnecessary dependencies #13640
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][KTOR] remove unnecessary dependencies #13640
Conversation
6.1.0-SNAPSHOT |
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.
thanks for the PR.
looks like you're not using the latest master, can you please merge the latest master into your branch and regenerate the samples?
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.
I've updated, but I have a problem with generating samples.
It's failing on kotlin-default-values-*
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.
ok, I figured out what's the problem with the generator. I was running on Java 17 which failed to build the generator.
Maybe it would be helpful to have it scripted or have this in a container with all JVM stuff preset.
Anyways. pushed the new samples with the right version :)
@@ -199,8 +201,10 @@ import {{packageName}}.auth.* | |||
} | |||
this.method = requestConfig.method.httpMethod | |||
headers.filter { header -> !UNSAFE_HEADERS.contains(header.key) }.forEach { header -> this.header(header.key, header.value) } | |||
if (requestConfig.method in listOf(RequestMethod.PUT, RequestMethod.POST, RequestMethod.PATCH)) | |||
if (requestConfig.method in listOf(RequestMethod.PUT, RequestMethod.POST, RequestMethod.PATCH)) { | |||
contentType(Json) |
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.
Is it correct to say that "application/json" becomes the default content type if it's not specified in the spec (e.g. 2.0) ?
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.
So I checked the source code and in fact both serializers (gson and jackson) set json as the default content type.
I reverted the changes only leaving the fix to ktor client. There were imports that no longer present and the nullable property that was already fixed in the multiplatform version.
a46b82f
to
18f1eef
Compare
samples revert content type
18f1eef
to
6dcd731
Compare
@wing328 can we merge this PR? |
@Marek00Malik can you please take a look at the error in https://github.com/OpenAPITools/openapi-generator/actions/runs/3244612257/jobs/5321013628 ? |
Hey @wing328. Samples fixed |
Fix that addresses the issue discussed in PR nr #12966. Adding missing
ContentType
header with JSON value.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.1.0) (minor release - breaking changes with fallbacks),7.0.x
(breaking changes without fallbacks)