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 @include and @skip directives #1341

Merged
merged 4 commits into from
Jan 14, 2022

Conversation

dariuszkuc
Copy link
Collaborator

📝 Description

Update client generator logic to handle @skip and @include directives. If directives are specified they will override nullability of the underlying field to always be nullable.

🔗 Related Issues

Supersedes: #1327
Resolves: #1282

@dariuszkuc dariuszkuc added changes: patch Changes require a patch version module: client Issue affects the client code module: plugin Issue affects the plugins code labels Jan 13, 2022
@dariuszkuc
Copy link
Collaborator Author

Interestingly, when testing out the change with kotlinx.serialization, I hit an issue with a compiler plugin when both kotlinx.serialization and Spring plugins are applied on a project. See https://kotlinlang.slack.com/archives/C7L3JB43G/p1642036809053200 for details.

Dariusz Kuc added 2 commits January 13, 2022 01:05
When using `@skip`/`@include` directives underlying fields will not be available in the response (as opposed to be `null`). This breaks `kotlinx.serialization` (Jackson defaults to null) as it requires some default value to be present.
assertNotNull(UUID.fromString(simpleResponse))

val included = response.data?.included
assertNull(included)
Copy link
Member

Choose a reason for hiding this comment

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

👍🏼

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 module: plugin Issue affects the plugins code
Development

Successfully merging this pull request may close these issues.

[client] support query directives
3 participants