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/SearchResult #398

Closed
pudgereyem opened this issue Feb 17, 2022 · 3 comments · Fixed by #400
Closed

Failed validation: #/definitions/SearchResult #398

pudgereyem opened this issue Feb 17, 2022 · 3 comments · Fixed by #400
Labels
bug Something isn't working released validation Issues related to validation

Comments

@pudgereyem
Copy link
Contributor

pudgereyem commented Feb 17, 2022

Validation Error

When using the search method the API now returns two new properties, culturalAssets and timeTakenForCulturalAssets. I haven't found out what the data could possibly be. So I suggest that we add Array<any> for now.

Minimal Reproduction

await yahooFinance.search('AAPL');

Symbol(s) that it happened for

  • AAPL
  • MSFT
  • ..and more

Error Message

The following result did not validate with schema: #/definitions/SearchResult
[
  {
    instancePath: '',
    schemaPath: '#/additionalProperties',
    keyword: 'additionalProperties',
    params: { additionalProperty: 'culturalAssets' },
    message: 'must NOT have additional properties'
  },
  {
    instancePath: '',
    schemaPath: '#/additionalProperties',
    keyword: 'additionalProperties',
    params: { additionalProperty: 'timeTakenForCulturalAssets' },
    message: 'must NOT have additional properties'
  }
]

..and this is the result from the API

{
    explains: [],
    count: 11,
    quotes: [
      {
        exchange: 'NMS',
        shortname: 'Apple Inc.',
        quoteType: 'EQUITY',
        symbol: 'AAPL',
        index: 'quotes',
        score: 69212496,
        typeDisp: 'Equity',
        longname: 'Apple Inc.',
        exchDisp: 'NASDAQ',
        isYahooFinance: true
      },
      {
        exchange: 'NEO',
        shortname: 'APPLE CDR (CAD HEDGED)',
        quoteType: 'EQUITY',
        symbol: 'AAPL.NE',
        index: 'quotes',
        score: 20967,
        typeDisp: 'Equity',
        longname: 'Apple Inc.',
        exchDisp: 'NEO',
        isYahooFinance: true
      },
      {
        exchange: 'OPR',
        shortname: 'AAPL Feb 2022 170.000 call',
        quoteType: 'OPTION',
        symbol: 'AAPL220218C00170000',
        index: 'quotes',
        score: 20243,
        typeDisp: 'Option',
        exchDisp: 'OPR',
        isYahooFinance: true
      },
      {
        exchange: 'OPR',
        shortname: 'AAPL Feb 2022 172.500 call',
        quoteType: 'OPTION',
        symbol: 'AAPL220218C00172500',
        index: 'quotes',
        score: 20222,
        typeDisp: 'Option',
        exchDisp: 'OPR',
        isYahooFinance: true
      },
      {
        exchange: 'MEX',
        shortname: 'APPLE INC',
        quoteType: 'EQUITY',
        symbol: 'AAPL.MX',
        index: 'quotes',
        score: 20218,
        typeDisp: 'Equity',
        longname: 'Apple Inc.',
        exchDisp: 'Mexico',
        isYahooFinance: true
      },
      {
        exchange: 'OPR',
        shortname: 'AAPL Feb 2022 175.000 call',
        quoteType: 'OPTION',
        symbol: 'AAPL220218C00175000',
        index: 'quotes',
        score: 20143,
        typeDisp: 'Option',
        exchDisp: 'OPR',
        isYahooFinance: true
      },
      {
        index: '78ddc07626ff4bbcae663e88514c23a0',
        name: 'AAPlasma',
        permalink: 'aaplasma',
        isYahooFinance: false
      }
    ],
    news: [
      {
        uuid: 'eb415229-71de-304d-90e1-7ed3eacd9dc3',
        title: 'Apple Shareholders Are Urged to Vote Against CEO Tim Cook’s Pay Package',
        publisher: 'Barrons.com',
        link: 'https://finance.yahoo.com/m/eb415229-71de-304d-90e1-7ed3eacd9dc3/apple-shareholders-are-urged.html',
        providerPublishTime: 2022-02-17T10:00:00.000Z,
        type: 'STORY'
      },
      {
        uuid: '47300807-30f3-36d6-a788-16364c33e21c',
        title: 'Nestlé Revenue Beat Expectations. The Stock is Down.',
        publisher: 'Barrons.com',
        link: 'https://finance.yahoo.com/m/47300807-30f3-36d6-a788-16364c33e21c/nestl%C3%A9-revenue-beat.html',
        providerPublishTime: 2022-02-17T10:47:00.000Z,
        type: 'STORY'
      },
      {
        uuid: '3c2250e1-d5c2-385f-bdd9-558e15347679',
        title: 'Top Stock Reports for Apple, Walt Disney & Broadcom',
        publisher: 'Zacks',
        link: 'https://finance.yahoo.com/news/top-stock-reports-apple-walt-232011015.html',
        providerPublishTime: 2022-02-16T23:20:11.000Z,
        type: 'STORY'
      },
      {
        uuid: '80e7eb03-4fa2-3977-aabc-938e4ebb6599',
        title: 'Frances Haugen: I believe in crypto',
        publisher: 'Yahoo Finance Video',
        link: 'https://finance.yahoo.com/video/frances-haugen-believe-crypto-110000416.html',
        providerPublishTime: 2022-02-17T11:00:00.000Z,
        type: 'VIDEO'
      }
    ],
    nav: [],
    lists: [],
    researchReports: [],
    screenerFieldResults: [],
    culturalAssets: [],
    totalTime: 36,
    timeTakenForQuotes: 419,
    timeTakenForNews: 700,
    timeTakenForAlgowatchlist: 400,
    timeTakenForPredefinedScreener: 400,
    timeTakenForCrunchbase: 400,
    timeTakenForNav: 400,
    timeTakenForResearchReports: 0,
    timeTakenForScreenerField: 0,
    timeTakenForCulturalAssets: 0
  },
  errors: [
    {
      instancePath: '',
      schemaPath: '#/additionalProperties',
      keyword: 'additionalProperties',
      params: { additionalProperty: 'culturalAssets' },
      message: 'must NOT have additional properties'
    },
    {
      instancePath: '',
      schemaPath: '#/additionalProperties',
      keyword: 'additionalProperties',
      params: { additionalProperty: 'timeTakenForCulturalAssets' },
      message: 'must NOT have additional properties'
    }
  ]
}

Environment

Browser or Node: node
Node version: v16
Library version: 2.1.3

@pudgereyem pudgereyem added bug Something isn't working validation Issues related to validation labels Feb 17, 2022
@pudgereyem
Copy link
Contributor Author

Similar to issue #255 I couldn't find out what the data for culturalAssets actually could look like. So let's open a new issue similar to #259 where we can track this.

@gadicc
Copy link
Owner

gadicc commented Feb 17, 2022

🎉 This issue has been resolved in version 2.1.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

@gadicc
Copy link
Owner

gadicc commented Feb 17, 2022

Thanks, @pudgereyem, for your great work, as usual 🙏

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

Successfully merging a pull request may close this issue.

2 participants