Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

package kentico.kontent.delivery;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
Expand Down Expand Up @@ -96,6 +97,7 @@ public abstract class Element<T> {
* @param parent the parent to this
* @return the parent to this
*/
@JsonIgnore
ContentItem parent;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,19 @@ public void testContentItemDeserialization() throws IOException {

}

@Test
public void testContentItemSerialization() throws IOException {
ContentItemResponse response = objectMapper.readValue(
this.getClass().getResource("SampleContentItem.json"), ContentItemResponse.class);

String serializedContentItemResponse = objectMapper.writeValueAsString(response);

ContentItemResponse response2 = objectMapper.readValue(
serializedContentItemResponse, ContentItemResponse.class);

Assert.assertEquals(response, response2);
}

@Test
public void testContentTypeListDeserialization() throws IOException {
ContentTypesListingResponse response = objectMapper.readValue(
Expand Down