kontent-ai / java-packages

Delivery Java SDK for Kontent.ai including examples for Spring, Gradle, Kotlin and Java Android app
https://kontent.ai/learn/tutorials/develop-apps/overview/?tech=java
MIT License
14 stars 28 forks source link

add @JsonIgnore to Element.parent #121

Closed connyduck closed 3 years ago

connyduck commented 3 years ago

Motivation

This makes it possible to serialize ContentItems with Jackson again (it breaks the circular reference chain). It helps with our custom caching solution.

Checklist

How to test

If manual testing is required, what are the steps?

Simply007 commented 3 years ago

hello @connyduck ,

I will take a look at it hopefully this week (mainly the consequences of the decorator). Could you describe what is your core issue?

Ideally, if you can add a test for this functionality - something like there is a JSON response from Kontent and I need to deserialize it to the model X and serialize it back.

connyduck commented 3 years ago

I added a test that crashes with Infinite recursion (StackOverflowError) without the annotation.

Simply007 commented 3 years ago

@connyduck - thanks for the pull request - it should be released in v4.3.1.