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

update ktor multiplatform serialization issue #14045

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Marek00Malik
Copy link
Contributor

@Marek00Malik Marek00Malik commented Nov 16, 2022

update ktor multiplatform serialization issue - #14044

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/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 [@jimmidyson, @dr4ke616 @karismann @Zomzog @andrewemery @4brunu @yuantao-yin ]

@wing328
Copy link
Member

wing328 commented Nov 29, 2022

@Marek00Malik thanks for the PR. Can you please resolve the merge conflicts when you've time?

@Marek00Malik
Copy link
Contributor Author

@wing328 sorry for the delay, I'm on holiday and didn't notice your message.

On the side, I noticed the upgrade of Kotlin to 1.7.21 which is an excellent idea. But I think it could also be a good idea to add this information in the release notes as this requires some action on the consumer side as well. Currently, the website related to the Kotlin client generator is still mentioning Ktor 1.6.8 and there isn't any were any note on what version of Kotlin this generator is compiled in.
https://openapi-generator.tech/docs/generators/kotlin

update ktor multiplatform serialization issue
Samples & fixes to missing libraries in Ktor versions
@Marek00Malik Marek00Malik force-pushed the fix/kotlin-multiplatform-fix-serialization branch from aebf7d5 to 81d809e Compare January 8, 2023 12:12
@Marek00Malik
Copy link
Contributor Author

@wing328 I've pushed the changes on top of the latest master (thus the force push).
As a side note, I've identified that the default JSON mappers do not support all date classes at times, for example for OffsetDateTime adapter is not added in all versions of the implementation for Kotlin (this is why the update).

I will raise this as a separate issue and push tests to Ktor implementations and the Jackson/Gson ones. I also found that if we use Unit as a return response, Moshi has problems deserializing this into a Kotlin type.

@wing328 wing328 modified the milestones: 6.3.0, 6.3.1 Jan 20, 2023
@wing328 wing328 modified the milestones: 6.4.0, 6.5.0 Feb 19, 2023
@wing328 wing328 modified the milestones: 6.5.0, 6.6.0 Apr 1, 2023
@ludovicroland
Copy link

Would it be possible to get this merged in?

The milestone is changed at each release :(

@wing328 wing328 modified the milestones: 6.6.0, 7.0.0 May 11, 2023
@wing328
Copy link
Member

wing328 commented Aug 6, 2023

@Marek00Malik thanks for the PR. Can you please PM me via Slack to discuss this further?

https://join.slack.com/t/openapi-generator/shared_invite/zt-12jxxd7p2-XUeQM~4pzsU9x~eGLQqX2g

Sorry for the delay in reviewing this as there are too many PRs

@wing328 wing328 modified the milestones: 7.0.0, 7.0.1 Aug 25, 2023
@wing328 wing328 modified the milestones: 7.0.1, 7.1.0 Sep 20, 2023
@@ -154,6 +155,7 @@ 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)) {
this.contentType(Application.Json)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason for not using the following code to support different content types?

                val contentType = (requestConfig.headers[HttpHeaders.ContentType]?.let { ContentType.parse(it) }
                    ?: ContentType.Application.Json)
                this.contentType(contentType)

This was used before ktor was broken by #12966

@wing328 wing328 modified the milestones: 7.1.0, 7.2.0 Nov 13, 2023
@wing328 wing328 modified the milestones: 7.2.0, 7.3.0 Dec 22, 2023
@wing328 wing328 modified the milestones: 7.3.0, 7.4.0 Feb 8, 2024
@wing328 wing328 modified the milestones: 7.4.0, 7.5.0 Mar 11, 2024
@wing328 wing328 modified the milestones: 7.5.0, 7.6.0 Apr 17, 2024
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.

None yet

4 participants