Skip to content

switching to Jackson Json parser#155

Merged
SomkaPe merged 3 commits intodevfrom
pesomka/jakson
Dec 26, 2019
Merged

switching to Jackson Json parser#155
SomkaPe merged 3 commits intodevfrom
pesomka/jakson

Conversation

@SomkaPe
Copy link
Copy Markdown
Contributor

@SomkaPe SomkaPe commented Dec 20, 2019

#12

Copy link
Copy Markdown
Contributor

@sangonzal sangonzal left a comment

Choose a reason for hiding this comment

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

Looks good. Just a couple of comments.

static ObjectMapper mapper = new ObjectMapper()
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);

static <T> T convertJsonToObject(final String json, final Class<T> clazz) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Are you able to use JsonHelper here? Would avoid having duplicate code

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

will have to make it public

@@ -0,0 +1 @@
lombok.anyConstructor.addConstructorProperties=true No newline at end of file
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'd prefer to have the annotations and constructor than an extra config file.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

adding those constructors might be very error prone because it should depend on json properties - so when you add new or remove json property you also need update constructor and keep in in sync

@SomkaPe SomkaPe changed the title switching to Jakson Json parser switching to Jackson Json parser Dec 26, 2019
@SomkaPe SomkaPe merged commit 290d655 into dev Dec 26, 2019
@sangonzal sangonzal deleted the pesomka/jakson branch January 22, 2020 20:37
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.

2 participants