Can a custom RPC return data that isn't wrapped in the standard response structure?

When I return data from a custom rpc, like this example:

func CustomRPC(ctx context.Context, logger runtime.Logger, db *sql.DB, nk runtime.NakamaModule, payload string) (string, error) {
	// ...

	return fmt.Sprintf("{\"ResultCode\": 1, \"UserId\": \"%s\"}", userID), nil
}

The actual raw response string from the api is:

{
    "body": "{\"ResultCode\": 1, \"UserId\": \"...\"}",
    "error_message": ""
}

Can I customize the RPC to return the value non-wrapped?

{
  "ResultCode": 1,
  "UserId": "..."
}

Basically, I need to implement a custom endpoint that an external service needs to use. That service requires a very specific response format.

Hello @wbronchart,

You can add query param unwrap=true to the Nakama custom RPC request it’ll unwrap the payload in the response.

Hope this helps.

That worked, thank you!