You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Server implementation converts params of request to array with order specified in my own open-rpc document.
I found this a little strange and inconsistent with behavior of client implementation (it is doesn't change params structure if i send params as object with fields).
It also does not allow to have same method interface between frontend and backend.
Altogether, why it is bad?:
Different client/server method interface, cannot be used in front/back monorepo
Cannot be used as drop-in replacement lib without breaking backward compatibility of current services
Under the hood params convertation magic
Describe alternatives you've considered
I could move all params under the user or data parent object, but [see 2nd clause]
Describe the solution you'd like
I would prefer global or method-by-method option to choose params structure
Option to choose preferred params structure
Choose params structure from open-rpc document methods[#].paramStructure (breaking current behavior)
Additional context
Example:
interfaceCreateUserParams{name: string;age: number;// many other fields}// Client side:classUserService{client: Client;// open-rpc clientcreate(params: CreateUserParams){this.client.request({method: "users.create",params: params});}}// Server side:classUserService{create(params: CreateUserParams){console.log(params.name,params.age);}}constuserService=newUserService();constmethodMapping={"users.create": userService.create.bind(userService)};
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Server implementation converts params of request to array with order specified in my own open-rpc document.
I found this a little strange and inconsistent with behavior of client implementation (it is doesn't change params structure if i send params as object with fields).
It also does not allow to have same method interface between frontend and backend.
Altogether, why it is bad?:
Describe alternatives you've considered
I could move all params under the
user
ordata
parent object, but [see 2nd clause]Describe the solution you'd like
I would prefer global or method-by-method option to choose params structure
methods[#].paramStructure
(breaking current behavior)Additional context
Example:
The text was updated successfully, but these errors were encountered: