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

[client] support optional input for kotlinx serialization #1250

Merged
merged 2 commits into from
Aug 30, 2021

Conversation

dariuszkuc
Copy link
Collaborator

📝 Description

It appears that using @Required annotation works on serialization and deserialization (https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/basic-serialization.md#required-properties) giving us the correct behavior for handling optional input.

This PR also cleans up corresponding serialization tests to ensure we have consistent serialization between Jackson and Kotlinx Serialization.

🔗 Related Issues

Resolves: #1151

It appears that using `@Required` annotation works on serialization and deserialization (https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/basic-serialization.md#required-properties) giving us the correct behavior for handling optional input.

This PR also cleans up corresponding serialization tests to ensure we have consistent serialization between Jackson and Kotlinx Serialization.

Resolves: ExpediaGroup#1151
@dariuszkuc dariuszkuc added changes: patch Changes require a patch version module: client Issue affects the client code labels Aug 25, 2021
JaCoCo already filters Kotlin auto generated code by checking for the line numbers. It appears it does not work for static methods and since `kotlinx.serialization` does not apply `@Generated` annotation (another JaCoCo mechanism to skip analysis), auto generated `write\$Self` static method is included in coverage which singificantly lowers the code coverage.

See Kotlin/kotlinx.serialization#961 for details
@smyrick smyrick merged commit c1ab056 into ExpediaGroup:master Aug 30, 2021
@dariuszkuc dariuszkuc deleted the client_kotlinx_optional branch September 3, 2021 17:55
dariuszkuc added a commit to dariuszkuc/graphql-kotlin that referenced this pull request Aug 5, 2022
…up#1250)

* [client] support optional input for kotlinx serialization

It appears that using `@Required` annotation works on serialization and deserialization (https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/basic-serialization.md#required-properties) giving us the correct behavior for handling optional input.

This PR also cleans up corresponding serialization tests to ensure we have consistent serialization between Jackson and Kotlinx Serialization.

Resolves: ExpediaGroup#1151

* lower code coverage from auto generated code

JaCoCo already filters Kotlin auto generated code by checking for the line numbers. It appears it does not work for static methods and since `kotlinx.serialization` does not apply `@Generated` annotation (another JaCoCo mechanism to skip analysis), auto generated `write\$Self` static method is included in coverage which singificantly lowers the code coverage.

See Kotlin/kotlinx.serialization#961 for details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changes: patch Changes require a patch version module: client Issue affects the client code
Development

Successfully merging this pull request may close these issues.

[client] support optional undefined arguments
2 participants