Closed nuel77 closed 2 years ago
The toJSON
is meant to be used in the RPC to communicate with Substrate, so it always conforms to the way the JSON RPC is laid out. In all cases, the Substrate has the camelCase
serde attribute for JSONRPC formatting, see e.g. https://github.com/paritytech/substrate/blob/fa778cc1187e37bbab132293ddbbb20158139ea5/primitives/runtime/src/generic/block.rs#L40 & https://github.com/paritytech/substrate/blob/fa778cc1187e37bbab132293ddbbb20158139ea5/primitives/runtime/src/generic/block.rs#L86
So in all cases, fields (via toJSON
) is always serialized with camelCase. This also applies to all methods exposed by the runtime, e.g. set_code
becomes setCode
on api.tx.system.*
. (In this case it is not due to the JSONRPC formats, but rather since in the JS world, camelCase it more wide-spread)
There is no override flag for this.
This issue has been open for 21 days with no activity and is not labelled as an enhancement. It will be closed in 7 days.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query.
I have noticed that types created with createType smallcases the key values , is there a way to keep the case information.
for example
will give me
But the rust types have a capital 'S' as in Sr25519, is there a way to keep the case information, apart from creating the json manually?