Skip to content

Commit

Permalink
Deprecate APIs exposing Jackson (#39563)
Browse files Browse the repository at this point in the history
Deprecate APIs exposing Jackson
  • Loading branch information
alzimmermsft authored Apr 9, 2024
1 parent d0a89b4 commit dc8f815
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public final class AzureJacksonAdapter extends JacksonAdapter {
/**
* Creates an instance of the Azure flavored Jackson adapter.
*/
@SuppressWarnings("deprecation")
public AzureJacksonAdapter() {
super((outerMapper, innerMapper) -> outerMapper
.registerModule(ManagementErrorDeserializer.getModule(innerMapper)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import com.azure.json.JsonOptions;
import com.azure.json.JsonReader;
import com.azure.json.JsonWriter;
import com.fasterxml.jackson.core.JsonGenerator;

import java.io.ByteArrayInputStream;
import java.io.IOException;
Expand Down Expand Up @@ -127,7 +126,7 @@ private static com.google.gson.stream.JsonWriter createGsonWriter(Writer writer,
* Creates an instance of {@link GsonJsonWriter}.
*
* @param writer The {@link com.google.gson.stream.JsonWriter} writing JSON.
* @return A {@link GsonJsonWriter} wrapping the {@link JsonGenerator}.
* @return A {@link GsonJsonWriter} wrapping the {@link com.google.gson.stream.JsonWriter}.
*/
public static JsonWriter createWriter(com.google.gson.stream.JsonWriter writer) {
return new GsonJsonWriter(writer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,10 @@ public JacksonAdapter() {
*
* @param configureSerialization Applies additional configuration to outer mapper using inner mapper for module
* chaining.
* @deprecated This API will be removed in the future. Please use {@link #createDefaultSerializerAdapter()} if you
* need to use JacksonAdapter.
*/
@Deprecated
public JacksonAdapter(BiConsumer<ObjectMapper, ObjectMapper> configureSerialization) {
Objects.requireNonNull(configureSerialization, "'configureSerialization' cannot be null.");
this.headerMapper = ObjectMapperShim.createHeaderMapper();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* Tests for {@link Option} that can represent tri-sate (non-null-value, null-value, or no-value).
*/
public class OptionSerializerTests {
@SuppressWarnings("deprecation")
private static final JacksonAdapter ADAPTER
= new JacksonAdapter((outerMapper, innerMapper) -> outerMapper.registerModule(new OptionModule()));

Expand Down

0 comments on commit dc8f815

Please sign in to comment.