interledger / open-payments

Protocol to setup payments between entities on the Web based on GNAP
https://openpayments.dev
Apache License 2.0
160 stars 27 forks source link

feat(open-payments): make schema validation in the open-payments client behind a flag #467

Closed mkurapov closed 2 months ago

mkurapov commented 2 months ago

Changes proposed in this pull request

Context

This change adds validateResponses flag to open payments client initialization function. This allows bypassing runtime response validation against the Open Payments OpenAPI specs.

This is particularly useful for the WM extension use case since the openapi validator libraries we use under the hood in @interledger/openapi use ajv schema validation during runtime, which uses unsafe eval , and as a result, prevents us from running it in the extension for manifest v3: https://github.com/ajv-validator/ajv/issues/406.

Fixes #454

changeset-bot[bot] commented 2 months ago

🦋 Changeset detected

Latest commit: 3ec839d553a866acaff44cbf170a312f2a25c61e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | -------------------------- | ----- | | @interledger/open-payments | Minor |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

netlify[bot] commented 2 months ago

Deploy Preview for openpayments-preview canceled.

Name Link
Latest commit 3ec839d553a866acaff44cbf170a312f2a25c61e
Latest deploy log https://app.netlify.com/sites/openpayments-preview/deploys/66321e8bb44cb90008d0e216
mkurapov commented 2 months ago

Tested in the browser with the extension, I do not see any errors related to the client initialization.