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 record support #163

Merged
merged 20 commits into from
Jul 1, 2024
Merged

Conversation

TomaszGaweda
Copy link
Contributor

@TomaszGaweda TomaszGaweda commented Jun 27, 2024

This PR adds Java 17's record support.

This is an improved version of #148

It supports different property order, nesting and nulls.

Closes #162

@TomaszGaweda
Copy link
Contributor Author

@cowtowncoder Sorry for being quiet some time, I had a lot of things on my head.

This is the corrected version of previous PR, sorry for the delay!

jr-objects/pom.xml Outdated Show resolved Hide resolved
@cowtowncoder
Copy link
Member

@TomaszGaweda Thank you very much for follow up here! This looks very good, but I want to take time to properly review this later today. Just wanted to give quick notes first.

I really like the idea of getting full Record support for jackson-jr 2.18!

@TomaszGaweda
Copy link
Contributor Author

Thank you for your patience. I know I f..ked up last time, sorry for that... Hopefully this time it's actually a good PR. Take your time, I definetely don't want to rush it or shout "faster, faster!" at you ;)

@cowtowncoder
Copy link
Member

@TomaszGaweda no problem at all -- I failed to detect the obvious case. We should be all good now.

@Shounaks
Copy link
Contributor

Thanks for the PR @TomaszGaweda, this was the missing item i required, 2.18 looks like I can finally swap out Jackson for Jackson-jr (for my hobby projects) 🥳🥳, and maybe then even in prod.

@cowtowncoder cowtowncoder modified the milestones: 2.18., 2.18.0 Jun 30, 2024
// too, regardless of `Feature.USE_FIELD_MATCHING_GETTERS`
final boolean isFieldNameGettersEnabled = JSON.Feature.USE_FIELD_MATCHING_GETTERS.isEnabled(features)
|| RecordsHelpers.isRecordType(currType);
final boolean isFieldNameGettersEnabled = JSON.Feature.USE_FIELD_MATCHING_GETTERS.isEnabled(features);
Copy link
Member

Choose a reason for hiding this comment

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

Probably accidental change; will revert.

@cowtowncoder
Copy link
Member

cowtowncoder commented Jun 30, 2024

Getting there @TomaszGaweda . One thing I noticed is that handling of 1-parameter constructor is before Record constructors; should probably change order and, more importantly, verify that such Records (with a single String, int or long parameter) work.

I also made some changes I did to the earlier PR.

EDIT: added tests and changed handling to work as expected.

Copy link
Member

@cowtowncoder cowtowncoder left a comment

Choose a reason for hiding this comment

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

Ok made couple of changes, I think it's ready to merge.

@cowtowncoder cowtowncoder merged commit 26379a6 into FasterXML:2.18 Jul 1, 2024
4 checks passed
@TomaszGaweda
Copy link
Contributor Author

Thanks a lot @cowtowncoder for your support and fixes! I was off on the weekend, so unfortunatelly didn't see comments before you've addressed them yourself ;p

@cowtowncoder
Copy link
Member

@TomaszGaweda did not expect you to -- but I happened to have time :)

Thank you once again for contributing this: it's a big formerly missing piece that will be pretty valuable.

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

Successfully merging this pull request may close these issues.

Add support for deserializing Java Records
3 participants