Skip to content

Commit a1bfbe8

Browse files
committed
add renameHook while looking for the discriminatorFieldName
1 parent 907bd3c commit a1bfbe8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/jsony.nim

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,8 @@ proc parseHook*[T: object|ref object](s: string, i: var int, v: var T) =
301301
var key: string
302302
parseHook(s, i, key)
303303
eatChar(s, i, ':')
304+
when compiles(renameHook(v, key)):
305+
renameHook(v, key)
304306
if key == v.discriminatorFieldName:
305307
var discriminator: type(v.discriminatorField)
306308
parseHook(s, i, discriminator)

0 commit comments

Comments
 (0)