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

Add support for @JsonbNillable #2254

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

jmini
Copy link
Contributor

@jmini jmini commented Dec 30, 2024

If you want the type-safe client to send an explicit null value to the server, you can do this:

    /**
     * Fixed due date for the work item.
     */
    @JsonbProperty(value = "dueDateFixed", nillable = true)
    private Date dueDateFixed;

This works fine as discussed in #2251 but the nillable attribute is deprecated in @JsonbProperty

This PR adds support for @JsonbNillable that can be used like this:

    /**
     * Fixed due date for the work item.
     */
    @JsonbNillable
    private Date dueDateFixed;

Fixes #2253

@jmini
Copy link
Contributor Author

jmini commented Dec 30, 2024

I do not see any tests for usage of @JsonbProperty on a model class, so I am not sure how I could add a regression-test case for this change in the library.

@jmartisk
Copy link
Member

jmartisk commented Jan 2, 2025

Thanks for this!

I do not see any tests for usage of @JsonbProperty on a model class, so I am not sure how I could add a regression-test case for this change in the library.

Yeah we don't have a test for it yet, but it would be cool to add it. I think the additional TCK would be a good place for it, plenty of tests under client/tck/src/main/java/tck/graphql/typesafe could serve as inspiration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JsonbProperty#nillable attribute is replaced by @JsonbNillable
2 participants