Closed ivy-rew closed 7 months ago
can you check this open-rpc inspector fix @shanejonas ?
It seems there's a misunderstanding about rpc.discover
. The link you mentioned actually outlines the OpenRPC method description for service discovery. It's meant to return the OpenRPC document directly, detailing the service's API. Here’s what it looks like in action:
--> {"jsonrpc": "2.0", "method": "rpc.discover", "params": [], "id": 1}
<-- {"jsonrpc": "2.0", "result": {"info": {}, "methods": [], "components": {}}, "id": 1}
This shows the direct retrieval of the OpenRPC document.
It seems there's a misunderstanding about
rpc.discover
. The link you mentioned actually outlines the OpenRPC method description for service discovery. It's meant to return the OpenRPC document directly, detailing the service's API. Here’s what it looks like in action:--> {"jsonrpc": "2.0", "method": "rpc.discover", "params": [], "id": 1} <-- {"jsonrpc": "2.0", "result": {"info": {}, "methods": [], "components": {}}, "id": 1}
This shows the direct retrieval of the OpenRPC document.
Thanks a lot for your explanation @shanejonas. Now I see that I got the concept wrong and as I couldn't quickly find a real-world example with the 'rpc.discover' method implemented, so I invented one with my confused understanding :sweat_smile:
However, for my service it would make things a little easier if I could defer the service description. I assumed that deferred external schema refs are always allowed just as they are in json-schema in general. :thinking:
--> {"jsonrpc": "2.0", "method": "rpc.discover", "params": [], "id": 1}
<-- {"jsonrpc": "2.0", "result": {"$ref": "https://json-schema.axonivy.com/openrpc/11.3.0/inscription.json"}, "id": 1}
my change isn't foreseen in the openrpc spec, so it makes no sense to add it.
fixes https://github.com/open-rpc/inspector/issues/331