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

Can't deserialize quotes. #112

Closed
kewur opened this issue May 23, 2021 · 7 comments
Closed

Can't deserialize quotes. #112

kewur opened this issue May 23, 2021 · 7 comments

Comments

@kewur
Copy link

kewur commented May 23, 2021

Hello,

I am using the StockPrices api to get the quote of a symbol. However it fails with the JsonSerializer exception "Serializer options cannot be changed once serialization or deserialization has occurred."

System.InvalidOperationException: Serializer options cannot be changed once serialization or deserialization has occurred.
   at System.Text.Json.ThrowHelper.ThrowInvalidOperationException_SerializerOptionsImmutable()
   at System.Text.Json.Serialization.ConverterList.Add(JsonConverter item)
   at IEXSharp.Helper.ExecutorBase.get_JsonSerializerOptions()
   at IEXSharp.Helper.ExecutorREST.ExecuteAsync[ReturnType](String urlPattern, NameValueCollection pathNVC, QueryStringBuilder qsb, Boolean forceUseSecretToken)
   at IEXSharp.Helper.ExecutorREST.SymbolExecuteAsync[ReturnType](String urlPattern, String symbol)
   at IEXSharp.Service.Cloud.CoreData.StockPrices.StockPricesService.QuoteAsync(String symbol)

From looking at the docs it looks like this happens when the JsonSerializerOptions is modified after use.

@kewur
Copy link
Author

kewur commented May 23, 2021

just upgraded to 2.9 and no issues. closing

@kewur kewur closed this as completed May 23, 2021
@kewur
Copy link
Author

kewur commented Jun 24, 2021

I am actually still getting this exception, but I'm not sure if it's something related to my code or is IEXSharp related

System.InvalidOperationException: Serializer options cannot be changed once serialization or deserialization has occurred.
   at System.Text.Json.ThrowHelper.ThrowInvalidOperationException_SerializerOptionsImmutable()
   at System.Text.Json.JsonSerializerOptions.VerifyMutable()
   at System.Text.Json.Serialization.ConverterList.Add(JsonConverter item)
   at IEXSharp.Helper.ExecutorBase.get_JsonSerializerOptions()
   at IEXSharp.Helper.ExecutorREST.ExecuteAsync[ReturnType](String urlPattern, NameValueCollection pathNVC, QueryStringBuilder qsb, Boolean forceUseSecretToken)
   at IEXSharp.Helper.ExecutorREST.SymbolExecuteAsync[ReturnType](String urlPattern, String symbol)
   at IEXSharp.Service.Cloud.CoreData.StockPrices.StockPricesService.QuoteAsync(String symbol)

I am also using System.Json in my code (with different options), but I don't think that should have any bearing on what the library does right?

@kewur kewur reopened this Jun 24, 2021
@vslee
Copy link
Owner

vslee commented Jun 24, 2021

Can you create a small repro?

@kewur
Copy link
Author

kewur commented Jul 1, 2021

I will try to create something this week

@Glen1337
Copy link

I am getting this same error as well

@vslee
Copy link
Owner

vslee commented Oct 15, 2021

I am getting this same error as well

Can you create a small repro?

@speecesystems
Copy link

speecesystems commented Oct 17, 2021 via email

@kewur kewur closed this as completed Feb 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants