Why json hooks doesn't work for CountTable[int]
Looks like it's because std/jsonutils.toJsonHook for tables only accepts those with strings for keys. Converting the keys to strings when building the table should work: proc toJsonHook*[K](t: CountTable[K]): JsonNode = var t2: Table[string, int] for k, v in t: t
Why json hooks doesn't work for CountTable[int]
The JSON serialisation hooks work for `CountTable[string]` but not for `CountTable[int]`, why?