-
Notifications
You must be signed in to change notification settings - Fork 196
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
rest_api: Enable resolve in query parameters #1978
Comments
We have a similar use-case: The Affinity CRM has three main entities: Persons, Companies and Opportunities. Basically it's three different query parameters:
@jlopezpena do you have an example for this by any chance? |
Another +1 for this |
I didn't see the last mention and I went ahead implementing a PR for the query parameters and JSON |
Feature description
For REST APIs, it should be possible to dynamically populate query parameters based on values obtained from an existing resource.
This can be currently done only if the resolved parameter is part of the path, but not if it is used inside the query.
Eg, this works in a source resource definition:
but this doesn't:
This forces creating a resource or transformer outside of the declarative API, using
@dlt.transformer
or@dlt.resource
decorators, and makes for overall messy codeAre you a dlt user?
I am scoping it for our company's use case
Use case
It is a very common pattern to find REST APIs where the id's of documents coming from a query are used in subsequent queries. Sometimes the API defines this as a path parameter, and sometimes as a query parameter. This is just an implementation detail that should be abstracted away in
dlt
.Proposed solution
The resolve mechanism should also work for query parameters. An ideal solution would work either with explicity inclusion of the query parameter in the path (as in the example above) or (even better!) in a declarative format, with something like this:
Related issues
None found
The text was updated successfully, but these errors were encountered: