-
Notifications
You must be signed in to change notification settings - Fork 88
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
Update portal_*Offer
jsonrpc call to accept multiple key-value pairs
#342
Changes from 4 commits
2714aee
b85fcc1
f62f44f
1b10f60
56c1757
16439d7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
jsonrpc/openrpc.json | ||
jsonrpc/node_modules |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -99,16 +99,13 @@ | |
}, | ||
{ | ||
"name": "portal_historyOffer", | ||
"summary": "Send an OFFER request with given ContentKey, to the designated peer and wait for a response.", | ||
"summary": "Send an OFFER request with given array of content items (keys & values), to the designated peer and wait for a response. The client MUST return an error if more than 64 content items are provided or less than 1 content items are provided..", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nitpick there's 2 periods at the end of this sentence |
||
"params": [ | ||
{ | ||
"$ref": "#/components/contentDescriptors/Enr" | ||
}, | ||
{ | ||
"$ref": "#/components/contentDescriptors/ContentKey" | ||
}, | ||
{ | ||
"$ref": "#/components/contentDescriptors/ContentValue" | ||
"$ref": "#/components/contentDescriptors/ContentItems" | ||
} | ||
], | ||
"result": { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,5 +38,24 @@ | |
"title": "UDP port number", | ||
"type": "string", | ||
"pattern": "^([1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$" | ||
}, | ||
"ContentItem": { | ||
"title": "content_item", | ||
"type": "array", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this an There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ScottyPoi said it should be a tupel? but that doesn't exist so I did an array. I will let you guys discuss what we should use as I am impartial as long as I can use this RPC command to test the spec. I do think an object would be potentially cleaner though, but I haven't looked too into this yet There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i'm OK with it either way There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I implemented it with tuples and it feels good so I am on the tuple side now There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This statement is rather confusing to me. Because afaik tuples don't exist in JSON, and when they are translated from other languages I think they are typically translated to objects. An object seems also more natural to me here, I think you don't need that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
sorry for the confusion. i thought "tuple" was universally an array-like structure, but with constraints (i.e. length: 2) |
||
"items": [ | ||
{ | ||
"title": "Content key", | ||
"description": "The encoded Portal content key", | ||
"$ref": "#/components/schemas/hexString" | ||
}, | ||
{ | ||
"title": "Content value", | ||
"description": "The encoded Portal content value", | ||
"$ref": "#/components/schemas/hexString" | ||
} | ||
], | ||
"minItems": 2, | ||
"maxItems": 2, | ||
"additionalItems": false | ||
} | ||
} |
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.
Same here