studerw / td-ameritrade-client

TD Ameritrade Java Client
Apache License 2.0
69 stars 47 forks source link

TdaClient.fetchQuotes() fails with Exception #21

Closed FreeGoldRush closed 4 years ago

FreeGoldRush commented 4 years ago

Oops. My mistake...

studerw commented 4 years ago

test

On Tue, Jul 14, 2020, at 18:36, FreeGoldRush wrote:

Attempting to get EquityQuote instances using fetchQuotes()

7237 [main] INFO com.studerw.tda.client.HttpTdaClient - Fetching quotes: [FNDF, FNDE] 7239 [main] INFO TDA_HTTP - REQUEST GET: https://api.tdameritrade.com/v1/marketdata/quotes?symbol=FNDF,FNDE 7325 [main] INFO TDA_HTTP - RESPONSE [200 - ]: https://api.tdameritrade.com/v1/marketdata/quotes?symbol=FNDF,FNDE in 86.4 ms Exception in thread "main" java.lang.RuntimeException: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "assetMainType" (class com.studerw.tda.model.quote.EtfQuote), not marked as ignorable (39 known properties: "52WkLow", "highPrice", "marginable", "divAmount", "assetType", "bidPrice", "mark", "exchangeName", "regularMarketLastSize", "askPrice", "lastId", "securityStatus", "lastPrice", "lowPrice", "shortable", "symbol", "askSize", "bidSize", "openPrice", "delayed", "exchange", "volatility", "digits", "netChange", "closePrice", "tradeTimeInLong", "askId", "lastSize", "bidId", "regularMarketLastPrice", "description", "totalVolume", "quoteTimeInLong", "52WkHigh", "regularMarketNetChange", "peRatio", "regularMarketTradeTimeInLong", "divDate", "divYield"]) at [Source: java.io.BufferedInputStream@3fc2959f; line: 1, column: 45] (through reference chain: java.util.LinkedHashMap["FNDF"]->com.studerw.tda.model.quote.EtfQuote["assetMainType"]) at com.studerw.tda.parse.DefaultMapper.fromJson(DefaultMapper.java:83) at com.studerw.tda.parse.TdaJsonParser.parseQuotes(TdaJsonParser.java:39) at com.studerw.tda.client.HttpTdaClient.fetchQuotes(HttpTdaClient.java:238) at stocks.Trade.getAllQuotes(Trade.java:468) at stocks.Trade.main(Trade.java:68) Caused by: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "assetMainType" (class com.studerw.tda.model.quote.EtfQuote), not marked as ignorable (39 known properties: "52WkLow", "highPrice", "marginable", "divAmount", "assetType", "bidPrice", "mark", "exchangeName", "regularMarketLastSize", "askPrice", "lastId", "securityStatus", "lastPrice", "lowPrice", "shortable", "symbol", "askSize", "bidSize", "openPrice", "delayed", "exchange", "volatility", "digits", "netChange", "closePrice", "tradeTimeInLong", "askId", "lastSize", "bidId", "regularMarketLastPrice", "description", "totalVolume", "quoteTimeInLong", "52WkHigh", "regularMarketNetChange", "peRatio", "regularMarketTradeTimeInLong", "divDate", "divYield"]) at [Source: java.io.BufferedInputStream@3fc2959f; line: 1, column: 45] (through reference chain: java.util.LinkedHashMap["FNDF"]->com.studerw.tda.model.quote.EtfQuote["assetMainType"]) at com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:52) at com.fasterxml.jackson.databind.DeserializationContext.reportUnknownProperty(DeserializationContext.java:839) at com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:1045) at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownProperty(BeanDeserializerBase.java:1352) at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownVanilla(BeanDeserializerBase.java:1330) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:264) at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeOther(BeanDeserializer.java:161) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:136) at com.fasterxml.jackson.databind.jsontype.impl.AsPropertyTypeDeserializer._deserializeTypedForId(AsPropertyTypeDeserializer.java:122) at com.fasterxml.jackson.databind.jsontype.impl.AsPropertyTypeDeserializer.deserializeTypedFromObject(AsPropertyTypeDeserializer.java:93) at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeWithType(BeanDeserializerBase.java:992) at com.fasterxml.jackson.databind.deser.std.MapDeserializer._readAndBindStringMap(MapDeserializer.java:497) at com.fasterxml.jackson.databind.deser.std.MapDeserializer.deserialize(MapDeserializer.java:341) at com.fasterxml.jackson.databind.deser.std.MapDeserializer.deserialize(MapDeserializer.java:26) at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3736) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2803) at com.studerw.tda.parse.DefaultMapper.fromJson(DefaultMapper.java:81) ... 4 more

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/studerw/td-ameritrade-client/issues/21, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQHJAYPIIVPN4GRTETZ4S3R3TTYZANCNFSM4OZ7U6IQ.