Skip to content
Draft
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
@@ -1,6 +1,6 @@
/**
*
* Copyright 2016-2017, 2019, Optimizely and contributors
* Copyright 2016-2017, 2019, 2025, Optimizely and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,13 +19,13 @@
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.fasterxml.jackson.databind.PropertyNamingStrategies;

class JacksonSerializer implements Serializer {

private ObjectMapper mapper =
new ObjectMapper().setPropertyNamingStrategy(
PropertyNamingStrategy.SNAKE_CASE);
PropertyNamingStrategies.SNAKE_CASE);

public <T> String serialize(T payload) {
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
*
* Copyright 2016-2017, 2019, Optimizely and contributors
* Copyright 2016-2017, 2019, 2025, Optimizely and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -18,7 +18,7 @@

import com.fasterxml.jackson.databind.ObjectMapper;

import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.fasterxml.jackson.databind.PropertyNamingStrategies;
import com.optimizely.ab.event.internal.payload.EventBatch;

import org.junit.Test;
Expand All @@ -42,7 +42,7 @@ public class JacksonSerializerTest {
private JacksonSerializer serializer = new JacksonSerializer();
private ObjectMapper mapper =
new ObjectMapper().setPropertyNamingStrategy(
PropertyNamingStrategy.SNAKE_CASE);
PropertyNamingStrategies.SNAKE_CASE);


@Test
Expand Down