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 parsing query parameters into the ${params} object #1080

Open
vordimous opened this issue Jun 6, 2024 · 1 comment
Open

Support parsing query parameters into the ${params} object #1080

vordimous opened this issue Jun 6, 2024 · 1 comment
Labels
story Feature description from user's perspective

Comments

@vordimous
Copy link
Contributor

Describe the desired outcome from the user's perspective
As an API admin I need to add more dynamic parameters to a URL query by passing in different query parameters.

Acceptance criteria

  • Parse supported URL query parameters into the ${params} object
  • Create mechanisms to determine when a parameter is empty or missing
  • Handle arrays and allow mapping them to lists in the zilla.yaml

Additional context
/topic?keys=key1,keys=key2,keys=key3 would result in a filter:

      with:
        capability: fetch
        topic: items-snapshots
        filters:
          - key: key1
          - key: key2
          - key: key3
@vordimous vordimous added the story Feature description from user's perspective label Jun 6, 2024
@jfallows
Copy link
Contributor

jfallows commented Jun 6, 2024

Perhaps we need to keep the config simple and detect that a specific query parameter is multi-valued.

/topic?keys=key1,keys=key2,keys=key3 would result in a filter:

      with:
        capability: fetch
        topic: items-snapshots
        filters:
          - key: ${params.keys}

... which implicitly expands to the effective filter below:

      with:
        capability: fetch
        topic: items-snapshots
        filters:
          - key: key1
          - key: key2
          - key: key3

Internally I think we'd potentially be able to handle this generally as:

      with:
        capability: fetch
        topic: items-snapshots
        filters:
          - key: key1 OR key2 OR key3

In the case of key this is relatively clear, however when the query parameters map to header filters, then it is less clear if the values should always be ORed or sometimes be ANDed since the same header name can repeat in the same message with different values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
story Feature description from user's perspective
Projects
None yet
Development

No branches or pull requests

2 participants