mojira.dev
MC-301706

Server Management Protocol does not support parameters as object (by-name)

From the JSON RPC 2.0 spec:

If present, parameters for the rpc call MUST be provided as a Structured value. Either by-position through an Array or by-name through an Object.

  • by-position: params MUST be an Array, containing the values in the Server expected order.

  • by-name: params MUST be an Object, with member names that match the Server expected parameter names. The absence of expected names MAY result in an error being generated. The names MUST match exactly, including case, to the method's expected parameters.

The current implementation does not allow “by-name” parameters but only “by-position” parameters.

>>> {"jsonrpc":"2.0","method":"minecraft:allowlist/set","params":{"players":[]},"id":1}
<<< {"jsonrpc":"2.0","id":1,"error":{"code":-32602,"message":"Invalid params","data":"Expected params array with exactly one element"}}
>>> {"jsonrpc":"2.0","method":"minecraft:allowlist/set","params":[[]],"id":1}
<<< {"jsonrpc":"2.0","id":1,"result":[]}

Comments 0

No comments.

tert0

Jonatan

Confirmed

Platform

Normal

Dedicated Server

25w35a, 25w36a, 25w36b, 25w37a, 1.21.9 Pre-Release 1

1.21.9 Pre-Release 2

Retrieved