-
Notifications
You must be signed in to change notification settings - Fork 62
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/QuoteResponse #32
Comments
@gadicc I'll create a PR according to the proposed solution above, but I'd love to hear your thoughts on the |
@gadicc please see PR that fixes the issue with Let's create a separate issue for how we best deal with running the test suite with devel mode turned off. Sadly you can't pass custom arguments to jest, so maybe the best option would be to add environment variables through |
Thanks, @pudgereyem. I think we might have a bunch of these type errors which we'll have some short term pain with but will reap the benefits for years after to get it right now (will discuss also in the other issue). So thanks for fixing this, I'll say also that for simple things like this you can just submit a PR without a whole write up (unless you enjoy it :) just trying to save you some time). Will address the caching issue elsewhere. |
Hey @gadicc, I agree! And yeah, I might start creating PR's without issues going forward. However, I sort of like creating issues because it gives me time to "focus on the problem" rather than "implementing a solution". It's also a good practice for documentation in its own way I believe. Super! |
🎉 This issue has been resolved in version 1.7.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Issue
Yahoo's quote endpoint returns different data depending on what time a day it is, e.g
quote.marketState
is a string that described the state of the market. In the current version it's allowed to be either"CLOSED"
or"PREPRE"
. However, at the time of this writing - when the market is closed -quote.marketState
was set to"POST"
and then later it was set to"POSTPOST"
.How to replicate
Run the integration tests for the quote module when the markets (e.g NASDAQ) are closed. Please also make sure that you disable caching by turning of devel mode for the "passing validation" tests (see code here).
Click to see the error for AAPL
Proposed Solution
Since the response from Yahoo's
/quote
-endpoint can return a response wheremarketState
is set to"POST"
or"POSTPOST"
we should add these ass possible values for themarketState
property for theQuoteBase
interface.Comments / Discussion
Caching the responses can hide issues like this where the response from Yahoo differs depending on the time of day
Since Yahoo's response is different depending on the time of the day, it's important that while in development we turn of devel mode every now and then. I was thinking that we could add parameter support to the
test
script so that you could run the tests with devel mode turned of, maybe something like this:The text was updated successfully, but these errors were encountered: