cartesi / machine-emulator

The off-chain implementation of the Cartesi Machine
GNU Lesser General Public License v3.0
58 stars 32 forks source link

Trailing comma in JSON #198

Closed guidanoli closed 4 months ago

guidanoli commented 4 months ago

Context

On a recent discussion in the #machine Discord channel, it came to my attention the existence of a JSON RPC discovery file.

Expected behavior

I expected this JSON file to be well-formed.

Actual behavior

This JSON file contains a trailing comma at line 1651.

https://github.com/cartesi/machine-emulator/blob/67ee8ea521e687b2b8846f0189e6121eec63d146/src/jsonrpc-discover.json#L1649-L1652

Steps to reproduce

cat src/jsonrpc-discover.json | jq

You should see the following error:

parse error: Expected another key-value pair at line 1652, column 9

Tested with jq version 1.6.

Environment

Possible solutions

Remove the trailing comma.