-
Notifications
You must be signed in to change notification settings - Fork 157
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
Fix pagination documentation for stellar-rpc #1363
Conversation
Something went wrong with PR preview build please check |
Something went wrong with PR preview build please check |
Preview is available here: |
Preview is available here: |
Preview is available here: |
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.
Nice! You need to regenerate the "compiled" RPC spec, though:
yarn rpcspec:build
@@ -39,7 +39,7 @@ | |||
}, | |||
"cursor": { | |||
"type": "string", | |||
"$ref": "#/components/schemas/GetEventsCursor" | |||
"$ref": "#/components/schemas/Cursor" |
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.
Each event itself also has a cursor - I think that needs to be updated, too?
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.
in the event schema the field is still called pagingToken
:
https://github.com/stellar/stellar-rpc/blob/main/protocol/get_events.go#L29-L30
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.
Oh oof, gotcha. That one is still useful for mid-page eventing, though, so idk if deprecated is the word? Then again they should use id
for that.
Preview is available here: |
@Shaptic can you take another look? I updated the pr with the following changes:
|
Fixes #1309
This PR consolidates the documentation for pagination that is used for getEvents, getTransactions, and getLedgers. All those endpoints use a
cursor
field in the request / response in order to do pagination.The
cursor
field used to be calledpaging_token
and this PR updates the documentation to referencecursor
instead ofpaging_token
.Also, the
cursor
field was missing in the schema of thegetEvents
andgetTransactions
responses. This PR includes thecursor
fields in those responses.