nestjs / nest

A progressive Node.js framework for building efficient, scalable, and enterprise-grade server-side applications with TypeScript/JavaScript 🚀
https://nestjs.com
MIT License
68.19k stars 7.67k forks source link

Add OpenRPC support #4844

Closed shanejonas closed 4 years ago

shanejonas commented 4 years ago

Feature Request

Describe the solution you'd like

I think this project could benefit from integration with OpenRPC which provides a base foundation for service discovery and tooling such as documentation/client generation/mock server for JSON-RPC akin to OpenAPI/Swagger.

Here is an example of the OpenRPC playground, it gets the OpenRPC Document via calling the rpc.discover method:

https://playground.open-rpc.org/?url=https://mock.open-rpc.org/petstore-1.0.0

and just the bare inspector: https://inspector.open-rpc.org/?url=https://mock.open-rpc.org/petstore-1.0.0

Let me know how I can help.

Teachability, Documentation, Adoption, Migration Strategy

image image

What is the motivation / use case for changing the behavior?

Read more about the advantages of OpenRPC vs Swagger.

kamilmysliwiec commented 4 years ago

We don't plan to release a dedicated package for the OpenRPC. We encourage anyone who is interested in contributing to the ecosystem to give it a shot and maybe release as a community package. For reflecting & generating data models, the @nestjs/swagger can be used (at least as a reference implementation)