The % proc specifying how Enum should be converted to JSON doesn't work, why, and how to make it work?
import json, re
type SomeEnum* = enum SomeName, OtherName
func `%`*(s: SomeEnum): JsonNode = %(($s).replace(re"Name$", ""))
echo %SomeName
echo @[SomeName]
Would produce
"Some"
@[SomeName]
What do you mean it doesn't work?
import json
type SomeEnum* = enum SomeName, OtherName
echo %SomeName
Outputs "SomeName" as you would expect (well, you might expect 0 instead, but who knows).
Yes, sorry, it works ok, my bad, please delete this question.
P.S. I created simplified test case from some more complicated code and missed the % operator in this line echo %(@[SomeName]) didn't noticed it.