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

Widen allowed HTTP parameters #1797

Merged
merged 9 commits into from
Jun 7, 2023
Merged

Widen allowed HTTP parameters #1797

merged 9 commits into from
Jun 7, 2023

Conversation

aquarat
Copy link
Contributor

@aquarat aquarat commented Jun 5, 2023

Closes #1790
Relates to this thread on Slack.

This PR widens the type of allowed fixedOperation parameters and HTTP call parameters that can be used in Airnode.
This PR goes hand-in-hand with api3dao/ois#88

This allows a user to configure Airnode, either via a fixedOperationParameter or via pre-processing, to send a set of complex or non-string parameters to the remote API. The user's use case was to embed an array containing a false element in the JSON payload POSTed to an EVM node.

The OIS package will be swapped for the real package once the OIS PR is approved and package published.

I have tested these changes via the HTTP gateways. The test configuration can be found in the Slack thread^

Example from config.json:

            {
              "operationParameter": {
                "in": "query",
                "name": "params"
              },
              "value": [
                "finalized",
                false
              ]
            }

@aquarat aquarat changed the title 1790 widen http params Widen allowed HTTP parameters Jun 5, 2023
@aquarat aquarat requested a review from dcroote June 5, 2023 15:07
@aquarat aquarat self-assigned this Jun 5, 2023
@aquarat aquarat marked this pull request as ready for review June 5, 2023 15:14
@aquarat
Copy link
Contributor Author

aquarat commented Jun 6, 2023

@api3/ois has been published and references updated in this branch.

Copy link
Contributor

@dcroote dcroote left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! And thanks for testing, I'll go ahead and merge. Note I added one commit to bump Airnode's zod version to match that of OIS's zod version given multiple zod versions have been a problem before.

@dcroote dcroote merged commit 0b7d89e into master Jun 7, 2023
@dcroote dcroote deleted the 1790-widen-http-params branch June 7, 2023 06:28
@aquarat
Copy link
Contributor Author

aquarat commented Jun 7, 2023

Nice! And thanks for testing, I'll go ahead and merge. Note I added one commit to bump Airnode's zod version to match that of OIS's zod version given multiple zod versions have been a problem before.

Ah yes I’ve come across that too @ multiple Zod versions. Thanks for sorting out/merging :)

It might be worth asking the original issue reporting user to test the latest docker preview builds?

dcroote added a commit that referenced this pull request Jun 8, 2023
* Widen parameter type

* Fix validation tests

* Update @api3/ois fixtures

* Bump zod to match zod version in @api3/ois v2.1.0

---------

Co-authored-by: Derek Croote <[email protected]>
@aTeoke aTeoke modified the milestones: 0.12.0, 0.11.2 Jun 21, 2023
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.

How to send a JSON array or object as a parameter in a POST request?
3 participants