palantir / palantir/conjure-java

[http-remoting] Serialize Conjure error parameters to JSON rather than with Objects.toString()

Open
#1,812 8 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

wire format
Dominant language
Java
Stars
39
Forks
49
Avg merge
8h 22m
Merged PRs (30d)
32

Description

Currently in Java implementation error parameters are serialized with Objects.toString() (see SerializableError.forException(ServiceException exception)).
This leads to different formatting of the same error depending on the language used for the error implementation.

I suggest serializing parameters (safe/unsafe error arguments) as JSON - this representation is consistent across languages because parameters are Conjure types.
This way it is also possible to deserialize parameter back into proper Conjure type.

Posting here given this should be expected behavior for all Conjure implementation.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at SerializableError.forException(ServiceException exception), where the Java implementation currently serializes safe and unsafe error arguments with Objects.toString(). Trace how these parameters are represented by the HTTP remoting implementation and identify the relevant tests. Done means parameters use consistent JSON representation and can be deserialized back into their Conjure types.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.