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

CsvMapper now honors JsonProperty index. #159

Closed
wants to merge 1 commit into from

Conversation

nstdio
Copy link

@nstdio nstdio commented Nov 10, 2019

Resolves #115

@cowtowncoder
Copy link
Member

Thank you for submitting this! I will try to get this reviewed soon.

List<BeanPropertyDefinition> properties = beanDesc.findProperties();

// soring properties by @JsonProperty index
properties.sort(comparing(o -> intr.findPropertyIndex(ctxt.getConfig(), o.getPrimaryMember()),
Copy link
Member

@cowtowncoder cowtowncoder Nov 28, 2019

Choose a reason for hiding this comment

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

Jackson 2.x requires JDK 7, can not yet use JDK 8 features (but easy enough to change)

@cowtowncoder
Copy link
Member

Finally got back to this. Will use provided test, but also decided that this:

FasterXML/jackson-databind#2555

makes sense, to essentially try to use index in general (to avoid/reduce need for same code everywhere). Since there is some limited risk for breakage will do for 2.11 (and not in 2.10.2 patch). After getting databind done, will see if more work needed on CSV side or not.

@cowtowncoder
Copy link
Member

Turns out databind change does solve the problem, so I only had to merge test from here to verify that things now work. Thank you for contributing the test and proposed fix!

@cowtowncoder cowtowncoder added this to the 2.11.0 milestone Nov 28, 2019
@nstdio nstdio deleted the issue115 branch December 20, 2019 19:33
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.

JsonProperty index is not honored by CsvSchema builder
2 participants