-
Notifications
You must be signed in to change notification settings - Fork 37.7k
rest: Move format string from path-like parameter to query parameter #25753
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
Conversation
e1f15ad
to
20fb03f
Compare
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
🐙 This pull request conflicts with the target branch and needs rebase. Want to unsubscribe from rebase notifications on this pull request? Just convert this pull request to a "draft". |
In future commits, we'll need to directly convert a format string into RESTResponseFormat without all the other logic from ParseDataFormat
Equivalent of -deprecatedrpc for the REST API. Allows the user to keep the specified deprecated functionality unchanged
Instead of specifying the response format as an e.g. ".json" path parameter, the format string is now expected to be in the query string "?format=json". This allows for a more standardized URI format, and removes the dependency on too tightly coupled code like ParseDataFormat(). Can be overridden with -deprecatedrest=format, which enables automatic parsing of the URI to move format strings from the path to the query.
No longer necessary since response format is a query parameter
20fb03f
to
901b132
Compare
Concept NACK. Not only does it break the API, the current interface is what is expected for format specification everywhere. |
There hasn't been much activity lately and the patch still needs rebase. What is the status here?
|
1 similar comment
There hasn't been much activity lately and the patch still needs rebase. What is the status here?
|
@stickies-v Looks like this was opened as draft a year ago with no further activity from you. Can this be closed? |
Closing as per #25752 (comment) |
Draft, for reference only to support #25752 for discussion on concept and approach. Code and tests should be fully functional, but still to be considered rough.
Brief summary
All REST API endpoints require the user to specify the response format by including a format string at the end of the path (e.g.
/rest/chaininfo.json
). This PR removes the path-like parameter and updates all endpoints to use a?format
query parameter, which defaults tojson
if unspecified.Previous behaviour can be preserved through
-deprecatedrest=format
Benefits:
json
response format seems reasonable, and was trivial to implement with a query parameterParseDataFormat()
function which had too many responsibilities-deprecatedrest
startup option, similar to-deprecatedrpc
. With this option, we keep API changes backwards compatible for as long as the-deprecatedrest
option is available (usually 1 version?).