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

overwriteRequestQueryParams - Handle form encoded array query params #643

Merged
merged 2 commits into from
Aug 23, 2024

Conversation

thim81
Copy link
Collaborator

@thim81 thim81 commented Aug 23, 2024

linked to #640

OpenAPI

      parameters:
     ...
        - name: ids
          in: query
          description: >
            A form serialized array of category IDs to filter the results. <br>
            IDs that do not exist are ignored.
          required: false
          schema:
            type: array
            items:
              type: integer
          style: form
          examples:
            child_ids:
              value:
                - 315162
                - 315163
                - 315164
            top_level:
              value:
                - 83
                - 84

Portman Config

"overwrites": [
    {
      "openApiOperation": "*::*",
      "overwriteRequestQueryParams": [
        {
          "key": "name",
          "value": "{{newName}}"
        },
        {
          "key": "ids",
          "value": "{{_categoryId1}}"
        },
        {
          "key": "first",
          "value": "{{newFirst}}"
        },
        {
          "key": "ids",
          "value": "{{_categoryId2}}"
        },
        {
          "key": "ids",
          "value": "{{_categoryId3}}"
        }
      ,
        {
          "key": "number",
          "value": "{{newNumber1}}"
        },
        {
          "key": "number",
          "value": "{{newNumber2}}"
        },
        {
          "key": "word",
          "value": "{{newWord}}"
        }
      ]
    }
  ],

BEFORE
image

AFTER
image

@thim81 thim81 requested a review from nicklloyd August 23, 2024 10:20
@thim81 thim81 merged commit 6a7621f into main Aug 23, 2024
6 checks passed
@thim81 thim81 deleted the 640-query-params branch August 23, 2024 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants