-
Notifications
You must be signed in to change notification settings - Fork 11.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate JSON response sample #1971
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an amazing improvement on our regression detection! A great next step would be to add a mode for the sui/src/generate_json_rpc_spec.rs
to act as a mock data server and then we can connect the Explorer with it.
b7ba0d4
to
896e314
Compare
sui/open_rpc/samples/objects.json
Outdated
@@ -33,23 +41,25 @@ | |||
"data": { | |||
"dataType": "moveObject", | |||
"type": "0x2::Coin::Coin<0x2::SUI::SUI>", | |||
"fields": { | |||
"coin": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really not ideal as it is hard for clients to parse when some data has fields
while others has coin
and other names
sui/open_rpc/samples/objects.json
Outdated
"name": "Example NFT", | ||
"url": "ipfs://bafkreibngqhl3gaa7daob4i2vccziay2jjlp435cf66vhono7nrvww53ty" | ||
"url": { | ||
"string": "ipfs://bafkreibngqhl3gaa7daob4i2vccziay2jjlp435cf66vhono7nrvww53ty" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing I don't like about this is that sometimes the field name refers to a type (e.g., string
) while in other places it's not (e.g., version).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have removed the tag in the parent branch, I have condensed the enum types instead of using tags to remove ambiguity.
896e314
to
8158243
Compare
8158243
to
f7ef230
Compare
25119e2
to
a639cdc
Compare
f7ef230
to
f0317ff
Compare
Hi team, Thanks, Patrick! Great work, as always. Does this test plan represent a common workflow? Let me know how we can make best use of this work. Should we link to the samples from our JSON RPC page? Perhaps reuse the screenshots for Sui Explorer docs? Would love to expand the flow presented here with details for each step. |
Generate JSON response sample when schema changes.
The sample files are located in
sui/open_rpc/samples
, they will be regenerated together withopenrpc.json
when we runcargo -q run --example generate-json-rpc-spec -- record
, the files can be used for downstream testing.