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

Failed validation: #/definitions/QuoteSummaryResult #20

Closed
LesterLyu opened this issue Feb 5, 2021 · 4 comments
Closed

Failed validation: #/definitions/QuoteSummaryResult #20

LesterLyu opened this issue Feb 5, 2021 · 4 comments

Comments

@LesterLyu
Copy link

LesterLyu commented Feb 5, 2021

Problem getting quotes for ETFs and mutual funds

  • 0P000071W8.TO
  • QQQ
const data = await yahooFinance.quoteSummary("0P000071W8.TO");
const data = await yahooFinance.quoteSummary("QQQ");

Mutual Fund Error: The following result did not validate with schema: #/definitions/QuoteSummaryResult

[
  {
    keyword: 'required',
    dataPath: '/price',
    schemaPath: '#/definitions/Price/required',
    params: { missingProperty: 'regularMarketDayHigh' },
    message: "should have required property 'regularMarketDayHigh'"
  }
]

ETF Error: The following result did not validate with schema: #/definitions/QuoteSummaryResult

[
  {
    keyword: 'additionalProperties',
    dataPath: '/summaryDetail',
    schemaPath: '#/definitions/SummaryDetail/additionalProperties',
    params: { additionalProperty: 'yield' },
    message: 'should NOT have additional properties'
  }
]
@LesterLyu
Copy link
Author

LesterLyu commented Feb 5, 2021

A simple fix would be #16 and omit error prints.

@gadicc
Copy link
Owner

gadicc commented Feb 5, 2021

Hey @LesterLyu, thanks for reporting this.

I published a new version which let's you use all the options to skip validation and be less verbose with errors, as documented at https://github.com/gadicc/node-yahoo-finance2/blob/devel/docs/validation.md. (This URL is given during the error too).

This was a bit of a rushed release pre-weekend but only in terms of the above, everything else is better tested. Let me know if you run into trouble.

For the rest of it, will fix the schema hopefully over the weekend.

@gadicc
Copy link
Owner

gadicc commented Feb 5, 2021

(talking about 1.5.0)

gadicc pushed a commit that referenced this issue Feb 6, 2021
## [1.5.1](v1.5.0...v1.5.1) (2021-02-06)

### Bug Fixes

* **quoteSummary/iface:** additional fixes for mutual fund types ([#20](#20)) ([4d19692](4d19692))
* **quoteSummary/iface:** more optional fields, new Fund types ([#20](#20)) ([15bb4a1](15bb4a1))
* **validate:** init ajv with { allErrors: true } ([9793718](9793718))
@gadicc
Copy link
Owner

gadicc commented Feb 6, 2021

Thanks @LesterLyu, fixed in 1.5.1 with tests for all quoteSummary submodules for these two symbols. Please let me know if you have any further issues. I know these validation issues are annoying in the beta but we'll reap the rewards if we get it right now. Of course you always still have the option to turn off validation.

@gadicc gadicc closed this as completed Feb 6, 2021
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