[Question] Dynamic query parameters
See original GitHub issueI am using Ransack (https://github.com/activerecord-hackery/ransack/wiki/Basic-Searching) to build dynamic queries.
Say I have this model:
first_name: string
last_name: string
age: integer
email: string
Is there any way to document the following query?
GET api/v1/users?q[first_name_cont]=eric&q[email_not_cont]=gmail
or this?
GET api/v1/users?q[last_name_cont]=johnson&q[age_gt]=18&q[email_cont]=gmail
If not, do you know any workarounds for this?
Issue Analytics
- State:
- Created 8 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
dynamic query parameters in webclients - java - Stack Overflow
... question. Show activity on this post. Requirement - I have a servlet in which based on the url I need to make...
Read more >How to pass a dynamic parameter as SQL query in for SQL ...
I am trying to run dynamic queries with a parameter in Azure Data Flow but I continue to get the "Column operands are...
Read more >Dynamically add/remove query parameters in Postman request
A common issue that you may face when using Postman is adding or removing query parameters dynamically. In this tutorial, we explore a...
Read more >How to create a dynamic SQL query bases on query parameters
Hey, · Actually this is kind of very good question, as of now I have done this using DataWeave I have created the...
Read more >Dynamic query parameters in an Canvas App in Aura ...
Your Answer. Thanks for contributing an answer to Salesforce Stack Exchange! Please be sure to answer the question. Provide details and share ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have a similar issue - our application provides a REST query interface to a NoSQL backend, which our (enterprise, on-prem) customers can fill with whatever data they want.
This means that we don’t know the ‘schema’ - the field/key names - up front, so we couldn’t hardcode all the possible combinations into the spec file, even if we wanted to.
These appear in the query URL as parameters to query on, with a prefix of
data_
and a suffix for operator - e.g....&data_FirstName__eq=STRING:Brian...
or...&data_Weight__gte=70.0...
Check the Path Parameters object to see how free-form query parameters were added in 3.0.