Skip to content
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

request: do not append '/j' in RawRequest() #31

Merged
merged 1 commit into from
Sep 3, 2024

Conversation

thiagokokada
Copy link
Owner

@thiagokokada thiagokokada commented Sep 3, 2024

This change moves the prefix of '/j' of the RawRequest() to prepareRequests() function instead. The prefix is used in Hyprland to indicate that the request needs to return JSON format, and while we always wants JSON format as response, someone using RawRequest() directly may not want to do so.

While this is a breaking change for users of RawRequest(), the impact should be minimal and will allow for more flexibility in future.

This also fixes a bug in batch mode, where we need to append '/j' in every command, not just the first one. It didn't affect the e.g. Dispatch() since it doesn't have a JSON output anyway, but it could affect something in the future.

@thiagokokada thiagokokada force-pushed the raw-reader-should-be-raw branch from ba6f262 to 4fffa0d Compare September 3, 2024 23:01
This change moves the prefix of '/j' of the `RawRequest()` to
`prepareRequests()` function instead. The prefix is used in Hyprland to
indicate that the request needs to return JSON format, and while we
always wants JSON format as response, someone using `RawRequest()`
directly may not want to do so.

While this is a breaking change for users of `RawRequest()`, the impact
should be minimal and will allow for more flexibility in future.

This also fixes a bug in batch mode, where we need to append '/j' in
every command, not just the first one. It didn't affect the e.g.
`Dispatch()` since it doesn't have a JSON output anyway, but it could
affect something in the future.
@thiagokokada thiagokokada force-pushed the raw-reader-should-be-raw branch from 4fffa0d to 5f0b2a8 Compare September 3, 2024 23:09
@thiagokokada thiagokokada merged commit 4f4c86e into main Sep 3, 2024
2 checks passed
@thiagokokada thiagokokada deleted the raw-reader-should-be-raw branch September 3, 2024 23:13
Sign up for free to 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.

1 participant