question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Question] Dynamic query parameters

See original GitHub issue

I 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:closed
  • Created 8 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
dflockcommented, Oct 13, 2016

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...

0reactions
webroncommented, Mar 3, 2017

Check the Path Parameters object to see how free-form query parameters were added in 3.0.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found