cognitect / cognitect/transit-java

It is not possible to override the default java.util.Map handler

Open
#31 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
65
Forks
23
PR merge metrics
No merged PRs in 30d

Description

In Clojure code:

(get
 (TransitFactory/writeHandlerMap {java.util.Map "foo bar"})
 java.util.Map)

yields the default map handler unchanged instead of an exception (which happens for java.util.List). This behavior worked with transit-clj 0.8.285. I have been using this for https://github.com/replikativ/incognito/ to serialize all unknown record types as special maps including tag information. Unfortunately the default-handler does not cover this case, because it is only triggered if the thing is unknown, while records are treated as maps by default.

Contributor guide

No contributing guide indexed for this repository

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 TransitFactory.writeHandlerMap and compare how java.util.Map and java.util.List handlers are resolved. Reproduce the Clojure example, then verify that supplying a java.util.Map handler returns the supplied handler rather than the default, while existing List behavior remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
clojure, java
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.