Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request / Question: JSONRPC2 #4274

Open
joeblew99 opened this issue Nov 28, 2016 · 5 comments
Open

Feature Request / Question: JSONRPC2 #4274

joeblew99 opened this issue Nov 28, 2016 · 5 comments

Comments

@joeblew99
Copy link

this is not a bug, but a question.

Is there currently a way to code gen a JSONRPC2 client from swagger ?
i am interested in the Dart client.

thanks in advance, or if i should ask this somewhere else please let me know.

@wing328 wing328 added this to the v2.2.2 milestone Nov 29, 2016
@wing328
Copy link
Contributor

wing328 commented Nov 29, 2016

Not that I'm aware of but you can always customize the templates for Dart and pass it via the -t option.

@cbornet
Copy link
Contributor

cbornet commented Nov 29, 2016

Swagger can certainly describe the outer structure of JSON-RPC (id, method, params fields, etc...) but I think it will be hard to describe the methods themselves since they are described in body objects ("SOAP" style) where swagger is oriented towards path objects ("REST" style). For instance it will be hard to link a method request (which would be a model) to its corresponding method result (another model).

@joeblew99
Copy link
Author

@cbornet i see what you mean. Basically, if i get this, denormalisation of the structure between REST and RPC is just too different and so reconstruction is just too much work. In other words it is not the right approach.

I actually want to have a REST / JSON API and a JSONRPC2 API running at the gateway level
Both of which map to the GRPC service behind the gateway.

I was looking at the GRPC code and the JSONRPC2 code and they are almost identical in many ways. SO i am not thinking that code generating from GRPC to JSONRPC2 should have nothing to do with swagger. I need to find / write a code gen just for this.

Let me knwo what you think if you get time.

@wing328 wing328 modified the milestones: Future, v2.2.2 Feb 16, 2017
@ppKrauss
Copy link

ppKrauss commented Mar 12, 2017

Hi @cbornet , perhaps "JSONRPC2 envelope" is a good suggestion to add into OpenAPI v3...
The envelope is a simple discipline and way to standardize asynchronous request-ID, versions, etc. at input params, and error messages, etc. at output result. How to suggest it there?

Perhaps changes to flexiblize a little bit the params envelop structure, OpenAPI also will create the JSONRPC v3 :-)


PS: for general. I think there are no conflict between REST and "JSON RPC envelope", JsonRPC-REST exist, and is like to old SOAP-REST.

@wing328
Copy link
Contributor

wing328 commented Mar 13, 2017

@joeblew99 please join the discussion in the Swagger Spec repo: OAI/OpenAPI-Specification#664

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants