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 for FUTURE quotes (e.g. "GC=F") #449

Closed
dtslvr opened this issue Apr 18, 2022 · 7 comments
Closed

Failed validation for FUTURE quotes (e.g. "GC=F") #449

dtslvr opened this issue Apr 18, 2022 · 7 comments
Labels
bug Something isn't working released validation Issues related to validation

Comments

@dtslvr
Copy link
Collaborator

dtslvr commented Apr 18, 2022

Validation Error

Minimal Reproduction

await yahooFinance.quote("GC=F");

Symbol(s) that it happened for

  • GC=F (gold)
  • SI=F (silver)
  • HG=F (copper)

Error Message

The following result did not validate with schema: #/definitions/QuoteResponseArray
[
  {
    instancePath: '/0',
    schemaPath: '#/anyOf',
    keyword: 'anyOf',
    params: {},
    message: 'must match a schema in anyOf',
    data: '[shortened by validateAndCoerceTypes]'
  }
]

Environment

Browser or Node: browser (CodeSandbox) and node
Library version: 2.3.1

@dtslvr dtslvr added bug Something isn't working validation Issues related to validation labels Apr 18, 2022
@gadicc gadicc changed the title Failed validation: #/definitions/QuoteResponseArray Failed validation for FUTURE quotes (e.g. "GC=F") Apr 27, 2022
gadicc pushed a commit that referenced this issue Apr 27, 2022
## [2.3.2](v2.3.1...v2.3.2) (2022-04-27)

### Bug Fixes

* **quote,quoteSummary:** support FUTURE type + tests (closes [#449](#449)) ([56b664b](56b664b))
@gadicc
Copy link
Owner

gadicc commented Apr 27, 2022

🎉 This issue has been resolved in version 2.3.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@gadicc
Copy link
Owner

gadicc commented Apr 27, 2022

Thanks @dtslvr for reporting. Seems you're the first to use the library with quotes of futures 😅

Fixed this in quote and quoteSummary and made sure that all other modules validate such symbols too (except recommendationsBySymbol which doesn't keep data for futures).

Thanks for reporting! All fixed :)

@gadicc gadicc closed this as completed in 56b664b Apr 27, 2022
@dtslvr
Copy link
Collaborator Author

dtslvr commented Apr 27, 2022

Thanks @dtslvr for reporting. Seems you're the first to use the library with quotes of futures 😅

Awesome! 😃
I'm happy to try it here: ghostfolio/ghostfolio#845

@gadicc
Copy link
Owner

gadicc commented Apr 27, 2022

Ah, great! 👏🎉

@gadicc
Copy link
Owner

gadicc commented Apr 27, 2022

It's commit 56b664b btw if you want to see the new fields... (skip the schema.json diff, see the changes to quote and quoteSummary, and then don't worry about all the cached tests).

@dtslvr
Copy link
Collaborator Author

dtslvr commented Apr 30, 2022

Hey @gadicc

I have successfully upgraded yahoo-finance2 to version 2.3.2 in Ghostfolio 1.144.0 and it works like a charm. Thank you very much! 😎

@gadicc
Copy link
Owner

gadicc commented Apr 30, 2022

Great news! Thanks for reporting back! 🙌🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released validation Issues related to validation
Projects
None yet
Development

No branches or pull requests

2 participants