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

Fixes AddCustomAttribute throws Newtonsoft.Json.JsonWriterException: Unsupported type error when used to add header values #378

Merged
merged 2 commits into from
Dec 8, 2020

Conversation

jaffinito
Copy link
Member

Resolves #377

Description

Adds an if statement to JsonSerializerHelpers.cs to check if this the type is Microsoft.Extensions.Primitives.StringValues.
Went with strings since VS was not happy with using just the types as the conditional.

Added a small unit test to AgentApiTests.cs that checks StringValues.

Testing

Tests should pass as normal.

Changelog

Fixes a bug where using AddCustomAttribute throws Newtonsoft.Json.JsonWriterException: Unsupported type error when used to add header values.

@jaffinito jaffinito added the bug Something isn't working label Dec 7, 2020
Copy link
Member

@nr-ahemsath nr-ahemsath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks for adding a test.

If we had more time, I would like to explore a more generic fix for this issue, but we want to get this fix into today's release so we'll go with this as-is.

Copy link
Contributor

@vuqtran88 vuqtran88 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. We might want to find a better way to address it generically in the future.

@jaffinito jaffinito merged commit 46e0339 into main Dec 8, 2020
@jaffinito jaffinito deleted the json-unsupported-stringvalues branch December 8, 2020 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants