Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-string error arg values are serialized to JSON strings instead of JSON objects #252

Open
fmance opened this issue May 28, 2019 · 0 comments

Comments

@fmance
Copy link

fmance commented May 28, 2019

What happened?

Serializing a ServiceException with a non-string object as the value of an Arg serializes the value of the arg as a JSON string instead of a proper JSON object (seems to happen in SerializableError.forException where the toString representation of the object is used, as opposed to the proper JSON object) - for example SafeArg.of("param", ImmutableList.of("arg1", "arg2"))

This is a problem since it's a mismatch between what the consumer of the exception expects (JSON object) and the actual JSON value (JSON string containing the toString representation of the object)

What did you want to happen?

Convert the safe-arg value to a proper JSON object, since that is what the consumer code expects.

@fmance fmance changed the title Collection-based error arg values are serialized to strings Non-string error arg values are serialized to strings May 28, 2019
@fmance fmance changed the title Non-string error arg values are serialized to strings Non-string error arg values are serialized to JSON strings instead of JSON objectsa May 28, 2019
@fmance fmance changed the title Non-string error arg values are serialized to JSON strings instead of JSON objectsa Non-string error arg values are serialized to JSON strings instead of JSON objects May 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant