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 #639

Closed
EcceGratum opened this issue May 14, 2023 · 5 comments
Closed

Failed validation: #/definitions/QuoteSummaryResult #639

EcceGratum opened this issue May 14, 2023 · 5 comments
Labels
bug Something isn't working released validation Issues related to validation

Comments

@EcceGratum
Copy link

Validation Error

Minimal Reproduction

Symbol(s) that it happened for

  • HISU-U.TO

Error Message

The following result did not validate with schema: #/definitions/QuoteSummaryResult
[
  {
    instancePath: '/topHoldings',
    schemaPath: '#/required',
    keyword: 'required',
    params: { missingProperty: 'stockPosition' },
    message: "must have required property 'stockPosition'",
    data: {
      maxAge: 1,
      holdings: [],
      equityHoldings: {
        priceToEarnings: 0,
        priceToBook: 0,
        priceToSales: 0,
        priceToCashflow: 0
      },
      bondHoldings: {},
      bondRatings: [],
      sectorWeightings: []
    }
  },
  {
    instancePath: '/topHoldings',
    schemaPath: '#/required',
    keyword: 'required',
    params: { missingProperty: 'bondPosition' },
    message: "must have required property 'bondPosition'",
    data: {
      maxAge: 1,
      holdings: [],
      equityHoldings: {
        priceToEarnings: 0,
        priceToBook: 0,
        priceToSales: 0,
        priceToCashflow: 0
      },
      bondHoldings: {},
      bondRatings: [],
      sectorWeightings: []
    }
  }
]

Environment

Browser or Node:
Node version (if applicable):
Npm version:
Browser verion (if applicable):
Library version (e.g. 1.10.1):

Additional Context

ghostfolio/ghostfolio#1966

@EcceGratum EcceGratum added bug Something isn't working validation Issues related to validation labels May 14, 2023
@Xeli
Copy link

Xeli commented Jul 23, 2023

I'm experiencing the same issue with a bunch of ETFs.

@bmacedo
Copy link

bmacedo commented Jul 23, 2023

Same failure happens for the ETF CSH2.L

https://finance.yahoo.com/quote/CSH2.L/holdings?p=CSH2.L

@gadicc gadicc closed this as completed in cc669b8 Jul 24, 2023
gadicc added a commit that referenced this issue Jul 24, 2023
Additionally:

  * FundPerformancePerformanceOverview
    *  Add "fiveYrAvgReturnPct?: number;"
gadicc pushed a commit that referenced this issue Jul 24, 2023
## [2.4.3](v2.4.2...v2.4.3) (2023-07-24)

### Bug Fixes

* **deps:** update dependency node-fetch to v2.6.12 ([adbd93f](adbd93f))
* **deps:** update dependency tough-cookie to v4.1.3 ([aa4d087](aa4d087))
* **fixDevel:** send real request with full URL with crumb ([2911f36](2911f36))
* **quoteSummary:** schema: optional {stock,bond}Position (fixes [#639](#639)) ([cd63b48](cd63b48))
@gadicc
Copy link
Owner

gadicc commented Jul 24, 2023

🎉 This issue has been resolved in version 2.4.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@gadicc
Copy link
Owner

gadicc commented Jul 24, 2023

Thanks, @EcceGratum, @Xeli, @bmacedo for reporting and for your patience.

This is now fixed and released, as per the above.

I've also added a section in the validation docs about how to help contribute these kinds of fixes, if anyone is interested :) https://github.com/gadicc/node-yahoo-finance2/blob/devel/docs/validation.md#help-fix

The changes are usually very simple, e.g.:

Error: message: "must have required property 'stockPosition'" (and bondPosition)

Modify src/modules/quoteSummary-iface.ts:

export interface TopHoldings {
  [key: string]: any;
  maxAge: number;
-  stockPosition: number;
-  bondPosition: number;
+  stockPosition?: number;
+  bondPosition?: number;
  holdings: TopHoldingsHolding[];
  equityHoldings: TopHoldingsEquityHoldings;
  bondHoldings: object;

and of course, a little more time for testing, etc. I'm just so overloaded at the moment so some help would be great :)

gadicc pushed a commit that referenced this issue Aug 12, 2023
## [2.4.4](v2.4.3...v2.4.4) (2023-08-12)

### Bug Fixes

* **csv2json,historical:** dividends/csv with no data (fixes [#658](#658)) ([13dcc64](13dcc64))
* **deps:** update dependency node-fetch to v2.6.12 ([9f2352b](9f2352b))
* **deps:** update dependency tough-cookie to v4.1.3 ([8ea89d2](8ea89d2))
* **fixDevel:** send real request with full URL with crumb ([e3b2409](e3b2409))
* **quoteSummary:** schema: optional {stock,bond}Position (fixes [#639](#639)) ([cc669b8](cc669b8))
* **schema:** quoteSummary, secFilings types (fixes [#646](#646)) ([e92702e](e92702e))
* **search:** also "Futures" (in addition to "Future") for typeDisp ([d745b67](d745b67))
* **validateAndCoerceTypes:** add a node for #help-fix doc ([662760d](662760d))
* **validations:** quoteSummary BMW.DE (fixes [#638](#638)) ([d943e97](d943e97))
@gadicc
Copy link
Owner

gadicc commented Aug 12, 2023

🎉 This issue has been resolved in version 2.4.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

4 participants