Skip to content

Possibility to specify a method parameter name as it will be referred to by JsonRpc#51

Closed
rommar wants to merge 1 commit intoAstn:masterfrom
rommar:master
Closed

Possibility to specify a method parameter name as it will be referred to by JsonRpc#51
rommar wants to merge 1 commit intoAstn:masterfrom
rommar:master

Conversation

@rommar
Copy link
Contributor

@rommar rommar commented Jan 30, 2016

Hi! I think it would be useful to have a possibility to specify JsonRpc parameters names for the arguments of service method, so that method argument and JsonRpc parameter name can be different.

For example, the following JsonRpc invokation can be used

{"jsonrpc": "2.0",  "method": "Inc", "params": { "value": 5}, "id": 1}

to call a method defined like this:

[JsonRpcMethod]
public int Inc([JsonRpcParam("value")]int a)
{
    return a + 1;
}

@Astn
Copy link
Owner

Astn commented Mar 1, 2016

Great idea! Let me take a look, and I'll try to get it in soon.

@Astn
Copy link
Owner

Astn commented Mar 1, 2016

Looks like you need to add a few unit tests before we can merge this. But the code looks straight forward. 👍

@Astn
Copy link
Owner

Astn commented Mar 2, 2016

I moved some of your affected code to a file called ServiceBinder.

@rommar
Copy link
Contributor Author

rommar commented Mar 10, 2016

Closing this pull request, since I created another one for this (#58)

@rommar rommar closed this Mar 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants