-
Notifications
You must be signed in to change notification settings - Fork 34
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
feat(open-payments): make schema validation in the open-payments client behind a flag #467
Conversation
… openapi schema validation
… disable openapi schema validation" This reverts commit b5f986a. # Conflicts: # packages/open-payments/src/client/requests.test.ts # packages/open-payments/src/client/requests.ts
# Conflicts: # .github/workflows/env-setup/action.yaml
…bal setup" This reverts commit 9285d60.
… openapi schema validation # Conflicts: # packages/open-payments/src/client/requests.test.ts # packages/open-payments/src/client/requests.ts
🦋 Changeset detectedLatest commit: 3ec839d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
@@ -129,6 +130,7 @@ const parseKey = ( | |||
|
|||
const createUnauthenticatedDeps = async ({ | |||
useHttp = false, | |||
validateResponses = true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the main change here: the addition of optional validateResponses
flag when creating the open payments clients.
✅ Deploy Preview for openpayments-preview canceled.
|
# Conflicts: # packages/open-payments/src/client/requests.ts
80c0037
to
28805f9
Compare
1f74dc9
to
865b6c5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you're waiting on Radu for a test in the browser, but it looks good to me
Tested in the browser with the extension, I do not see any errors related to the client initialization. |
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 unsafeeval
, and as a result, prevents us from running it in the extension for manifest v3: ajv-validator/ajv#406.Fixes #454