Skip to content
Closed
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 @@ -16,6 +16,9 @@

package com.palantir.conjure.java.api.errors;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.immutables.value.Value;
Expand All @@ -28,6 +31,9 @@
*/
@Value.Immutable
@ImmutablesStyle
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonSerialize(as = ImmutableErrorType.class)
@JsonDeserialize(as = ImmutableErrorType.class)
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need deserialization?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not that I know of, is there harm in allow it to be deserialized?

Copy link
Contributor

Choose a reason for hiding this comment

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

allow deserialization gives the impression that this is used as wire format, but that's not the case

public abstract class ErrorType {

private static final String UPPER_CAMEL_CASE = "(([A-Z][a-z0-9]+)+)";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@
* the (specific sub-) type of error, an optional set of named parameters detailing the error condition. Intended to
* transport errors through RPC channels such as HTTP responses.
*/
@JsonDeserialize(builder = SerializableError.Builder.class)
@JsonSerialize(as = ImmutableSerializableError.class)
@Value.Immutable
@Value.Style(visibility = Value.Style.ImplementationVisibility.PACKAGE)
@ImmutablesStyle
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonSerialize(as = ImmutableSerializableError.class)
@JsonDeserialize(builder = SerializableError.Builder.class)
public abstract class SerializableError implements Serializable {

/**
Expand Down