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

new Validator (callback, input, customParams) is out of date with @chainlink\external-adapter Validator class #5

Open
andrewhong5297 opened this issue Jun 11, 2021 · 1 comment

Comments

@andrewhong5297
Copy link

Currently, a validator object is created in createRequest in line 22 with

const validator = new Validator(callback, input, customParams)

However, the validator.js class constructor shows as

constructor(input = {}, customParams = {}) {
    this.input = input
    this.customParams = customParams
    this.validated = { data: {} }
    this.validateInput()
  }

So the external adapter template needs to be updated to

const validator = new Validator(input, customParams)

Otherwise the tests/calls will always fail with the error:

"{"error":{"jobRunID":"1","status":"errored","statusCode":400,"name":"AdapterError","cause":{}},"level":"error","message":"Error validating input.","instanceId":"fc8f1c9b-bcb4-4a2f-ade5-f8d85a116582","timestamp":"2021-06-10T01:48:11.433Z"}"

@happyeric77
Copy link

happyeric77 commented Oct 30, 2021

@andrewhong5297 have you managed to have this solved? I am also coming across the same issue I believe. Even though I input the correct data format, it still shows

{"error":{"cause":{},"jobRunID":"1","name":"AdapterError","status":"errored","statusCode":400},"instanceId":"5a88f3d2-6e83-4fd8-9cfb-5f0a660b697d","level":"error","message":"Error validating input.","timestamp":"2021-10-30T13:06:29.248Z"}

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

No branches or pull requests

2 participants