Skip to content
This repository has been archived by the owner on Feb 12, 2021. It is now read-only.

The JSON-RPC 2.0 Specification #113

Closed
duurland opened this issue Dec 30, 2019 · 1 comment
Closed

The JSON-RPC 2.0 Specification #113

duurland opened this issue Dec 30, 2019 · 1 comment
Labels
bug Something isn't working

Comments

@duurland
Copy link

In the docs it's said that Wox use the JSON-RPC Spec to communicate with its plugins, however, it doesnt seem to actually follow the specification.

A valid request to a plugin, according to the spec, looks like this

{
    "jsonrpc": "2.0",
    "method": "query",
    "params": ["hello world"],
    "id": 1
}

This is the payload our plugins currently get from Wox

{
    "method": "query",
    "parameters": ["hello world"],
}

The only part Wox actually got right is the method key.

jsonrpc: While I can see why this can be omitted, I don't think it's a bad idea to be explicit about what protocol is being used when communicating with other plugins/processes, specially for future backward compatibility.

params: The specs and Woxs doc both mention the params key for the parameters, but for some reason the actual payload use parameters instead.

id: All requests that expects a response (ie the query function) should include an ID, which should also be sent back in the response along with the result. This is currently omitted.

The specs also mention an error key in our response, but as far as I can tell that data is also being ignored.

@jjw24 jjw24 added the bug Something isn't working label Jan 7, 2020
@jjw24
Copy link
Owner

jjw24 commented Dec 31, 2020

Just going to close this as this repo is no longer maintained, feel free to open the issue in Flow if this is still a problem

@jjw24 jjw24 closed this as completed Dec 31, 2020
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants