mirror of
https://github.com/logos-storage/nim-json-rpc.git
synced 2026-05-22 18:39:31 +00:00
Follow the convention of naming types as UpperCase
This commit is contained in:
parent
6f9da4ba8a
commit
9b401994a1
@ -227,15 +227,15 @@ macro rpc*(server: RpcRouter, path: string, body: untyped): untyped =
|
|||||||
procBody = if body.kind == nnkStmtList: body else: body.body
|
procBody = if body.kind == nnkStmtList: body else: body.body
|
||||||
|
|
||||||
if parameters.hasReturnType:
|
if parameters.hasReturnType:
|
||||||
let returnType = parameters[0]
|
let ReturnType = parameters[0]
|
||||||
|
|
||||||
# delegate async proc allows return and setting of result as native type
|
# delegate async proc allows return and setting of result as native type
|
||||||
result.add quote do:
|
result.add quote do:
|
||||||
proc `doMain`(`paramsIdent`: JsonNode): Future[`returnType`] {.async.} =
|
proc `doMain`(`paramsIdent`: JsonNode): Future[`ReturnType`] {.async.} =
|
||||||
`setup`
|
`setup`
|
||||||
`procBody`
|
`procBody`
|
||||||
|
|
||||||
if returnType == ident"JsonNode":
|
if ReturnType == ident"JsonNode":
|
||||||
# `JsonNode` results don't need conversion
|
# `JsonNode` results don't need conversion
|
||||||
result.add quote do:
|
result.add quote do:
|
||||||
proc `procName`(`paramsIdent`: JsonNode): Future[JsonNode] {.async, gcsafe.} =
|
proc `procName`(`paramsIdent`: JsonNode): Future[JsonNode] {.async, gcsafe.} =
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user