Skip to content

Fix JsonRpcRequest to be valid json - #130

Merged
legobeat merged 1 commit into
MetaMask:mainfrom
legobeat:fix-jsonrpcparams-no-undefined
Aug 28, 2023
Merged

Fix JsonRpcRequest to be valid json#130
legobeat merged 1 commit into
MetaMask:mainfrom
legobeat:fix-jsonrpcparams-no-undefined

Conversation

@legobeat

@legobeatlegobeat commented Aug 24, 2023

Copy link
Copy Markdown
Contributor

fix/types: JsonRpcParams should be valid JSON values

undefined is not valid JSON.

https://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf (Section 5):

A JSON value can be an object, array, number, string, true, false, or null.

Resolves: #129

Related type error: https://github.com/MetaMask/providers/actions/runs/5959652471/job/16165741468?pr=275

@legobeat
legobeatforce-pushed the fix-jsonrpcparams-no-undefined branch from 2e2f5d4 to 0018d5bCompareAugust 24, 2023 04:05
@legobeat
legobeatforce-pushed the fix-jsonrpcparams-no-undefined branch 2 times, most recently from e1e1ba4 to 1e421deCompareAugust 24, 2023 04:41
@legobeatlegobeat changed the title WIP: fix JsonRpcRequest to be valid jsonFix JsonRpcRequest to be valid jsonAug 24, 2023
fix/types: JsonRpcParams should be valid JSON values
`undefined` is not valid JSON.
https://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf
(Section 5):
A JSON value can be an object, array, number, string, true, false, or null.
@legobeat
legobeatforce-pushed the fix-jsonrpcparams-no-undefined branch from 1e421de to 4e5c07fCompareAugust 24, 2023 04:44
@legobeat
legobeat marked this pull request as ready for review August 24, 2023 04:48
@legobeat
legobeat requested a review from a team as a code ownerAugust 24, 2023 04:48
@legobeat
legobeat requested review from a team and kumavisAugust 28, 2023 01:18
Comment threadsrc/json.ts
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JsonRpcRequest allows non-JSON values

2 participants

@legobeat@FrederikBolding