nakama-defold icon indicating copy to clipboard operation
nakama-defold copied to clipboard

Added unwrap flag

Open alexandrecurtelin opened this issue 4 years ago • 6 comments
trafficstars

Since Nakama v.2.7.0 an unwrap query parameter is supported which allows to invoke RPC functions with raw JSON data in the payload.

alexandrecurtelin avatar Mar 19 '21 15:03 alexandrecurtelin

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Mar 21 '21 17:03 CLAassistant

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Mar 21 '21 17:03 CLAassistant

Thank you for the contribution. The change you made was in generated code and would be overwritten the next time the API is generated. I wonder how the unwrap option is applied in other Nakama clients. @novabyte ?

britzl avatar Mar 24 '21 11:03 britzl

@britzl We don't really bother to use the unwrap=1 option in RPCs because the client SDKs can all handle the implicit escaped JSON necessary to send the data to the server (due to the constraints of Protobuf). If we do decide to expose the unwrap version of the RPC method it will probably be lifted to the client object type in the various SDKs and its implementation will not expect to be generated by the codegen tool. Hope this all makes sense.

novabyte avatar Mar 24 '21 21:03 novabyte

Thanks @novabyte . So you are saying that it doesn't make sense to add it to the API and instead let the client deal with it. @alexandrecurtelin does this make sense to you?

britzl avatar Mar 25 '21 05:03 britzl

@britzl My suggestion is to add a method directly to the nakama.lua module with the special overload for the version of RPC which uses unwrap rather than attempt to handle it within the codegen tool.

novabyte avatar Mar 25 '21 08:03 novabyte