Is it just me or should RPC mechanism be reflective? Why don't we have a standard where we can have a generic client that we can point at an endpoint and the client should grab all the RPCs, their inputs, outputs, etc.
And yeah, swagger, but its' external to the API. And GQL is not RPC.
And yeah, swagger, but its' external to the API. And GQL is not RPC.
Comments
Feeding that into Scalar gives a _very nice_ API doc experience as well.
Definitely not "the dream" but it's pretty close!
That could just be my anecdotal experience though.
My end-game RPC lib would have the TanStack Server Function API but with the ability of publishing client libs.
That way a client library could just consume that once and generate bindings at either build or runtime.
And API development tooling (e.g. postman) could consume it and allow manual or automated testing, etc.
I'm pretty sure I worked on a system that used JSON-RPC and had a method that would return a list of all the exposed methods. Don't think it's in the spec.
For whatever reason efforts to formalize common things like this have not succeeded on the web. Look at auth.
https://www.odata.org/
I think Excel can read and use any OData API
https://grpc.io/docs/guides/reflection/
(There is a high chance your security team will ask you to turn off reflection though haha)