Default value for optional parameters #109
Replies: 2 comments 4 replies
-
@and1helicopter If you are curious, I took a different approach. Instead of using |
Beta Was this translation helpful? Give feedback.
-
@and1helicopter Try out 5.1.5-beta.2 |
Beta Was this translation helpful? Give feedback.
-
Hello, I think it is necessary to add a default value for method parameters. And then we can set them to optional parameter
JsonRpc/src/EdjCase.JsonRpc.Router/RpcMethodInfo.cs
Lines 91 to 110 in f17eba0
Somthing, like that:
And then mapping all optional parameters, filling them with the default value
JsonRpc/src/EdjCase.JsonRpc.Router/Defaults/DefaultRpcInvoker.cs
Lines 273 to 293 in f17eba0
Like that:
In this case, we can omit optional parameters when requesting
Beta Was this translation helpful? Give feedback.
All reactions