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

JsonPropertyName is not getting recognized while serializing due to Newtonsoft Dependency #138

Open
jayendusharma opened this issue Jun 23, 2023 · 1 comment

Comments

@jayendusharma
Copy link

jayendusharma commented Jun 23, 2023

While Acceptance and Integration testing using PostContentAsync method, I was going through the source code and I see a dependency to serialize using Newtonsoft JsonSerializerSettings (in ConvertToJsonStringContent within RESTFulApiFactoryClient).

In case the underlying object uses System.Text.Json JsonPropertyName Attribute . Those json settings are ignored, and I get BadRequest Error..

I tried handcrafting the object using ExpandoObject() with desired serialized property names and it worked.

In case the underlying "Type" uses System.Text.Json then serialization should honor System.Text.Json serialization logic instead of defaulting to Newtonsoft

@LBoullosa
Copy link
Contributor

This could be done with the new version which will be released soon. It allows to specify a func to serialize/deserialize with a different one than NewtonSoft.

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

2 participants