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

Support multiple instances of query param #245

Closed
LucasPickering opened this issue May 30, 2024 · 0 comments · Fixed by #249
Closed

Support multiple instances of query param #245

LucasPickering opened this issue May 30, 2024 · 0 comments · Fixed by #249
Labels
feature New behavior to enable things that were previously not possible
Milestone

Comments

@LucasPickering
Copy link
Owner

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

You should be able to specify query params multiple times.

Describe the solution you'd like
A clear and concise description of what you want to happen

query should be able to take a list[string] in addition to the map[string, string], where each string is a key=value format (similar to docker-compose's environment mapping). This would allow you to specify a query param multiple times. When constructing the URL, the repeated param would simply be repeated.

recipes:
  repeated: !request
    url: "{{host}}/get_data"
    query:
      - a=1
      - b=1
      - a=2

This would render to this URL: <host>/get_data?a=1&b=1&a=1

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered

Simply allowing duplicate keys. This doesn't work because the YAML spec requires keys to be unique.

Additional context
Add any other context or screenshots about the feature request here

Maintaining mapping[string, string] support is important for backward compatibility

@LucasPickering LucasPickering added the feature New behavior to enable things that were previously not possible label May 30, 2024
@LucasPickering LucasPickering added this to the 1.4.0 milestone Jun 9, 2024
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Jun 17, 2024
[1.4.0] - 2024-06-11

Added

- Structured bodies can now be defined with tags on the body field of a recipe,
making it more convenient to construct bodies of common types. Supported types
are:
  - `!json` [#242](LucasPickering/slumber#242)
  - `!form_urlencoded` [#244](LucasPickering/slumber#244)
  - `!form_multipart` [#243](LucasPickering/slumber#243)
  - [See docs](https://slumber.lucaspickering.me/book/api/request_collection/recipe_body.html) for usage instructions
- Support multiple instances of the same query param [#245](LucasPickering/slumber#245) (@maksimowiczm)
  - Query params can now be defined as a list of `<param>=<value>` entries
  - [See docs](https://slumber.lucaspickering.me/book/api/request_collection/query_parameters.html)
- Templates can now render binary values in certain contexts
  - [See docs](https://slumber.lucaspickering.me/book/user_guide/templates.html#binary-templates)

Changed

- When a modal/dialog is open `q` now exits the dialog instead of the entire app
- Upgrade to Rust 1.76

Fixed

- Fix "Unknown request ID" error showing on startup [#238](LucasPickering/slumber#238)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New behavior to enable things that were previously not possible
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant